summaryrefslogtreecommitdiffstats
path: root/src/gui/widgets/qmainwindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/widgets/qmainwindow.cpp')
-rw-r--r--src/gui/widgets/qmainwindow.cpp20
1 files changed, 13 insertions, 7 deletions
diff --git a/src/gui/widgets/qmainwindow.cpp b/src/gui/widgets/qmainwindow.cpp
index 0a0faa0..c51bed9 100644
--- a/src/gui/widgets/qmainwindow.cpp
+++ b/src/gui/widgets/qmainwindow.cpp
@@ -1369,20 +1369,25 @@ bool QMainWindow::event(QEvent *event)
#ifdef Q_WS_MAC
case QEvent::Show:
if (unifiedTitleAndToolBarOnMac())
- macWindowToolbarShow(this, true);
+ d->layout->syncUnifiedToolbarVisibility();
+ d->layout->blockVisiblityCheck = false;
break;
-# ifdef QT_MAC_USE_COCOA
case QEvent::WindowStateChange:
{
+ if (isHidden()) {
+ // We are coming out of a minimize, leave things as is.
+ d->layout->blockVisiblityCheck = true;
+ }
+# ifdef QT_MAC_USE_COCOA
// We need to update the HIToolbar status when we go out of or into fullscreen.
QWindowStateChangeEvent *wce = static_cast<QWindowStateChangeEvent *>(event);
if ((windowState() & Qt::WindowFullScreen) || (wce->oldState() & Qt::WindowFullScreen)) {
d->layout->updateHIToolBarStatus();
}
+# endif // Cocoa
}
break;
-# endif // Cocoa
-#endif
+#endif // Q_WS_MAC
#if !defined(QT_NO_DOCKWIDGET) && !defined(QT_NO_CURSOR)
case QEvent::CursorChange:
if (d->cursorAdjusted) {
@@ -1419,9 +1424,10 @@ bool QMainWindow::event(QEvent *event)
\i Toolbar breaks are not respected or preserved
\i Any custom widgets in the toolbar will not be shown if the toolbar
becomes too small (only actions will be shown)
- \i If you call showFullScreen() on the main window, the QToolbar will
- disappear since it is considered to be part of the title bar. You can
- work around this by turning off the unified toolbar before you call
+ \i Before Qt 4.5, if you called showFullScreen() on the main window, the QToolbar would
+ disappear since it is considered to be part of the title bar. Qt 4.5 and up will now work around this by pulling
+ the toolbars out and back into the regular toolbar and vice versa when you swap out.
+ However, a good practice would be that turning off the unified toolbar before you call
showFullScreen() and restoring it after you call showNormal().
\endlist