diff options
author | Carlos Manuel Duclos Vergara <carlos.duclos@nokia.com> | 2010-07-23 15:03:42 (GMT) |
---|---|---|
committer | Carlos Manuel Duclos Vergara <carlos.duclos@nokia.com> | 2010-07-23 22:51:52 (GMT) |
commit | 725d8e061ededee9a5ddf0914aabd0f6aa2ee741 (patch) | |
tree | 7c386849784b096fbec3ab23d73e7979f60cb7bd /tests/auto/qwidget/tst_qwidget.cpp | |
parent | b0e73713e0142ac1045b4c91c7fe55e8e965b7c2 (diff) | |
download | Qt-725d8e061ededee9a5ddf0914aabd0f6aa2ee741.zip Qt-725d8e061ededee9a5ddf0914aabd0f6aa2ee741.tar.gz Qt-725d8e061ededee9a5ddf0914aabd0f6aa2ee741.tar.bz2 |
Drawer widget in a MainWindow disappears after returning from full screen mode.
The problem was in the toggleDrawer function. We were not checking the
status of the last transition before setting the new transition, so
all the transition were treated as non-intentional.
Task-number: QTBUG-11373
Reviewed-by: Prasanth
Diffstat (limited to 'tests/auto/qwidget/tst_qwidget.cpp')
-rw-r--r-- | tests/auto/qwidget/tst_qwidget.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/auto/qwidget/tst_qwidget.cpp b/tests/auto/qwidget/tst_qwidget.cpp index 2d559c8..f20d27a 100644 --- a/tests/auto/qwidget/tst_qwidget.cpp +++ b/tests/auto/qwidget/tst_qwidget.cpp @@ -397,6 +397,9 @@ private slots: void childAt(); #ifdef Q_WS_MAC void childAt_unifiedToolBar(); +#ifdef QT_MAC_USE_COCOA + void taskQTBUG_11373(); +#endif // QT_MAC_USE_COCOA #endif private: @@ -10435,6 +10438,26 @@ void tst_QWidget::childAt_unifiedToolBar() QCOMPARE(mainWindow.childAt(toolBarTopLeft), static_cast<QWidget *>(toolBar)); QCOMPARE(mainWindow.childAt(labelTopLeft), static_cast<QWidget *>(label)); } + +#ifdef QT_MAC_USE_COCOA +void tst_QWidget::taskQTBUG_11373() +{ + QMainWindow * myWindow = new QMainWindow(); + QWidget * center = new QWidget(); + myWindow -> setCentralWidget(center); + QWidget * drawer = new QWidget(myWindow, Qt::Drawer); + drawer -> hide(); + QCOMPARE(drawer->isVisible(), false); + myWindow -> show(); + myWindow -> raise(); + // The drawer shouldn't be visible now. + QCOMPARE(drawer->isVisible(), false); + myWindow -> setWindowState(Qt::WindowFullScreen); + myWindow -> setWindowState(Qt::WindowNoState); + // The drawer should still not be visible, since we haven't shown it. + QCOMPARE(drawer->isVisible(), false); +} +#endif // QT_MAC_USE_COCOA #endif QTEST_MAIN(tst_QWidget) |