mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-04-23 10:39:46 -05:00
Recurse in setLayoutVisible()
This commit is contained in:
parent
d450210d39
commit
1d45072c58
|
|
@ -232,11 +232,18 @@ void clearLayout(QLayout *layout, int afterIdx)
|
|||
|
||||
void setLayoutVisible(QLayout *layout, bool visible)
|
||||
{
|
||||
if (!layout) {
|
||||
return;
|
||||
}
|
||||
for (int i = 0; i < layout->count(); ++i) {
|
||||
QWidget *widget = layout->itemAt(i)->widget();
|
||||
if (widget != NULL) {
|
||||
QLayout *nestedLayout = layout->itemAt(i)->layout();
|
||||
if (widget) {
|
||||
widget->setVisible(visible);
|
||||
}
|
||||
if (nestedLayout) {
|
||||
setLayoutVisible(nestedLayout, visible);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user