summaryrefslogtreecommitdiffstats
path: root/tests/auto/qdockwidget
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/qdockwidget')
-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()
{