summaryrefslogtreecommitdiffstats
path: root/tests/auto/qmainwindow
diff options
context:
space:
mode:
authorThierry Bastian <thierry.bastian@nokia.com>2009-09-02 10:41:28 +0200
committerThierry Bastian <thierry.bastian@nokia.com>2009-09-02 10:43:39 +0200
commitb0214670579bfabfa8f02647f579d3834968802c (patch)
tree236154a816ae5999422f64e357045f9ec4a2bd88 /tests/auto/qmainwindow
parent05e30a4aa7ae5ea552c459fc7d64c8270ec34105 (diff)
QMainWindow doesn't respect the sizehint of the dockwidgets
It used to compress it because in the layout we were never picking the sizeHint. Now we do. Task-number: 260483
Diffstat (limited to 'tests/auto/qmainwindow')
-rw-r--r--tests/auto/qmainwindow/tst_qmainwindow.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/auto/qmainwindow/tst_qmainwindow.cpp b/tests/auto/qmainwindow/tst_qmainwindow.cpp
index ffa58536da..0049c8df7b 100644
--- a/tests/auto/qmainwindow/tst_qmainwindow.cpp
+++ b/tests/auto/qmainwindow/tst_qmainwindow.cpp
@@ -107,6 +107,7 @@ private slots:
void setCursor();
void addToolbarAfterShow();
void centralWidgetSize();
+ void dockWidgetSize();
};
// Testing get/set functions
@@ -1677,6 +1678,24 @@ void tst_QMainWindow::centralWidgetSize()
QCOMPARE(widget.size(), widget.sizeHint());
}
+void tst_QMainWindow::dockWidgetSize()
+{
+ QMainWindow mainWindow;
+ mainWindow.menuBar()->addMenu("menu");
+
+ MyWidget widget;
+ mainWindow.setCentralWidget(&widget);
+
+ QDockWidget dock;
+ dock.setWidget(new MyWidget);
+ mainWindow.addDockWidget(Qt::TopDockWidgetArea, &dock);
+
+ mainWindow.show();
+ QTest::qWait(100);
+ QCOMPARE(widget.size(), widget.sizeHint());
+ QCOMPARE(dock.widget()->size(), dock.widget()->sizeHint());
+}
+
QTEST_MAIN(tst_QMainWindow)
#include "tst_qmainwindow.moc"