Changeset 561 for trunk/src/gui/kernel/qshortcutmap.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/kernel/qshortcutmap.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 ** … … 62 62 QT_BEGIN_NAMESPACE 63 63 64 extern bool qt_mac_no_native_menubar; // qmenu_mac.cpp65 66 64 // To enable verbose output uncomment below 67 65 //#define DEBUG_QSHORTCUTMAP … … 102 100 }; 103 101 104 #if ndef QT_NO_DEBUG_STREAM102 #if 0 //ndef QT_NO_DEBUG_STREAM 105 103 /*! \internal 106 104 QDebug operator<< for easy debug output of the shortcut entries. 107 105 */ 108 QDebug &operator<<(QDebug &dbg, const QShortcutEntry *se) {106 static QDebug &operator<<(QDebug &dbg, const QShortcutEntry *se) { 109 107 if (!se) 110 108 return dbg << "QShortcutEntry(0x0)"; … … 112 110 << "QShortcutEntry(" << se->keyseq 113 111 << "), id(" << se->id << "), enabled(" << se->enabled << "), autorepeat(" << se->autorepeat 114 << "), owner(" << se->owner << ")";112 << "), owner(" << se->owner << ')'; 115 113 return dbg.space(); 116 114 } … … 149 147 */ 150 148 QShortcutMap::QShortcutMap() 151 { 152 d_ptr = new QShortcutMapPrivate(this); 153 Q_ASSERT(d_ptr != 0); 149 : d_ptr(new QShortcutMapPrivate(this)) 150 { 154 151 resetState(); 155 152 } … … 160 157 QShortcutMap::~QShortcutMap() 161 158 { 162 delete d_ptr;163 d_ptr = 0;164 159 } 165 160 … … 631 626 Q_ASSERT_X(item.owner, "QShortcutMap", "Shortcut has no owner. Illegal map state!"); 632 627 633 QWidget *active_window = qApp->activeWindow();628 QWidget *active_window = QApplication::activeWindow(); 634 629 635 630 // popups do not become the active window, 636 631 // so we fake it here to get the correct context 637 632 // for the shortcut system. 638 if ( qApp->activePopupWidget())639 active_window = qApp->activePopupWidget();633 if (QApplication::activePopupWidget()) 634 active_window = QApplication::activePopupWidget(); 640 635 641 636 if (!active_window) … … 661 656 bool visible = w->isVisible(); 662 657 #ifdef Q_WS_MAC 663 if (!q t_mac_no_native_menubar&& qobject_cast<QMenuBar *>(w))658 if (!qApp->testAttribute(Qt::AA_DontUseNativeMenuBar) && qobject_cast<QMenuBar *>(w)) 664 659 visible = true; 665 660 #endif … … 724 719 bool visible = w->isVisible(); 725 720 #ifdef Q_WS_MAC 726 if (!q t_mac_no_native_menubar&& qobject_cast<QMenuBar *>(w))721 if (!qApp->testAttribute(Qt::AA_DontUseNativeMenuBar) && qobject_cast<QMenuBar *>(w)) 727 722 visible = true; 728 723 #endif … … 754 749 return tw == w; 755 750 } 751 return false; 756 752 } 757 753 … … 878 874 << "QShortcutMap::dispatchEvent(): Sending QShortcutEvent(\"" 879 875 << (QString)next->keyseq << "\", " << next->id << ", " 880 << (bool)(enabledShortcuts>1) << ") to object(" << next->owner << ")";876 << (bool)(enabledShortcuts>1) << ") to object(" << next->owner << ')'; 881 877 #endif 882 878 QShortcutEvent se(next->keyseq, next->id, enabledShortcuts>1);
Note:
See TracChangeset
for help on using the changeset viewer.