Ignore:
Timestamp:
Feb 11, 2010, 11:19:06 PM (15 years ago)
Author:
Dmitry A. Kuminov
Message:

trunk: Merged in qt 4.6.1 sources.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/src/gui/widgets/qmdiarea.cpp

    r2 r561  
    22**
    33** 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)
    56**
    67** This file is part of the QtGui module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    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.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** 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.
    3838** $QT_END_LICENSE$
    3939**
     
    4444    \brief The QMdiArea widget provides an area in which MDI windows are displayed.
    4545    \since 4.3
    46     \ingroup application
    47     \mainclass
     46    \ingroup mainwindow-classes
     47
    4848
    4949    QMdiArea functions, essentially, like a window manager for MDI
     
    8282    containing a list of windows, for example.
    8383
    84     The subwindows are sorted by the the current
     84    The subwindows are sorted by the current
    8585    \l{QMdiArea::}{WindowOrder}. This is used for the subWindowList()
    8686    and for activateNextSubWindow() and acivatePreviousSubWindow().
     
    801801    Q_ASSERT(child && childWindows.indexOf(child) == -1);
    802802
    803     if (child->parent() != q->viewport())
    804         child->setParent(q->viewport(), child->windowFlags());
     803    if (child->parent() != viewport)
     804        child->setParent(viewport, child->windowFlags());
    805805    childWindows.append(QPointer<QMdiSubWindow>(child));
    806806
    807807    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()));
    809809        child->resize(newSize.expandedTo(qSmartMinSize(child)));
    810810    }
     
    842842
    843843    QObject::connect(child, SIGNAL(aboutToActivate()), q, SLOT(_q_deactivateAllWindows()));
    844     QObject::connect(child, SIGNAL(windowStateChanged(Qt::WindowStates, Qt::WindowStates)),
    845                      q, SLOT(_q_processWindowStateChanged(Qt::WindowStates, Qt::WindowStates)));
     844    QObject::connect(child, SIGNAL(windowStateChanged(Qt::WindowStates,Qt::WindowStates)),
     845                     q, SLOT(_q_processWindowStateChanged(Qt::WindowStates,Qt::WindowStates)));
    846846}
    847847
     
    932932    }
    933933
    934     QRect domain = q->viewport()->rect();
     934    QRect domain = viewport->rect();
    935935    if (rearranger->type() == Rearranger::RegularTiler && !widgets.isEmpty())
    936936        domain = resizeToMinimumTileSize(minSubWindowSize, widgets.count());
     
    12131213    QMdiSubWindow *stackUnderChild = 0;
    12141214    if (!windowStaysOnTop(mdiChild)) {
    1215         foreach (QObject *object, q_func()->viewport()->children()) {
     1215        foreach (QObject *object, viewport->children()) {
    12161216            QMdiSubWindow *child = qobject_cast<QMdiSubWindow *>(object);
    12171217            if (!child || !childWindows.contains(child))
     
    12371237    Q_Q(QMdiArea);
    12381238    if (!minSubWindowSize.isValid() || subWindowCount <= 0)
    1239         return q->viewport()->rect();
     1239        return viewport->rect();
    12401240
    12411241    // Calculate minimum size.
     
    12561256        int minAreaWidth = minWidth + left + right + 2;
    12571257        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();
    12621262        if (q->style()->styleHint(QStyle::SH_ScrollView_FrameOnlyAroundContents, 0, q)) {
    12631263            const int frame = q->style()->pixelMetric(QStyle::PM_DefaultFrameWidth, 0, q);
     
    12691269    }
    12701270
    1271     QRect domain = q->viewport()->rect();
     1271    QRect domain = viewport->rect();
    12721272
    12731273    // Adjust domain width and provide horizontal scroll bar.
    12741274    if (domain.width() < minWidth) {
    12751275        domain.setWidth(minWidth);
    1276         if (q->horizontalScrollBarPolicy() == Qt::ScrollBarAlwaysOff)
     1276        if (hbarpolicy == Qt::ScrollBarAlwaysOff)
    12771277            q->setHorizontalScrollBarPolicy(Qt::ScrollBarAsNeeded);
    1278         else if (q->horizontalScrollBar()->value() != 0)
    1279             q->horizontalScrollBar()->setValue(0);
     1278        else
     1279            hbar->setValue(0);
    12801280    }
    12811281    // Adjust domain height and provide vertical scroll bar.
    12821282    if (domain.height() < minHeight) {
    12831283        domain.setHeight(minHeight);
    1284         if (q->verticalScrollBarPolicy() == Qt::ScrollBarAlwaysOff)
     1284        if (vbarpolicy == Qt::ScrollBarAlwaysOff)
    12851285            q->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded);
    1286         else if (q->verticalScrollBar()->value() != 0)
    1287             q->verticalScrollBar()->setValue(0);
     1286        else
     1287            vbar->setValue(0);
    12881288    }
    12891289    return domain;
     
    18541854
    18551855/*!
    1856     Gives the keyboard focus to the next window in the list of child
    1857     windows.  The windows are activated in the order in which they are
    1858     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
    18611861*/
    18621862void QMdiArea::activateNextSubWindow()
     
    18721872
    18731873/*!
    1874     Gives the keyboard focus to the previous window in the list of
    1875     child windows. The windows are activated in the order in which
    1876     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
    18791879*/
    18801880void QMdiArea::activatePreviousSubWindow()
     
    19481948    Removes \a widget from the MDI area. The \a widget must be
    19491949    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.
    19521954
    19531955    \sa addSubWindow()
Note: See TracChangeset for help on using the changeset viewer.