summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorThierry Bastian <thierry.bastian@nokia.com>2009-11-09 16:25:49 (GMT)
committerThierry Bastian <thierry.bastian@nokia.com>2009-11-09 16:25:49 (GMT)
commit963d42fbf1fb68c2bd09b12dedbad000d8001b94 (patch)
treec1c8cc710fe1e6ebf08f03fa4347b616a574237e /tests
parent0b7a5ebb7c4a65a931d2c69b9d3780cdc6ece893 (diff)
downloadQt-963d42fbf1fb68c2bd09b12dedbad000d8001b94.zip
Qt-963d42fbf1fb68c2bd09b12dedbad000d8001b94.tar.gz
Qt-963d42fbf1fb68c2bd09b12dedbad000d8001b94.tar.bz2
Make sure the dock widget is updated when changing closable property
Task-number: QTBUG-1665 Reviewed-by: ogoffart
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qdockwidget/tst_qdockwidget.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/auto/qdockwidget/tst_qdockwidget.cpp b/tests/auto/qdockwidget/tst_qdockwidget.cpp
index e62ba8c..eb3f641 100644
--- a/tests/auto/qdockwidget/tst_qdockwidget.cpp
+++ b/tests/auto/qdockwidget/tst_qdockwidget.cpp
@@ -93,6 +93,7 @@ private slots:
void task237438_setFloatingCrash();
void task248604_infiniteResize();
void task258459_visibilityChanged();
+ void taskQTBUG_1665_closableChanged();
};
// Testing get/set functions
@@ -834,5 +835,22 @@ void tst_QDockWidget::task258459_visibilityChanged()
QCOMPARE(spy2.first().first().toBool(), true); //dock1 is visible
}
+void tst_QDockWidget::taskQTBUG_1665_closableChanged()
+{
+ QDockWidget dock;
+ dock.show();
+ QTest::qWaitForWindowShown(&dock);
+
+ if (dock.windowFlags() & Qt::FramelessWindowHint)
+ QSKIP("this machine doesn't support native dock widget", SkipAll);
+
+ QVERIFY(dock.windowFlags() & Qt::WindowCloseButtonHint);
+
+ //now let's remove the closable attribute
+ dock.setFeatures(dock.features() ^ QDockWidget::DockWidgetClosable);
+ QVERIFY(!(dock.windowFlags() & Qt::WindowCloseButtonHint));
+}
+
+
QTEST_MAIN(tst_QDockWidget)
#include "tst_qdockwidget.moc"