diff options
author | Thierry Bastian <thierry.bastian@nokia.com> | 2009-09-02 08:41:28 (GMT) |
---|---|---|
committer | Thierry Bastian <thierry.bastian@nokia.com> | 2009-09-02 08:43:39 (GMT) |
commit | b0214670579bfabfa8f02647f579d3834968802c (patch) | |
tree | 236154a816ae5999422f64e357045f9ec4a2bd88 /tests | |
parent | 05e30a4aa7ae5ea552c459fc7d64c8270ec34105 (diff) | |
download | Qt-b0214670579bfabfa8f02647f579d3834968802c.zip Qt-b0214670579bfabfa8f02647f579d3834968802c.tar.gz Qt-b0214670579bfabfa8f02647f579d3834968802c.tar.bz2 |
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')
-rw-r--r-- | tests/auto/qmainwindow/tst_qmainwindow.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/auto/qmainwindow/tst_qmainwindow.cpp b/tests/auto/qmainwindow/tst_qmainwindow.cpp index ffa5853..0049c8d 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" |