Changeset 561 for trunk/src/gui/kernel/qaction.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/qaction.cpp
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information ([email protected]) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation ([email protected]) 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 37 ** @nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** … … 77 77 } 78 78 return s.trimmed(); 79 } ;79 } 80 80 81 81 82 82 QActionPrivate::QActionPrivate() : group(0), enabled(1), forceDisabled(0), 83 83 visible(1), forceInvisible(0), checkable(0), checked(0), separator(0), fontSet(false), 84 menuRole(QAction::TextHeuristicRole), iconVisibleInMenu(-1) 84 menuRole(QAction::TextHeuristicRole), softKeyRole(QAction::NoSoftKey), 85 priority(QAction::NormalPriority), iconVisibleInMenu(-1) 85 86 { 86 87 #ifdef QT3_SUPPORT … … 100 101 } 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 102 118 void QActionPrivate::sendDataChanged() 103 119 { … … 137 153 { 138 154 Q_Q(QAction); 139 for each (int id, alternateShortcutIds)140 if ( id)155 for 156 if () 141 157 map.removeShortcut(id, q); 158 142 159 alternateShortcutIds.clear(); 143 160 if (alternateShortcuts.isEmpty()) 144 161 return; 145 foreach (const QKeySequence& alternate, alternateShortcuts) { 162 for(int i = 0; i < alternateShortcuts.count(); ++i) { 163 const QKeySequence& alternate = alternateShortcuts.at(i); 146 164 if (!alternate.isEmpty()) 147 165 alternateShortcutIds.append(map.addShortcut(q, alternate, shortcutContext)); … … 150 168 } 151 169 if (!enabled) { 152 foreach (int id, alternateShortcutIds) 170 for(int i = 0; i < alternateShortcutIds.count(); ++i) { 171 const int id = alternateShortcutIds.at(i); 153 172 map.setShortcutEnabled(false, id, q); 173 154 174 } 155 175 if (!autorepeat) { 156 foreach (int id, alternateShortcutIds) 176 for(int i = 0; i < alternateShortcutIds.count(); ++i) { 177 const int id = alternateShortcutIds.at(i); 157 178 map.setShortcutAutoRepeat(false, id, q); 179 158 180 } 159 181 } … … 164 186 if (shortcutId) 165 187 map.setShortcutEnabled(enable, shortcutId, q); 166 for each (int id, alternateShortcutIds)167 if ( id)188 for 189 if () 168 190 map.setShortcutEnabled(enable, id, q); 191 169 192 } 170 193 #endif // QT_NO_SHORTCUT … … 176 199 action that can be inserted into widgets. 177 200 178 \ingroup application179 \mainclass 201 \ingroup 202 180 203 181 204 \omit … … 250 273 \value ApplicationSpecificRole This action should be put in the application menu with an application specific role 251 274 \value AboutQtRole This action matches handles the "About Qt" menu item. 252 \value AboutRole This action should be placed where the "About" menu item is in the application menu. 275 \value AboutRole This action should be placed where the "About" menu item is in the application menu. The text of 276 the menu item will be set to "About <application name>". The application name is fetched from the 277 \c{Info.plist} file in the application's bundle (See \l{Deploying an Application on Mac OS X}). 253 278 \value PreferencesRole This action should be placed where the "Preferences..." menu item is in the application menu. 254 279 \value QuitRole This action should be placed where the Quit menu item is in the application menu. 255 */ 280 281 Setting this value only has effect on items that are in the immediate menus 282 of the menubar, not the submenus of those menus. For example, if you have 283 File menu in your menubar and the File menu has a submenu, setting the 284 MenuRole for the actions in that submenu have no effect. They will never be moved. 285 */ 286 287 /*! \since 4.6 288 289 \enum QAction::SoftKeyRole 290 291 This enum describes how an action should be placed in the softkey bar. Currently this enum only 292 has an effect on the Symbian platform. 293 294 \value NoSoftKey This action should not be used as a softkey 295 \value PositiveSoftKey This action is used to describe a softkey with a positive or non-destructive 296 role such as Ok, Select, or Options. 297 \value NegativeSoftKey This action is used to describe a soft ey with a negative or destructive role 298 role such as Cancel, Discard, or Close. 299 \value SelectSoftKey This action is used to describe a role that selects a particular item or widget 300 in the application. 301 302 Actions with a softkey role defined are only visible in the softkey bar when the widget containing 303 the action has focus. If no widget currently has focus, the softkey framework will traverse up the 304 widget parent hierarchy looking for a widget containing softkey actions. 305 */ 256 306 257 307 /*! … … 616 666 if (d->shortcutId && qApp) { 617 667 qApp->d_func()->shortcutMap.removeShortcut(d->shortcutId, this); 618 foreach (int id, d->alternateShortcutIds) 668 for(int i = 0; i < d->alternateShortcutIds.count(); ++i) { 669 const int id = d->alternateShortcutIds.at(i); 619 670 qApp->d_func()->shortcutMap.removeShortcut(id, this); 671 620 672 } 621 673 #endif … … 899 951 } 900 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 901 999 902 1000 /*! … … 1124 1222 QAction::showStatusText(QWidget *widget) 1125 1223 { 1126 #ifdef QT_NO_STATUSTIP 1127 Q_UNUSED(widget); 1128 #else 1129 if(QObject *object = widget ? widget : parent()) { 1130 QStatusTipEvent tip(statusTip()); 1131 QApplication::sendEvent(object, &tip); 1132 return true; 1133 } 1134 #endif 1135 return false; 1224 return d_func()->showStatusText(widget, statusTip()); 1136 1225 } 1137 1226 … … 1152 1241 if (d->checked && (d->group && d->group->isExclusive() 1153 1242 && d->group->checkedAction() == this)) { 1243 1244 1154 1245 QMetaObject::removeGuard(&guard); 1155 1246 return; … … 1349 1440 1350 1441 /*! 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1351 1469 \property QAction::iconVisibleInMenu 1352 1470 \brief Whether or not an action should show an icon in a menu … … 1369 1487 { 1370 1488 Q_D(QAction); 1371 if ( visible != (bool)d->iconVisibleInMenu) {1489 if () { 1372 1490 int oldValue = d->iconVisibleInMenu; 1373 1491 d->iconVisibleInMenu = visible;
Note:
See TracChangeset
for help on using the changeset viewer.