diff options
author | Thierry Bastian <thierry.bastian@nokia.com> | 2009-11-10 16:55:14 (GMT) |
---|---|---|
committer | Thierry Bastian <thierry.bastian@nokia.com> | 2009-11-10 16:56:42 (GMT) |
commit | 2321e8636d7436b70a8afcde16828f00c4b8590e (patch) | |
tree | 21c8748f2e03bf88b56838e96d38b46e5743b0c3 /tests/auto/qdockwidget | |
parent | 6e6803540d50f14a2c4a6e1ee551310fa96d0cb6 (diff) | |
download | Qt-2321e8636d7436b70a8afcde16828f00c4b8590e.zip Qt-2321e8636d7436b70a8afcde16828f00c4b8590e.tar.gz Qt-2321e8636d7436b70a8afcde16828f00c4b8590e.tar.bz2 |
Make it possible for QMainWindow to restore the geom of undocked widget
Task-number: QTBUG-5663
Reviewed-by: ogoffart
Diffstat (limited to 'tests/auto/qdockwidget')
-rw-r--r-- | tests/auto/qdockwidget/tst_qdockwidget.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/auto/qdockwidget/tst_qdockwidget.cpp b/tests/auto/qdockwidget/tst_qdockwidget.cpp index eb3f641..e04ed18 100644 --- a/tests/auto/qdockwidget/tst_qdockwidget.cpp +++ b/tests/auto/qdockwidget/tst_qdockwidget.cpp @@ -87,6 +87,7 @@ private slots: void dockLocationChanged(); void setTitleBarWidget(); void titleBarDoubleClick(); + void restoreStateOfFloating(); // task specific tests: void task165177_deleteFocusWidget(); void task169808_setFloating(); @@ -715,6 +716,21 @@ void tst_QDockWidget::titleBarDoubleClick() QCOMPARE(win.dockWidgetArea(&dock), Qt::TopDockWidgetArea); } +void tst_QDockWidget::restoreStateOfFloating() +{ + QMainWindow mw; + QDockWidget dock; + dock.setObjectName("dock1"); + mw.addDockWidget(Qt::TopDockWidgetArea, &dock); + QVERIFY(!dock.isFloating()); + QByteArray ba = mw.saveState(); + dock.setFloating(true); + QVERIFY(dock.isFloating()); + QVERIFY(mw.restoreState(ba)); + QVERIFY(!dock.isFloating()); +} + + void tst_QDockWidget::task165177_deleteFocusWidget() { QMainWindow mw; |