summaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
authorThierry Bastian <thierry.bastian@nokia.com>2009-10-28 10:31:33 (GMT)
committerThierry Bastian <thierry.bastian@nokia.com>2009-10-28 10:33:29 (GMT)
commit44f8fac4e2fc4a4258b921ac595c2826ca96e99c (patch)
tree2eb123b1b431ca43bcf3a681ebc04d7fd5a98c22 /tests/auto
parent42fdaf078b9332e13d260df00359e8adc8522872 (diff)
downloadQt-44f8fac4e2fc4a4258b921ac595c2826ca96e99c.zip
Qt-44f8fac4e2fc4a4258b921ac595c2826ca96e99c.tar.gz
Qt-44f8fac4e2fc4a4258b921ac595c2826ca96e99c.tar.bz2
Double-clicking a dock widget titlebar could make it disappear
If it wasn't already docked on a mainwindow, its state would become unexpected. Task-number: QTBUG-945 Reviewed-by: gabi
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/qdockwidget/tst_qdockwidget.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/auto/qdockwidget/tst_qdockwidget.cpp b/tests/auto/qdockwidget/tst_qdockwidget.cpp
index dc67f36..e62ba8c 100644
--- a/tests/auto/qdockwidget/tst_qdockwidget.cpp
+++ b/tests/auto/qdockwidget/tst_qdockwidget.cpp
@@ -86,6 +86,7 @@ private slots:
void visibilityChanged();
void dockLocationChanged();
void setTitleBarWidget();
+ void titleBarDoubleClick();
// task specific tests:
void task165177_deleteFocusWidget();
void task169808_setFloating();
@@ -694,6 +695,24 @@ void tst_QDockWidget::setTitleBarWidget()
QCOMPARE(w2.isVisible(), false);
}
+void tst_QDockWidget::titleBarDoubleClick()
+{
+ QMainWindow win;
+ QDockWidget dock(&win);
+ win.show();
+ dock.setFloating(true);
+
+ QEvent e(QEvent::NonClientAreaMouseButtonDblClick);
+ QApplication::sendEvent(&dock, &e);
+ QVERIFY(dock.isFloating());
+ QCOMPARE(win.dockWidgetArea(&dock), Qt::NoDockWidgetArea);
+
+ win.addDockWidget(Qt::TopDockWidgetArea, &dock);
+ dock.setFloating(true);
+ QApplication::sendEvent(&dock, &e);
+ QVERIFY(!dock.isFloating());
+ QCOMPARE(win.dockWidgetArea(&dock), Qt::TopDockWidgetArea);
+}
void tst_QDockWidget::task165177_deleteFocusWidget()
{