diff options
author | Gabriel de Dietrich <gabriel.dietrich-de@nokia.com> | 2009-10-28 08:58:18 (GMT) |
---|---|---|
committer | Gabriel de Dietrich <gabriel.dietrich-de@nokia.com> | 2009-10-28 09:28:33 (GMT) |
commit | a925ba1ab6316a155f2ac61f898c52f07a1340b4 (patch) | |
tree | 89533a3f82bbf341ea840a85f31f47f07cf27cf0 /src/gui | |
parent | 1f3218e086778a0e324542a00937cd44e8e10c79 (diff) | |
download | Qt-a925ba1ab6316a155f2ac61f898c52f07a1340b4.zip Qt-a925ba1ab6316a155f2ac61f898c52f07a1340b4.tar.gz Qt-a925ba1ab6316a155f2ac61f898c52f07a1340b4.tar.bz2 |
QSplitter would not show previously collapsed widgets.
After deleting or hiding the last non collapsed item in a QSplitter, none would
be visible. We now check wether there is any non-hidden, collapsed widget, and
set it to non-collapsed. Auto-test included.
Task-number: QTBUG-4101
Reviewed-by: Olivier
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/widgets/qsplitter.cpp | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/src/gui/widgets/qsplitter.cpp b/src/gui/widgets/qsplitter.cpp index e3121ae..520a802 100644 --- a/src/gui/widgets/qsplitter.cpp +++ b/src/gui/widgets/qsplitter.cpp @@ -360,13 +360,26 @@ void QSplitterPrivate::recalc(bool update) before a hidden widget must be hidden. */ bool first = true; + bool allInvisible = n != 0; for (int i = 0; i < n ; ++i) { QSplitterLayoutStruct *s = list.at(i); - s->handle->setHidden(first || s->widget->isHidden()); - if (!s->widget->isHidden()) + bool widgetHidden = s->widget->isHidden(); + if (allInvisible && !widgetHidden && !s->collapsed) + allInvisible = false; + s->handle->setHidden(first || widgetHidden); + if (!widgetHidden) first = false; } + if (allInvisible) + for (int i = 0; i < n ; ++i) { + QSplitterLayoutStruct *s = list.at(i); + if (!s->widget->isHidden()) { + s->collapsed = false; + break; + } + } + int fi = 2 * q->frameWidth(); int maxl = fi; int minl = fi; |