summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorDavid Faure <faure@kde.org>2010-07-15 14:08:43 (GMT)
committerMarius Storm-Olsen <marius.storm-olsen@nokia.com>2010-10-01 20:07:07 (GMT)
commitb3a46493a1a74bd7918bd68638c28cf6e84eb57f (patch)
treee57bef65a7d5f460b8f5c3e47eeb28be62959d6a /tests
parent4cdaadb332a49513d6082b6ea723dc1968b3ad30 (diff)
downloadQt-b3a46493a1a74bd7918bd68638c28cf6e84eb57f.zip
Qt-b3a46493a1a74bd7918bd68638c28cf6e84eb57f.tar.gz
Qt-b3a46493a1a74bd7918bd68638c28cf6e84eb57f.tar.bz2
QWorkspace: fix hardcoded min size overwriting the real min size
The setMinimumSize call was having precedence over the minimumSizeHint, so when having a sizegrip enabled it was possible to resize a MDI window to a much smaller size than its min size (actually it would flicker between the two sizes, on each resize). Fixed by moving that min size (for the titlebar contents) to the calculations in minimumSizeHint(). Reviewed-by: mariusso
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qworkspace/tst_qworkspace.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/auto/qworkspace/tst_qworkspace.cpp b/tests/auto/qworkspace/tst_qworkspace.cpp
index 4cf76b5..9039eb3 100644
--- a/tests/auto/qworkspace/tst_qworkspace.cpp
+++ b/tests/auto/qworkspace/tst_qworkspace.cpp
@@ -44,6 +44,7 @@
#include <qapplication.h>
#include <qmainwindow.h>
#include <qmenubar.h>
+#include <qlayout.h>
#include <qworkspace.h>
#if defined(QT3_SUPPORT)
#include <q3popupmenu.h>
@@ -591,16 +592,25 @@ void tst_QWorkspace::childSize()
MyChild *child = new MyChild(&ws);
child->show();
+ ws.addWindow(child);
QCOMPARE(child->size(), child->sizeHint());
delete child;
child = new MyChild(&ws);
child->setFixedSize(200, 200);
child->show();
+ ws.addWindow(child);
QCOMPARE(child->size(), child->minimumSize());
+ QCOMPARE(child->parentWidget()->metaObject()->className(), "QWorkspaceChild");
+ QVERIFY(child->parentWidget()->width() >= 200);
+ // check that the minimum size is respected, using closestAcceptableSize
+ // like QSizeGrip does.
+ const QSize newSize = QLayout::closestAcceptableSize(child->parentWidget(), QSize(100, 100));
+ QVERIFY(newSize.width() >= 200);
delete child;
child = new MyChild(&ws);
+ ws.addWindow(child);
child->resize(150, 150);
child->show();
QCOMPARE(child->size(), QSize(150,150));