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/qmdisubwindow.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**
     
    4545    QMdiArea.
    4646    \since 4.3
    47     \ingroup application
    48     \mainclass
     47    \ingroup mainwindow-classes
     48
    4949
    5050    QMdiSubWindow represents a top-level window in a QMdiArea, and consists
     
    10071007    Q_Q(QMdiSubWindow);
    10081008    baseWidget->removeEventFilter(q);
    1009     if (QLayout *layout = q->layout())
     1009    if (layout)
    10101010        layout->removeWidget(baseWidget);
    10111011    if (baseWidget->windowTitle() == q->windowTitle()) {
     
    10671067    actions[CloseAction]->setIcon(style->standardIcon(QStyle::SP_TitleBarCloseButton, 0, q));
    10681068#if !defined(QT_NO_SHORTCUT)
    1069     actions[CloseAction]->setShortcut(QKeySequence::Close);
     1069    actions[CloseAction]->setShortcuts(QKeySequence::Close);
    10701070#endif
    10711071    updateActions();
     
    11031103{
    11041104    // No update necessary
    1105     if (!q_func()->parent())
     1105    if (!parent)
    11061106        return;
    11071107
     
    11161116{
    11171117    Q_Q(QMdiSubWindow);
    1118     if (!q->parent())
     1118    if (!parent)
    11191119        return;
    11201120
     
    11461146        q->clearMask();
    11471147
    1148     if (!q->parent())
     1148    if (!parent)
    11491149        return;
    11501150
     
    11691169    Q_Q(QMdiSubWindow);
    11701170    Q_ASSERT(currentOperation != None);
    1171     Q_ASSERT(q->parent());
     1171    Q_ASSERT(parent);
    11721172
    11731173    uint cflags = operationMap.find(currentOperation).value().changeFlags;
     
    12361236{
    12371237    Q_Q(QMdiSubWindow);
    1238     Q_ASSERT(q->parent());
     1238    Q_ASSERT(parent);
    12391239
    12401240    ensureWindowState(Qt::WindowMinimized);
     
    12641264{
    12651265    Q_Q(QMdiSubWindow);
    1266     Q_ASSERT(q->parent());
     1266    Q_ASSERT(parent);
    12671267
    12681268    isShadeMode = false;
     
    13351335{
    13361336    Q_Q(QMdiSubWindow);
    1337     Q_ASSERT(q->parent());
     1337    Q_ASSERT(parent);
    13381338
    13391339    ensureWindowState(Qt::WindowMaximized);
     
    14241424{
    14251425    Q_Q(QMdiSubWindow);
    1426     if (!q->parent() || !activationEnabled)
     1426    if (!parent || !activationEnabled)
    14271427        return;
    14281428
     
    17121712{
    17131713    Q_Q(const QMdiSubWindow);
    1714     if (!q->parent() || q->windowFlags() & Qt::FramelessWindowHint
     1714    if (!parent || q->windowFlags() & Qt::FramelessWindowHint
    17151715        || (q->isMaximized() && !drawTitleBarWhenMaximized())) {
    17161716        return 0;
     
    17351735    Q_Q(const QMdiSubWindow);
    17361736    Qt::WindowFlags flags = q->windowFlags();
    1737     if (!q->parent() || flags & Qt::FramelessWindowHint) {
     1737    if (!parent || flags & Qt::FramelessWindowHint) {
    17381738        *margin = 0;
    17391739        *minWidth = 0;
     
    17731773        return false;
    17741774
    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)
    17761776    return true;
    17771777#else
     
    18941894        return;
    18951895    Q_ASSERT(oldGeometry.isValid());
    1896     Q_ASSERT(q->parent());
     1896    Q_ASSERT(parent);
    18971897    if (!rubberBand) {
    18981898        rubberBand = new QRubberBand(QRubberBand::Rectangle, q->parentWidget());
     
    19471947        newPalette.setColor(QPalette::Inactive, QPalette::HighlightedText,
    19481948                            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));
    19691964        }
    19701965    }
     
    20802075{
    20812076    Q_Q(QMdiSubWindow);
    2082     if (!q->parent()) {
     2077    if (!parent) {
    20832078        q->setWindowFlags(windowFlags);
    20842079        return;
     
    21652160{
    21662161    Q_Q(const QMdiSubWindow);
    2167     if (!q->parent() || q->windowFlags() & Qt::FramelessWindowHint)
     2162    if (!parent || q->windowFlags() & Qt::FramelessWindowHint)
    21682163        return QSize(-1, -1);
    21692164    return QSize(q->style()->pixelMetric(QStyle::PM_MdiSubWindowMinimizedWidth, 0, q), titleBarHeight());
     
    21812176        return;
    21822177
    2183     if (q->layout() && q->layout()->indexOf(newSizeGrip) != -1)
     2178    if (layout && layout->indexOf(newSizeGrip) != -1)
    21842179        return;
    21852180    newSizeGrip->setFixedSize(newSizeGrip->sizeHint());
    2186     bool putSizeGripInLayout = q->layout() ? true : false;
     2181    bool putSizeGripInLayout = layout ? true : false;
    21872182#if defined(Q_WS_MAC) && !defined(QT_NO_STYLE_MAC)
    21882183    if (qobject_cast<QMacStyle *>(q->style()))
     
    21902185#endif
    21912186    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);
    21942189    } else {
    21952190        newSizeGrip->setParent(q);
     
    22742269        d->menuIcon = windowIcon();
    22752270#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*)));
    22782273}
    22792274
Note: See TracChangeset for help on using the changeset viewer.