diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2010-07-25 19:17:21 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2010-07-25 19:17:21 (GMT) |
commit | a847edefd9e2efd70e63935965624354406f932d (patch) | |
tree | 704f2a2606f216e03cade1537d2242d14faf1016 | |
parent | 2d7101b80cc89bc4781a02a6ba0760e0d65bcae2 (diff) | |
parent | 725d8e061ededee9a5ddf0914aabd0f6aa2ee741 (diff) | |
download | Qt-a847edefd9e2efd70e63935965624354406f932d.zip Qt-a847edefd9e2efd70e63935965624354406f932d.tar.gz Qt-a847edefd9e2efd70e63935965624354406f932d.tar.bz2 |
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-1:
Drawer widget in a MainWindow disappears after returning from full screen mode.
-rw-r--r-- | src/gui/kernel/qwidget_mac.mm | 4 | ||||
-rw-r--r-- | tests/auto/qwidget/tst_qwidget.cpp | 23 |
2 files changed, 26 insertions, 1 deletions
diff --git a/src/gui/kernel/qwidget_mac.mm b/src/gui/kernel/qwidget_mac.mm index c788711..8ae6a99 100644 --- a/src/gui/kernel/qwidget_mac.mm +++ b/src/gui/kernel/qwidget_mac.mm @@ -1599,12 +1599,14 @@ void QWidgetPrivate::toggleDrawers(bool visible) continue; QWidget *widget = static_cast<QWidget*>(object); if(qt_mac_is_macdrawer(widget)) { + bool oldState = widget->testAttribute(Qt::WA_WState_ExplicitShowHide); if(visible) { if (!widget->testAttribute(Qt::WA_WState_ExplicitShowHide)) widget->show(); } else { widget->hide(); - widget->setAttribute(Qt::WA_WState_ExplicitShowHide, false); + if(!oldState) + widget->setAttribute(Qt::WA_WState_ExplicitShowHide, false); } } } 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) |