tests/auto/qstatusbar/tst_qstatusbar.cpp
changeset 3 41300fa6a67c
parent 0 1918ee327afb
child 4 3b1da2848fc7
--- a/tests/auto/qstatusbar/tst_qstatusbar.cpp	Tue Jan 26 12:42:25 2010 +0200
+++ b/tests/auto/qstatusbar/tst_qstatusbar.cpp	Tue Feb 02 00:43:10 2010 +0200
@@ -77,6 +77,7 @@
     void insertPermanentWidget();
     void setSizeGripEnabled();
     void task194017_hiddenWidget();
+    void QTBUG4334_hiddenOnMaximizedWindow();
 
 private:
     QStatusBar *testWidget;
@@ -257,6 +258,24 @@
     QVERIFY(!label->isVisible());
 }
 
+void tst_QStatusBar::QTBUG4334_hiddenOnMaximizedWindow()
+{
+    QMainWindow main;
+    QStatusBar statusbar;
+    statusbar.setSizeGripEnabled(true);
+    main.setStatusBar(&statusbar);
+    main.showMaximized();
+    QTest::qWaitForWindowShown(&main);
+#ifndef Q_WS_MAC
+    QVERIFY(!statusbar.findChild<QSizeGrip*>()->isVisible());
+#endif
+    main.showNormal();
+    QTest::qWaitForWindowShown(&main);
+    QVERIFY(statusbar.findChild<QSizeGrip*>()->isVisible());
+    main.showFullScreen();
+    QTest::qWaitForWindowShown(&main);
+    QVERIFY(!statusbar.findChild<QSizeGrip*>()->isVisible());
+}
 
 QTEST_MAIN(tst_QStatusBar)
 #include "tst_qstatusbar.moc"