Changeset 561 for trunk/src/gui/widgets/qmdisubwindow.cpp
- Timestamp:
- Feb 11, 2010, 11:19:06 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
-
Property svn:mergeinfo
set to (toggle deleted branches)
/branches/vendor/nokia/qt/4.6.1 merged eligible /branches/vendor/nokia/qt/current merged eligible /branches/vendor/trolltech/qt/current 3-149
-
Property svn:mergeinfo
set to (toggle deleted branches)
-
trunk/src/gui/widgets/qmdisubwindow.cpp
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information (qt-info@nokia.com) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation (qt-info@nokia.com) 5 6 ** 6 7 ** This file is part of the QtGui module of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you have questions regarding the use of this file, please contact 37 ** Nokia at qt-info@nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** … … 45 45 QMdiArea. 46 46 \since 4.3 47 \ingroup application48 \mainclass 47 \ingroup mainwindow-classes 48 49 49 50 50 QMdiSubWindow represents a top-level window in a QMdiArea, and consists … … 1007 1007 Q_Q(QMdiSubWindow); 1008 1008 baseWidget->removeEventFilter(q); 1009 if ( QLayout *layout = q->layout())1009 if (layout) 1010 1010 layout->removeWidget(baseWidget); 1011 1011 if (baseWidget->windowTitle() == q->windowTitle()) { … … 1067 1067 actions[CloseAction]->setIcon(style->standardIcon(QStyle::SP_TitleBarCloseButton, 0, q)); 1068 1068 #if !defined(QT_NO_SHORTCUT) 1069 actions[CloseAction]->setShortcut (QKeySequence::Close);1069 actions[CloseAction]->setShortcuts(QKeySequence::Close); 1070 1070 #endif 1071 1071 updateActions(); … … 1103 1103 { 1104 1104 // No update necessary 1105 if (! q_func()->parent())1105 if (!parent) 1106 1106 return; 1107 1107 … … 1116 1116 { 1117 1117 Q_Q(QMdiSubWindow); 1118 if (! q->parent())1118 if (!parent) 1119 1119 return; 1120 1120 … … 1146 1146 q->clearMask(); 1147 1147 1148 if (! q->parent())1148 if (!parent) 1149 1149 return; 1150 1150 … … 1169 1169 Q_Q(QMdiSubWindow); 1170 1170 Q_ASSERT(currentOperation != None); 1171 Q_ASSERT( q->parent());1171 Q_ASSERT(parent); 1172 1172 1173 1173 uint cflags = operationMap.find(currentOperation).value().changeFlags; … … 1236 1236 { 1237 1237 Q_Q(QMdiSubWindow); 1238 Q_ASSERT( q->parent());1238 Q_ASSERT(parent); 1239 1239 1240 1240 ensureWindowState(Qt::WindowMinimized); … … 1264 1264 { 1265 1265 Q_Q(QMdiSubWindow); 1266 Q_ASSERT( q->parent());1266 Q_ASSERT(parent); 1267 1267 1268 1268 isShadeMode = false; … … 1335 1335 { 1336 1336 Q_Q(QMdiSubWindow); 1337 Q_ASSERT( q->parent());1337 Q_ASSERT(parent); 1338 1338 1339 1339 ensureWindowState(Qt::WindowMaximized); … … 1424 1424 { 1425 1425 Q_Q(QMdiSubWindow); 1426 if (! q->parent()|| !activationEnabled)1426 if (!parent || !activationEnabled) 1427 1427 return; 1428 1428 … … 1712 1712 { 1713 1713 Q_Q(const QMdiSubWindow); 1714 if (! q->parent()|| q->windowFlags() & Qt::FramelessWindowHint1714 if (!parent || q->windowFlags() & Qt::FramelessWindowHint 1715 1715 || (q->isMaximized() && !drawTitleBarWhenMaximized())) { 1716 1716 return 0; … … 1735 1735 Q_Q(const QMdiSubWindow); 1736 1736 Qt::WindowFlags flags = q->windowFlags(); 1737 if (! q->parent()|| flags & Qt::FramelessWindowHint) {1737 if (!parent || flags & Qt::FramelessWindowHint) { 1738 1738 *margin = 0; 1739 1739 *minWidth = 0; … … 1773 1773 return false; 1774 1774 1775 #if defined(Q_WS_MAC) && !defined(QT_NO_STYLE_MAC) || defined(Q_ OS_WINCE_WM)1775 #if defined(Q_WS_MAC) && !defined(QT_NO_STYLE_MAC) || defined(Q_WS_WINCE_WM) 1776 1776 return true; 1777 1777 #else … … 1894 1894 return; 1895 1895 Q_ASSERT(oldGeometry.isValid()); 1896 Q_ASSERT( q->parent());1896 Q_ASSERT(parent); 1897 1897 if (!rubberBand) { 1898 1898 rubberBand = new QRubberBand(QRubberBand::Rectangle, q->parentWidget()); … … 1947 1947 newPalette.setColor(QPalette::Inactive, QPalette::HighlightedText, 1948 1948 colorref2qrgb(GetSysColor(COLOR_INACTIVECAPTIONTEXT))); 1949 if (QSysInfo::WindowsVersion != QSysInfo::WV_95 1950 && QSysInfo::WindowsVersion != QSysInfo::WV_NT) { 1951 colorsInitialized = true; 1952 BOOL hasGradient; 1953 QT_WA({ 1954 SystemParametersInfo(SPI_GETGRADIENTCAPTIONS, 0, &hasGradient, 0); 1955 } , { 1956 SystemParametersInfoA(SPI_GETGRADIENTCAPTIONS, 0, &hasGradient, 0); 1957 }); 1958 if (hasGradient) { 1959 newPalette.setColor(QPalette::Active, QPalette::Base, 1960 colorref2qrgb(GetSysColor(COLOR_GRADIENTACTIVECAPTION))); 1961 newPalette.setColor(QPalette::Inactive, QPalette::Base, 1962 colorref2qrgb(GetSysColor(COLOR_GRADIENTINACTIVECAPTION))); 1963 } else { 1964 newPalette.setColor(QPalette::Active, QPalette::Base, 1965 newPalette.color(QPalette::Active, QPalette::Highlight)); 1966 newPalette.setColor(QPalette::Inactive, QPalette::Base, 1967 newPalette.color(QPalette::Inactive, QPalette::Highlight)); 1968 } 1949 1950 colorsInitialized = true; 1951 BOOL hasGradient = false; 1952 SystemParametersInfo(SPI_GETGRADIENTCAPTIONS, 0, &hasGradient, 0); 1953 1954 if (hasGradient) { 1955 newPalette.setColor(QPalette::Active, QPalette::Base, 1956 colorref2qrgb(GetSysColor(COLOR_GRADIENTACTIVECAPTION))); 1957 newPalette.setColor(QPalette::Inactive, QPalette::Base, 1958 colorref2qrgb(GetSysColor(COLOR_GRADIENTINACTIVECAPTION))); 1959 } else { 1960 newPalette.setColor(QPalette::Active, QPalette::Base, 1961 newPalette.color(QPalette::Active, QPalette::Highlight)); 1962 newPalette.setColor(QPalette::Inactive, QPalette::Base, 1963 newPalette.color(QPalette::Inactive, QPalette::Highlight)); 1969 1964 } 1970 1965 } … … 2080 2075 { 2081 2076 Q_Q(QMdiSubWindow); 2082 if (! q->parent()) {2077 if (!parent) { 2083 2078 q->setWindowFlags(windowFlags); 2084 2079 return; … … 2165 2160 { 2166 2161 Q_Q(const QMdiSubWindow); 2167 if (! q->parent()|| q->windowFlags() & Qt::FramelessWindowHint)2162 if (!parent || q->windowFlags() & Qt::FramelessWindowHint) 2168 2163 return QSize(-1, -1); 2169 2164 return QSize(q->style()->pixelMetric(QStyle::PM_MdiSubWindowMinimizedWidth, 0, q), titleBarHeight()); … … 2181 2176 return; 2182 2177 2183 if ( q->layout() && q->layout()->indexOf(newSizeGrip) != -1)2178 if (layout && layout->indexOf(newSizeGrip) != -1) 2184 2179 return; 2185 2180 newSizeGrip->setFixedSize(newSizeGrip->sizeHint()); 2186 bool putSizeGripInLayout = q->layout()? true : false;2181 bool putSizeGripInLayout = layout ? true : false; 2187 2182 #if defined(Q_WS_MAC) && !defined(QT_NO_STYLE_MAC) 2188 2183 if (qobject_cast<QMacStyle *>(q->style())) … … 2190 2185 #endif 2191 2186 if (putSizeGripInLayout) { 2192 q->layout()->addWidget(newSizeGrip);2193 q->layout()->setAlignment(newSizeGrip, Qt::AlignBottom | Qt::AlignRight);2187 layout->addWidget(newSizeGrip); 2188 layout->setAlignment(newSizeGrip, Qt::AlignBottom | Qt::AlignRight); 2194 2189 } else { 2195 2190 newSizeGrip->setParent(q); … … 2274 2269 d->menuIcon = windowIcon(); 2275 2270 #endif 2276 connect(qApp, SIGNAL(focusChanged(QWidget *, QWidget*)),2277 this, SLOT(_q_processFocusChanged(QWidget *, QWidget*)));2271 connect(qApp, SIGNAL(focusChanged(QWidget*,QWidget*)), 2272 this, SLOT(_q_processFocusChanged(QWidget*,QWidget*))); 2278 2273 } 2279 2274
Note:
See TracChangeset
for help on using the changeset viewer.