diff options
author | Thierry Bastian <thierry.bastian@nokia.com> | 2009-08-07 12:01:26 (GMT) |
---|---|---|
committer | Thierry Bastian <thierry.bastian@nokia.com> | 2009-08-07 12:02:41 (GMT) |
commit | f37b4ab8c8116abc2f71128e308b938c90ec5b8a (patch) | |
tree | 0953911320c8d52603f43bf2948792a9aeee8852 /tests/auto/qdockwidget | |
parent | 3c2b9047be4f4f835e59c13d5038b907c629451f (diff) | |
download | Qt-f37b4ab8c8116abc2f71128e308b938c90ec5b8a.zip Qt-f37b4ab8c8116abc2f71128e308b938c90ec5b8a.tar.gz Qt-f37b4ab8c8116abc2f71128e308b938c90ec5b8a.tar.bz2 |
QDockWidget: Make visibilityChanged more accurate
Task-number: 258459
Diffstat (limited to 'tests/auto/qdockwidget')
-rw-r--r-- | tests/auto/qdockwidget/tst_qdockwidget.cpp | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/tests/auto/qdockwidget/tst_qdockwidget.cpp b/tests/auto/qdockwidget/tst_qdockwidget.cpp index 9b0e706..16bb12d 100644 --- a/tests/auto/qdockwidget/tst_qdockwidget.cpp +++ b/tests/auto/qdockwidget/tst_qdockwidget.cpp @@ -91,6 +91,7 @@ private slots: void task169808_setFloating(); void task237438_setFloatingCrash(); void task248604_infiniteResize(); + void task258459_visibilityChanged(); }; // Testing get/set functions @@ -730,7 +731,7 @@ void tst_QDockWidget::task169808_setFloating() return QSize(20,20); } - void paintEvent(QPaintEvent *e) + void paintEvent(QPaintEvent *) { QPainter p(this); p.fillRect(rect(), Qt::red); @@ -798,5 +799,21 @@ void tst_QDockWidget::task248604_infiniteResize() } +void tst_QDockWidget::task258459_visibilityChanged() +{ + QMainWindow win; + QDockWidget dock1, dock2; + win.addDockWidget(Qt::RightDockWidgetArea, &dock1); + win.tabifyDockWidget(&dock1, &dock2); + QSignalSpy spy1(&dock1, SIGNAL(visibilityChanged(bool))); + QSignalSpy spy2(&dock2, SIGNAL(visibilityChanged(bool))); + win.show(); + QTest::qWait(200); + QCOMPARE(spy1.count(), 1); + QCOMPARE(spy1.first().first().toBool(), false); //dock1 is invisible + QCOMPARE(spy2.count(), 1); + QCOMPARE(spy2.first().first().toBool(), true); //dock1 is visible +} + QTEST_MAIN(tst_QDockWidget) #include "tst_qdockwidget.moc" |