Changeset 651 for trunk/src/gui/kernel/qwidget_mac.mm
- Timestamp:
- Mar 8, 2010, 12:52:58 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/vendor/nokia/qt/4.6.2 (added) merged: 650 /branches/vendor/nokia/qt/current merged: 649 /branches/vendor/nokia/qt/4.6.1 removed
- Property svn:mergeinfo changed
-
trunk/src/gui/kernel/qwidget_mac.mm
r561 r651 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 20 09Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 111 111 #include "qdnd_p.h" 112 112 #include <QtGui/qgraphicsproxywidget.h> 113 #include "qmainwindow.h" 113 114 114 115 QT_BEGIN_NAMESPACE … … 404 405 qt_mac_app_fullscreen = b; 405 406 if (b) { 406 SetSystemUIMode(kUIModeAll Suppressed, 0);407 SetSystemUIMode(kUIModeAllHidden, kUIOptionAutoShowMenuBar); 407 408 } else { 408 409 SetSystemUIMode(kUIModeNormal, 0); … … 1722 1723 { 1723 1724 Q_Q(QWidget); 1725 #if !defined(QT_NO_MAINWINDOW) && !defined(QT_NO_TOOLBAR) 1726 // Make sure that QMainWindow has the MacWindowToolBarButtonHint when the 1727 // unifiedTitleAndToolBarOnMac property is ON. This is to avoid reentry of 1728 // setParent() triggered by the QToolBar::event(QEvent::ParentChange). 1729 QMainWindow *mainWindow = qobject_cast<QMainWindow *>(q); 1730 if (mainWindow && mainWindow->unifiedTitleAndToolBarOnMac()) { 1731 data.window_flags |= Qt::MacWindowToolBarButtonHint; 1732 } 1733 #endif 1724 1734 #ifndef QT_MAC_USE_COCOA 1725 1735 // ### COCOA:Interleave these better! … … 2744 2754 if (wasWindow) { 2745 2755 oldToolbar = [oldWindow toolbar]; 2756 [oldToolbar retain]; 2746 2757 oldToolbarVisible = [oldToolbar isVisible]; 2758 [oldWindow setToolbar:nil]; 2747 2759 } 2748 2760 #endif … … 2788 2800 OSWindowRef newWindow = qt_mac_window_for(q); 2789 2801 [newWindow setToolbar:oldToolbar]; 2802 [oldToolbar release]; 2790 2803 [oldToolbar setVisible:oldToolbarVisible]; 2791 2804 } … … 3402 3415 #else 3403 3416 [window orderOut:window]; 3417 // Unfortunately it is not as easy as just hiding the window, we need 3418 // to find out if we were in full screen mode. If we were and this is 3419 // the last window in full screen mode then we need to unset the full screen 3420 // mode. If this is not the last visible window in full screen mode then we 3421 // don't change the full screen mode. 3422 if(q->isFullScreen()) 3423 { 3424 bool keepFullScreen = false; 3425 QWidgetList windowList = qApp->topLevelWidgets(); 3426 int windowCount = windowList.count(); 3427 for(int i = 0; i < windowCount; i++) 3428 { 3429 QWidget *w = windowList[i]; 3430 // If it is the same window, we don't need to check :-) 3431 if(q == w) 3432 continue; 3433 // If they are not visible or if they are minimized then 3434 // we just ignore them. 3435 if(!w->isVisible() || w->isMinimized()) 3436 continue; 3437 // Is it full screen? 3438 // Notice that if there is one window in full screen mode then we 3439 // cannot switch the full screen mode off, therefore we just abort. 3440 if(w->isFullScreen()) { 3441 keepFullScreen = true; 3442 break; 3443 } 3444 } 3445 // No windows in full screen mode, so let just unset that flag. 3446 if(!keepFullScreen) 3447 qt_mac_set_fullscreen_mode(false); 3448 } 3404 3449 #endif 3405 3450 toggleDrawers(false); … … 3672 3717 3673 3718 #if QT_MAC_USE_COCOA 3719 QMacCocoaAutoReleasePool pool; 3674 3720 if (isRealWindow()) { 3675 3721 // Calling orderFront shows the window on Cocoa too.
Note:
See TracChangeset
for help on using the changeset viewer.