summaryrefslogtreecommitdiffstats
path: root/src/gui/widgets/qsplitter.cpp
diff options
context:
space:
mode:
authorGunnar Sletta <gunnar@trolltech.com>2009-11-03 11:52:16 (GMT)
committerGunnar Sletta <gunnar@trolltech.com>2009-11-03 11:52:16 (GMT)
commit2e02518498379fc691a27ec96ae182aff436a38d (patch)
tree1ed6ce158c8de6507b36ae2b70133edbc6beca5d /src/gui/widgets/qsplitter.cpp
parentfc4a3206fd89d28c0b0c6c36fa0c136a65e2e057 (diff)
parent9fab0ede200960f0dbec1457757a6ba3214c3ce6 (diff)
downloadQt-2e02518498379fc691a27ec96ae182aff436a38d.zip
Qt-2e02518498379fc691a27ec96ae182aff436a38d.tar.gz
Qt-2e02518498379fc691a27ec96ae182aff436a38d.tar.bz2
Merge branch '4.6' of git@scm.dev.nokia.troll.no:qt/qt into 4.6
Diffstat (limited to 'src/gui/widgets/qsplitter.cpp')
-rw-r--r--src/gui/widgets/qsplitter.cpp17
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;