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/kernel/qshortcutmap.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**
     
    6262QT_BEGIN_NAMESPACE
    6363
    64 extern bool qt_mac_no_native_menubar; // qmenu_mac.cpp
    65 
    6664// To enable verbose output uncomment below
    6765//#define DEBUG_QSHORTCUTMAP
     
    102100};
    103101
    104 #ifndef QT_NO_DEBUG_STREAM
     102#if 0 //ndef QT_NO_DEBUG_STREAM
    105103/*! \internal
    106104    QDebug operator<< for easy debug output of the shortcut entries.
    107105*/
    108 QDebug &operator<<(QDebug &dbg, const QShortcutEntry *se) {
     106static QDebug &operator<<(QDebug &dbg, const QShortcutEntry *se) {
    109107    if (!se)
    110108        return dbg << "QShortcutEntry(0x0)";
     
    112110        << "QShortcutEntry(" << se->keyseq
    113111        << "), id(" << se->id << "), enabled(" << se->enabled << "), autorepeat(" << se->autorepeat
    114         << "), owner(" << se->owner << ")";
     112        << "), owner(" << se->owner << ')';
    115113    return dbg.space();
    116114}
     
    149147*/
    150148QShortcutMap::QShortcutMap()
    151 {
    152     d_ptr = new QShortcutMapPrivate(this);
    153     Q_ASSERT(d_ptr != 0);
     149    : d_ptr(new QShortcutMapPrivate(this))
     150{
    154151    resetState();
    155152}
     
    160157QShortcutMap::~QShortcutMap()
    161158{
    162     delete d_ptr;
    163     d_ptr = 0;
    164159}
    165160
     
    631626    Q_ASSERT_X(item.owner, "QShortcutMap", "Shortcut has no owner. Illegal map state!");
    632627
    633     QWidget *active_window = qApp->activeWindow();
     628    QWidget *active_window = QApplication::activeWindow();
    634629
    635630    // popups do not become the active window,
    636631    // so we fake it here to get the correct context
    637632    // for the shortcut system.
    638     if (qApp->activePopupWidget())
    639         active_window = qApp->activePopupWidget();
     633    if (QApplication::activePopupWidget())
     634        active_window = QApplication::activePopupWidget();
    640635
    641636    if (!active_window)
     
    661656    bool visible = w->isVisible();   
    662657#ifdef Q_WS_MAC
    663     if (!qt_mac_no_native_menubar && qobject_cast<QMenuBar *>(w))
     658    if (!qApp->testAttribute(Qt::AA_DontUseNativeMenuBar) && qobject_cast<QMenuBar *>(w))
    664659        visible = true;
    665660#endif
     
    724719    bool visible = w->isVisible();
    725720#ifdef Q_WS_MAC
    726     if (!qt_mac_no_native_menubar && qobject_cast<QMenuBar *>(w))
     721    if (!qApp->testAttribute(Qt::AA_DontUseNativeMenuBar) && qobject_cast<QMenuBar *>(w))
    727722        visible = true;
    728723#endif
     
    754749            return tw == w;
    755750        }
     751        return false;
    756752    }
    757753
     
    878874        << "QShortcutMap::dispatchEvent(): Sending QShortcutEvent(\""
    879875        << (QString)next->keyseq << "\", " << next->id << ", "
    880         << (bool)(enabledShortcuts>1) << ") to object(" << next->owner << ")";
     876        << (bool)(enabledShortcuts>1) << ") to object(" << next->owner << ')';
    881877#endif
    882878    QShortcutEvent se(next->keyseq, next->id, enabledShortcuts>1);
Note: See TracChangeset for help on using the changeset viewer.