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/qaction.cpp

    r2 r561  
    22**
    33** 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])
    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
     37** @nokia.com.
    3838** $QT_END_LICENSE$
    3939**
     
    7777    }
    7878    return s.trimmed();
    79 };
     79}
    8080
    8181
    8282QActionPrivate::QActionPrivate() : group(0), enabled(1), forceDisabled(0),
    8383                                   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)
    8586{
    8687#ifdef QT3_SUPPORT
     
    100101}
    101102
     103
     104
     105
     106
     107
     108
     109
     110
     111
     112
     113
     114
     115
     116
     117
    102118void QActionPrivate::sendDataChanged()
    103119{
     
    137153{
    138154    Q_Q(QAction);
    139     foreach (int id, alternateShortcutIds)
    140         if (id)
     155    for
     156        if ()
    141157            map.removeShortcut(id, q);
     158
    142159    alternateShortcutIds.clear();
    143160    if (alternateShortcuts.isEmpty())
    144161        return;
    145     foreach (const QKeySequence& alternate, alternateShortcuts) {
     162    for(int i = 0; i < alternateShortcuts.count(); ++i) {
     163        const QKeySequence& alternate = alternateShortcuts.at(i);
    146164        if (!alternate.isEmpty())
    147165            alternateShortcutIds.append(map.addShortcut(q, alternate, shortcutContext));
     
    150168    }
    151169    if (!enabled) {
    152         foreach (int id, alternateShortcutIds)
     170        for(int i = 0; i < alternateShortcutIds.count(); ++i) {
     171            const int id = alternateShortcutIds.at(i);
    153172            map.setShortcutEnabled(false, id, q);
     173
    154174    }
    155175    if (!autorepeat) {
    156         foreach (int id, alternateShortcutIds)
     176        for(int i = 0; i < alternateShortcutIds.count(); ++i) {
     177            const int id = alternateShortcutIds.at(i);
    157178            map.setShortcutAutoRepeat(false, id, q);
     179
    158180    }
    159181}
     
    164186    if (shortcutId)
    165187        map.setShortcutEnabled(enable, shortcutId, q);
    166     foreach (int id, alternateShortcutIds)
    167         if (id)
     188    for
     189        if ()
    168190            map.setShortcutEnabled(enable, id, q);
     191
    169192}
    170193#endif // QT_NO_SHORTCUT
     
    176199    action that can be inserted into widgets.
    177200
    178     \ingroup application
    179     \mainclass
     201    \ingroup
     202
    180203
    181204    \omit
     
    250273    \value ApplicationSpecificRole This action should be put in the application menu with an application specific role
    251274    \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}).
    253278    \value PreferencesRole This action should be placed where the  "Preferences..." menu item is in the application menu.
    254279    \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 */
    256306
    257307/*!
     
    616666    if (d->shortcutId && qApp) {
    617667        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);
    619670            qApp->d_func()->shortcutMap.removeShortcut(id, this);
     671
    620672    }
    621673#endif
     
    899951}
    900952
     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
    901999
    9021000/*!
     
    11241222QAction::showStatusText(QWidget *widget)
    11251223{
    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());
    11361225}
    11371226
     
    11521241            if (d->checked && (d->group && d->group->isExclusive()
    11531242                               && d->group->checkedAction() == this)) {
     1243
     1244
    11541245                QMetaObject::removeGuard(&guard);
    11551246                return;
     
    13491440
    13501441/*!
     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
    13511469    \property QAction::iconVisibleInMenu
    13521470    \brief Whether or not an action should show an icon in a menu
     
    13691487{
    13701488    Q_D(QAction);
    1371     if (visible != (bool)d->iconVisibleInMenu) {
     1489    if () {
    13721490        int oldValue = d->iconVisibleInMenu;
    13731491        d->iconVisibleInMenu = visible;
Note: See TracChangeset for help on using the changeset viewer.