summaryrefslogtreecommitdiffstats
path: root/tests/auto/qdockwidget
diff options
context:
space:
mode:
authorThierry Bastian <thierry.bastian@nokia.com>2009-11-10 17:01:27 (GMT)
committerThierry Bastian <thierry.bastian@nokia.com>2009-11-10 17:01:27 (GMT)
commitba5fea372219000050715ecfac8fba9a6fd1b638 (patch)
tree2e0d8e5b33f5f6446967c71d7f23bd73ce680673 /tests/auto/qdockwidget
parent2321e8636d7436b70a8afcde16828f00c4b8590e (diff)
downloadQt-ba5fea372219000050715ecfac8fba9a6fd1b638.zip
Qt-ba5fea372219000050715ecfac8fba9a6fd1b638.tar.gz
Qt-ba5fea372219000050715ecfac8fba9a6fd1b638.tar.bz2
QDockWidget also emits dockLocationChanged when the state is restored
...on the main window. Task-number: QTBUG-1304 Reviewed-by: ogoffart
Diffstat (limited to 'tests/auto/qdockwidget')
-rw-r--r--tests/auto/qdockwidget/tst_qdockwidget.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/auto/qdockwidget/tst_qdockwidget.cpp b/tests/auto/qdockwidget/tst_qdockwidget.cpp
index e04ed18..c9a7f1c 100644
--- a/tests/auto/qdockwidget/tst_qdockwidget.cpp
+++ b/tests/auto/qdockwidget/tst_qdockwidget.cpp
@@ -614,6 +614,7 @@ void tst_QDockWidget::dockLocationChanged()
QMainWindow mw;
QDockWidget dw;
+ dw.setObjectName("dock1");
QSignalSpy spy(&dw, SIGNAL(dockLocationChanged(Qt::DockWidgetArea)));
mw.addDockWidget(Qt::LeftDockWidgetArea, &dw);
@@ -638,6 +639,7 @@ void tst_QDockWidget::dockLocationChanged()
QCOMPARE(spy.count(), 0);
QDockWidget dw2;
+ dw2.setObjectName("dock2");
mw.addDockWidget(Qt::TopDockWidgetArea, &dw2);
mw.tabifyDockWidget(&dw2, &dw);
QCOMPARE(spy.count(), 1);
@@ -659,6 +661,12 @@ void tst_QDockWidget::dockLocationChanged()
QCOMPARE(qvariant_cast<Qt::DockWidgetArea>(spy.at(0).at(0)),
Qt::TopDockWidgetArea);
spy.clear();
+
+ QByteArray ba = mw.saveState();
+ mw.restoreState(ba);
+ QCOMPARE(spy.count(), 1);
+ QCOMPARE(qvariant_cast<Qt::DockWidgetArea>(spy.at(0).at(0)),
+ Qt::TopDockWidgetArea);
}
void tst_QDockWidget::featuresChanged()