Changeset 561 for trunk/src/gui/widgets/qmdiarea.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/qmdiarea.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 ** … … 44 44 \brief The QMdiArea widget provides an area in which MDI windows are displayed. 45 45 \since 4.3 46 \ingroup application47 \mainclass 46 \ingroup mainwindow-classes 47 48 48 49 49 QMdiArea functions, essentially, like a window manager for MDI … … 82 82 containing a list of windows, for example. 83 83 84 The subwindows are sorted by the thecurrent84 The subwindows are sorted by the current 85 85 \l{QMdiArea::}{WindowOrder}. This is used for the subWindowList() 86 86 and for activateNextSubWindow() and acivatePreviousSubWindow(). … … 801 801 Q_ASSERT(child && childWindows.indexOf(child) == -1); 802 802 803 if (child->parent() != q->viewport())804 child->setParent( q->viewport(), child->windowFlags());803 if (child->parent() != viewport) 804 child->setParent(viewport, child->windowFlags()); 805 805 childWindows.append(QPointer<QMdiSubWindow>(child)); 806 806 807 807 if (!child->testAttribute(Qt::WA_Resized) && q->isVisible()) { 808 QSize newSize(child->sizeHint().boundedTo( q->viewport()->size()));808 QSize newSize(child->sizeHint().boundedTo(viewport->size())); 809 809 child->resize(newSize.expandedTo(qSmartMinSize(child))); 810 810 } … … 842 842 843 843 QObject::connect(child, SIGNAL(aboutToActivate()), q, SLOT(_q_deactivateAllWindows())); 844 QObject::connect(child, SIGNAL(windowStateChanged(Qt::WindowStates, 845 q, SLOT(_q_processWindowStateChanged(Qt::WindowStates, 844 QObject::connect(child, SIGNAL(windowStateChanged(Qt::WindowStates,Qt::WindowStates)), 845 q, SLOT(_q_processWindowStateChanged(Qt::WindowStates,Qt::WindowStates))); 846 846 } 847 847 … … 932 932 } 933 933 934 QRect domain = q->viewport()->rect();934 QRect domain = viewport->rect(); 935 935 if (rearranger->type() == Rearranger::RegularTiler && !widgets.isEmpty()) 936 936 domain = resizeToMinimumTileSize(minSubWindowSize, widgets.count()); … … 1213 1213 QMdiSubWindow *stackUnderChild = 0; 1214 1214 if (!windowStaysOnTop(mdiChild)) { 1215 foreach (QObject *object, q_func()->viewport()->children()) {1215 foreach (QObject *object, viewport->children()) { 1216 1216 QMdiSubWindow *child = qobject_cast<QMdiSubWindow *>(object); 1217 1217 if (!child || !childWindows.contains(child)) … … 1237 1237 Q_Q(QMdiArea); 1238 1238 if (!minSubWindowSize.isValid() || subWindowCount <= 0) 1239 return q->viewport()->rect();1239 return viewport->rect(); 1240 1240 1241 1241 // Calculate minimum size. … … 1256 1256 int minAreaWidth = minWidth + left + right + 2; 1257 1257 int minAreaHeight = minHeight + top + bottom + 2; 1258 if ( q->horizontalScrollBar()->isVisible())1259 minAreaHeight += q->horizontalScrollBar()->height();1260 if ( q->verticalScrollBar()->isVisible())1261 minAreaWidth += q->verticalScrollBar()->width();1258 if (hbar->isVisible()) 1259 minAreaHeight += hbar->height(); 1260 if (vbar->isVisible()) 1261 minAreaWidth += vbar->width(); 1262 1262 if (q->style()->styleHint(QStyle::SH_ScrollView_FrameOnlyAroundContents, 0, q)) { 1263 1263 const int frame = q->style()->pixelMetric(QStyle::PM_DefaultFrameWidth, 0, q); … … 1269 1269 } 1270 1270 1271 QRect domain = q->viewport()->rect();1271 QRect domain = viewport->rect(); 1272 1272 1273 1273 // Adjust domain width and provide horizontal scroll bar. 1274 1274 if (domain.width() < minWidth) { 1275 1275 domain.setWidth(minWidth); 1276 if ( q->horizontalScrollBarPolicy()== Qt::ScrollBarAlwaysOff)1276 if (hbarpolicy == Qt::ScrollBarAlwaysOff) 1277 1277 q->setHorizontalScrollBarPolicy(Qt::ScrollBarAsNeeded); 1278 else if (q->horizontalScrollBar()->value() != 0)1279 q->horizontalScrollBar()->setValue(0);1278 else 1279 hbar->setValue(0); 1280 1280 } 1281 1281 // Adjust domain height and provide vertical scroll bar. 1282 1282 if (domain.height() < minHeight) { 1283 1283 domain.setHeight(minHeight); 1284 if ( q->verticalScrollBarPolicy()== Qt::ScrollBarAlwaysOff)1284 if (vbarpolicy == Qt::ScrollBarAlwaysOff) 1285 1285 q->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded); 1286 else if (q->verticalScrollBar()->value() != 0)1287 q->verticalScrollBar()->setValue(0);1286 else 1287 vbar->setValue(0); 1288 1288 } 1289 1289 return domain; … … 1854 1854 1855 1855 /*! 1856 Gives the keyboard focus to the nextwindow in the list of child1857 windows. The window s are activated in the order in which they are1858 created (CreationOrder).1859 1860 \sa activatePreviousSubWindow() 1856 Gives the keyboard focus to another window in the list of child 1857 windows. The window activated will be the next one determined 1858 by the current \l{QMdiArea::WindowOrder} {activation order}. 1859 1860 \sa activatePreviousSubWindow(), QMdiArea::WindowOrder 1861 1861 */ 1862 1862 void QMdiArea::activateNextSubWindow() … … 1872 1872 1873 1873 /*! 1874 Gives the keyboard focus to the previous window in the list of1875 child windows. The windows are activated in the order in which1876 they are created (CreationOrder).1877 1878 \sa activateNextSubWindow() 1874 Gives the keyboard focus to another window in the list of child 1875 windows. The window activated will be the previous one determined 1876 by the current \l{QMdiArea::WindowOrder} {activation order}. 1877 1878 \sa activateNextSubWindow(), QMdiArea::WindowOrder 1879 1879 */ 1880 1880 void QMdiArea::activatePreviousSubWindow() … … 1948 1948 Removes \a widget from the MDI area. The \a widget must be 1949 1949 either a QMdiSubWindow or a widget that is the internal widget of 1950 a subwindow. Note that the subwindow is not deleted by QMdiArea 1951 and that its parent is set to 0. 1950 a subwindow. Note \a widget is never actually deleted by QMdiArea. 1951 If a QMdiSubWindow is passed in its parent is set to 0 and it is 1952 removed, but if an internal widget is passed in the child widget 1953 is set to 0 but the QMdiSubWindow is not removed. 1952 1954 1953 1955 \sa addSubWindow()
Note:
See TracChangeset
for help on using the changeset viewer.