| Absolute File Name: | /home/qt/qt5_coco/qt5/qtbase/src/widgets/kernel/qaction.cpp |
| Switch to Source code | Preprocessed file |
| Line | Source | Count | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | - | |||||||||||||||||||||||||
| 2 | - | |||||||||||||||||||||||||
| 3 | - | |||||||||||||||||||||||||
| 4 | - | |||||||||||||||||||||||||
| 5 | - | |||||||||||||||||||||||||
| 6 | - | |||||||||||||||||||||||||
| 7 | - | |||||||||||||||||||||||||
| 8 | - | |||||||||||||||||||||||||
| 9 | - | |||||||||||||||||||||||||
| 10 | - | |||||||||||||||||||||||||
| 11 | - | |||||||||||||||||||||||||
| 12 | - | |||||||||||||||||||||||||
| 13 | - | |||||||||||||||||||||||||
| 14 | - | |||||||||||||||||||||||||
| 15 | static QString qt_strippedText(QString s) | - | ||||||||||||||||||||||||
| 16 | { | - | ||||||||||||||||||||||||
| 17 | s.remove( QString::fromLatin1("...") ); | - | ||||||||||||||||||||||||
| 18 | for (int i = 0; i < s.size()
| 0 | ||||||||||||||||||||||||
| 19 | if (s.at(i) == QLatin1Char('&')
| 0 | ||||||||||||||||||||||||
| 20 | s.remove(i, 1); never executed: s.remove(i, 1); | 0 | ||||||||||||||||||||||||
| 21 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 22 | return never executed: s.trimmed();return s.trimmed();never executed: return s.trimmed(); | 0 | ||||||||||||||||||||||||
| 23 | } | - | ||||||||||||||||||||||||
| 24 | - | |||||||||||||||||||||||||
| 25 | - | |||||||||||||||||||||||||
| 26 | QActionPrivate::QActionPrivate() : group(0), enabled(1), forceDisabled(0), | - | ||||||||||||||||||||||||
| 27 | visible(1), forceInvisible(0), checkable(0), checked(0), separator(0), fontSet(false), | - | ||||||||||||||||||||||||
| 28 | iconVisibleInMenu(-1), | - | ||||||||||||||||||||||||
| 29 | menuRole(QAction::TextHeuristicRole), | - | ||||||||||||||||||||||||
| 30 | priority(QAction::NormalPriority) | - | ||||||||||||||||||||||||
| 31 | { | - | ||||||||||||||||||||||||
| 32 | - | |||||||||||||||||||||||||
| 33 | shortcutId = 0; | - | ||||||||||||||||||||||||
| 34 | shortcutContext = Qt::WindowShortcut; | - | ||||||||||||||||||||||||
| 35 | autorepeat = true; | - | ||||||||||||||||||||||||
| 36 | - | |||||||||||||||||||||||||
| 37 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 38 | - | |||||||||||||||||||||||||
| 39 | QActionPrivate::~QActionPrivate() | - | ||||||||||||||||||||||||
| 40 | { | - | ||||||||||||||||||||||||
| 41 | } | - | ||||||||||||||||||||||||
| 42 | - | |||||||||||||||||||||||||
| 43 | bool QActionPrivate::showStatusText(QWidget *widget, const QString &str) | - | ||||||||||||||||||||||||
| 44 | { | - | ||||||||||||||||||||||||
| 45 | - | |||||||||||||||||||||||||
| 46 | - | |||||||||||||||||||||||||
| 47 | - | |||||||||||||||||||||||||
| 48 | - | |||||||||||||||||||||||||
| 49 | if(QObject *object = widget
| 0 | ||||||||||||||||||||||||
| 50 | QStatusTipEvent tip(str); | - | ||||||||||||||||||||||||
| 51 | QApplication::sendEvent(object, &tip); | - | ||||||||||||||||||||||||
| 52 | return never executed: true;return true;never executed: return true; | 0 | ||||||||||||||||||||||||
| 53 | } | - | ||||||||||||||||||||||||
| 54 | - | |||||||||||||||||||||||||
| 55 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 56 | } | - | ||||||||||||||||||||||||
| 57 | - | |||||||||||||||||||||||||
| 58 | void QActionPrivate::sendDataChanged() | - | ||||||||||||||||||||||||
| 59 | { | - | ||||||||||||||||||||||||
| 60 | QAction * const q = q_func(); | - | ||||||||||||||||||||||||
| 61 | QActionEvent e(QEvent::ActionChanged, q); | - | ||||||||||||||||||||||||
| 62 | for (int i = 0; i < widgets.size()
| 0 | ||||||||||||||||||||||||
| 63 | QWidget *w = widgets.at(i); | - | ||||||||||||||||||||||||
| 64 | QApplication::sendEvent(w, &e); | - | ||||||||||||||||||||||||
| 65 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 66 | - | |||||||||||||||||||||||||
| 67 | for (int i = 0; i < graphicsWidgets.size()
| 0 | ||||||||||||||||||||||||
| 68 | QGraphicsWidget *w = graphicsWidgets.at(i); | - | ||||||||||||||||||||||||
| 69 | QApplication::sendEvent(w, &e); | - | ||||||||||||||||||||||||
| 70 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 71 | - | |||||||||||||||||||||||||
| 72 | QApplication::sendEvent(q, &e); | - | ||||||||||||||||||||||||
| 73 | - | |||||||||||||||||||||||||
| 74 | q->changed(); | - | ||||||||||||||||||||||||
| 75 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 76 | - | |||||||||||||||||||||||||
| 77 | - | |||||||||||||||||||||||||
| 78 | void QActionPrivate::redoGrab(QShortcutMap &map) | - | ||||||||||||||||||||||||
| 79 | { | - | ||||||||||||||||||||||||
| 80 | QAction * const q = q_func(); | - | ||||||||||||||||||||||||
| 81 | if (shortcutId
| 0 | ||||||||||||||||||||||||
| 82 | map.removeShortcut(shortcutId, q); never executed: map.removeShortcut(shortcutId, q); | 0 | ||||||||||||||||||||||||
| 83 | if (shortcut.isEmpty()
| 0 | ||||||||||||||||||||||||
| 84 | return; never executed: return; | 0 | ||||||||||||||||||||||||
| 85 | shortcutId = map.addShortcut(q, shortcut, shortcutContext, qWidgetShortcutContextMatcher); | - | ||||||||||||||||||||||||
| 86 | if (!enabled
| 0 | ||||||||||||||||||||||||
| 87 | map.setShortcutEnabled(false, shortcutId, q); never executed: map.setShortcutEnabled(false, shortcutId, q); | 0 | ||||||||||||||||||||||||
| 88 | if (!autorepeat
| 0 | ||||||||||||||||||||||||
| 89 | map.setShortcutAutoRepeat(false, shortcutId, q); never executed: map.setShortcutAutoRepeat(false, shortcutId, q); | 0 | ||||||||||||||||||||||||
| 90 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 91 | - | |||||||||||||||||||||||||
| 92 | void QActionPrivate::redoGrabAlternate(QShortcutMap &map) | - | ||||||||||||||||||||||||
| 93 | { | - | ||||||||||||||||||||||||
| 94 | QAction * const q = q_func(); | - | ||||||||||||||||||||||||
| 95 | for(int i = 0; i < alternateShortcutIds.count()
| 0 | ||||||||||||||||||||||||
| 96 | if (const
| 0 | ||||||||||||||||||||||||
| 97 | map.removeShortcut(id, q); never executed: map.removeShortcut(id, q); | 0 | ||||||||||||||||||||||||
| 98 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 99 | alternateShortcutIds.clear(); | - | ||||||||||||||||||||||||
| 100 | if (alternateShortcuts.isEmpty()
| 0 | ||||||||||||||||||||||||
| 101 | return; never executed: return; | 0 | ||||||||||||||||||||||||
| 102 | for(int i = 0; i < alternateShortcuts.count()
| 0 | ||||||||||||||||||||||||
| 103 | const QKeySequence& alternate = alternateShortcuts.at(i); | - | ||||||||||||||||||||||||
| 104 | if (!alternate.isEmpty()
| 0 | ||||||||||||||||||||||||
| 105 | alternateShortcutIds.append(map.addShortcut(q, alternate, shortcutContext, qWidgetShortcutContextMatcher)); never executed: alternateShortcutIds.append(map.addShortcut(q, alternate, shortcutContext, qWidgetShortcutContextMatcher)); | 0 | ||||||||||||||||||||||||
| 106 | else | - | ||||||||||||||||||||||||
| 107 | alternateShortcutIds.append(0); never executed: alternateShortcutIds.append(0); | 0 | ||||||||||||||||||||||||
| 108 | } | - | ||||||||||||||||||||||||
| 109 | if (!enabled
| 0 | ||||||||||||||||||||||||
| 110 | for(int i = 0; i < alternateShortcutIds.count()
| 0 | ||||||||||||||||||||||||
| 111 | const int id = alternateShortcutIds.at(i); | - | ||||||||||||||||||||||||
| 112 | map.setShortcutEnabled(false, id, q); | - | ||||||||||||||||||||||||
| 113 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 114 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 115 | if (!autorepeat
| 0 | ||||||||||||||||||||||||
| 116 | for(int i = 0; i < alternateShortcutIds.count()
| 0 | ||||||||||||||||||||||||
| 117 | const int id = alternateShortcutIds.at(i); | - | ||||||||||||||||||||||||
| 118 | map.setShortcutAutoRepeat(false, id, q); | - | ||||||||||||||||||||||||
| 119 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 120 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 121 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 122 | - | |||||||||||||||||||||||||
| 123 | void QActionPrivate::setShortcutEnabled(bool enable, QShortcutMap &map) | - | ||||||||||||||||||||||||
| 124 | { | - | ||||||||||||||||||||||||
| 125 | QAction * const q = q_func(); | - | ||||||||||||||||||||||||
| 126 | if (shortcutId
| 0 | ||||||||||||||||||||||||
| 127 | map.setShortcutEnabled(enable, shortcutId, q); never executed: map.setShortcutEnabled(enable, shortcutId, q); | 0 | ||||||||||||||||||||||||
| 128 | for(int i = 0; i < alternateShortcutIds.count()
| 0 | ||||||||||||||||||||||||
| 129 | if (const
| 0 | ||||||||||||||||||||||||
| 130 | map.setShortcutEnabled(enable, id, q); never executed: map.setShortcutEnabled(enable, id, q); | 0 | ||||||||||||||||||||||||
| 131 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 132 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 133 | QAction::QAction(QObject* parent) | - | ||||||||||||||||||||||||
| 134 | : QObject(*(new QActionPrivate), parent) | - | ||||||||||||||||||||||||
| 135 | { | - | ||||||||||||||||||||||||
| 136 | QActionPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 137 | d->group = qobject_cast<QActionGroup *>(parent); | - | ||||||||||||||||||||||||
| 138 | if (d->group
| 0 | ||||||||||||||||||||||||
| 139 | d->group->addAction(this); never executed: d->group->addAction(this); | 0 | ||||||||||||||||||||||||
| 140 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 141 | QAction::QAction(const QString &text, QObject* parent) | - | ||||||||||||||||||||||||
| 142 | : QObject(*(new QActionPrivate), parent) | - | ||||||||||||||||||||||||
| 143 | { | - | ||||||||||||||||||||||||
| 144 | QActionPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 145 | d->text = text; | - | ||||||||||||||||||||||||
| 146 | d->group = qobject_cast<QActionGroup *>(parent); | - | ||||||||||||||||||||||||
| 147 | if (d->group
| 0 | ||||||||||||||||||||||||
| 148 | d->group->addAction(this); never executed: d->group->addAction(this); | 0 | ||||||||||||||||||||||||
| 149 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 150 | QAction::QAction(const QIcon &icon, const QString &text, QObject* parent) | - | ||||||||||||||||||||||||
| 151 | : QObject(*(new QActionPrivate), parent) | - | ||||||||||||||||||||||||
| 152 | { | - | ||||||||||||||||||||||||
| 153 | QActionPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 154 | d->icon = icon; | - | ||||||||||||||||||||||||
| 155 | d->text = text; | - | ||||||||||||||||||||||||
| 156 | d->group = qobject_cast<QActionGroup *>(parent); | - | ||||||||||||||||||||||||
| 157 | if (d->group
| 0 | ||||||||||||||||||||||||
| 158 | d->group->addAction(this); never executed: d->group->addAction(this); | 0 | ||||||||||||||||||||||||
| 159 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 160 | - | |||||||||||||||||||||||||
| 161 | - | |||||||||||||||||||||||||
| 162 | - | |||||||||||||||||||||||||
| 163 | - | |||||||||||||||||||||||||
| 164 | QAction::QAction(QActionPrivate &dd, QObject *parent) | - | ||||||||||||||||||||||||
| 165 | : QObject(dd, parent) | - | ||||||||||||||||||||||||
| 166 | { | - | ||||||||||||||||||||||||
| 167 | QActionPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 168 | d->group = qobject_cast<QActionGroup *>(parent); | - | ||||||||||||||||||||||||
| 169 | if (d->group
| 0 | ||||||||||||||||||||||||
| 170 | d->group->addAction(this); never executed: d->group->addAction(this); | 0 | ||||||||||||||||||||||||
| 171 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 172 | - | |||||||||||||||||||||||||
| 173 | - | |||||||||||||||||||||||||
| 174 | - | |||||||||||||||||||||||||
| 175 | - | |||||||||||||||||||||||||
| 176 | QWidget *QAction::parentWidget() const | - | ||||||||||||||||||||||||
| 177 | { | - | ||||||||||||||||||||||||
| 178 | QObject *ret = parent(); | - | ||||||||||||||||||||||||
| 179 | while (ret
| 0 | ||||||||||||||||||||||||
| 180 | ret = ret->parent(); never executed: ret = ret->parent(); | 0 | ||||||||||||||||||||||||
| 181 | return never executed: (QWidget*)ret;return (QWidget*)ret;never executed: return (QWidget*)ret; | 0 | ||||||||||||||||||||||||
| 182 | } | - | ||||||||||||||||||||||||
| 183 | - | |||||||||||||||||||||||||
| 184 | - | |||||||||||||||||||||||||
| 185 | - | |||||||||||||||||||||||||
| 186 | - | |||||||||||||||||||||||||
| 187 | - | |||||||||||||||||||||||||
| 188 | - | |||||||||||||||||||||||||
| 189 | - | |||||||||||||||||||||||||
| 190 | QList<QWidget *> QAction::associatedWidgets() const | - | ||||||||||||||||||||||||
| 191 | { | - | ||||||||||||||||||||||||
| 192 | const QActionPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 193 | return never executed: d->widgets;return d->widgets;never executed: return d->widgets; | 0 | ||||||||||||||||||||||||
| 194 | } | - | ||||||||||||||||||||||||
| 195 | QList<QGraphicsWidget *> QAction::associatedGraphicsWidgets() const | - | ||||||||||||||||||||||||
| 196 | { | - | ||||||||||||||||||||||||
| 197 | const QActionPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 198 | return never executed: d->graphicsWidgets;return d->graphicsWidgets;never executed: return d->graphicsWidgets; | 0 | ||||||||||||||||||||||||
| 199 | } | - | ||||||||||||||||||||||||
| 200 | void QAction::setShortcut(const QKeySequence &shortcut) | - | ||||||||||||||||||||||||
| 201 | { | - | ||||||||||||||||||||||||
| 202 | if (__builtin_expect(!!(!(static_cast<QApplication *>(QCoreApplication::instance()))), false)
never executed: };return; | 0 | ||||||||||||||||||||||||
| 203 | - | |||||||||||||||||||||||||
| 204 | QActionPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 205 | if (d->shortcut == shortcut
| 0 | ||||||||||||||||||||||||
| 206 | return; never executed: return; | 0 | ||||||||||||||||||||||||
| 207 | - | |||||||||||||||||||||||||
| 208 | d->shortcut = shortcut; | - | ||||||||||||||||||||||||
| 209 | d->redoGrab((static_cast<QApplication *>(QCoreApplication::instance()))->d_func()->shortcutMap); | - | ||||||||||||||||||||||||
| 210 | d->sendDataChanged(); | - | ||||||||||||||||||||||||
| 211 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 212 | void QAction::setShortcuts(const QList<QKeySequence> &shortcuts) | - | ||||||||||||||||||||||||
| 213 | { | - | ||||||||||||||||||||||||
| 214 | QActionPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 215 | - | |||||||||||||||||||||||||
| 216 | QList <QKeySequence> listCopy = shortcuts; | - | ||||||||||||||||||||||||
| 217 | - | |||||||||||||||||||||||||
| 218 | QKeySequence primary; | - | ||||||||||||||||||||||||
| 219 | if (!listCopy.isEmpty()
| 0 | ||||||||||||||||||||||||
| 220 | primary = listCopy.takeFirst(); never executed: primary = listCopy.takeFirst(); | 0 | ||||||||||||||||||||||||
| 221 | - | |||||||||||||||||||||||||
| 222 | if (d->shortcut == primary
| 0 | ||||||||||||||||||||||||
| 223 | return; never executed: return; | 0 | ||||||||||||||||||||||||
| 224 | - | |||||||||||||||||||||||||
| 225 | if (__builtin_expect(!!(!(static_cast<QApplication *>(QCoreApplication::instance()))), false)
never executed: };return; | 0 | ||||||||||||||||||||||||
| 226 | - | |||||||||||||||||||||||||
| 227 | d->shortcut = primary; | - | ||||||||||||||||||||||||
| 228 | d->alternateShortcuts = listCopy; | - | ||||||||||||||||||||||||
| 229 | d->redoGrab((static_cast<QApplication *>(QCoreApplication::instance()))->d_func()->shortcutMap); | - | ||||||||||||||||||||||||
| 230 | d->redoGrabAlternate((static_cast<QApplication *>(QCoreApplication::instance()))->d_func()->shortcutMap); | - | ||||||||||||||||||||||||
| 231 | d->sendDataChanged(); | - | ||||||||||||||||||||||||
| 232 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 233 | void QAction::setShortcuts(QKeySequence::StandardKey key) | - | ||||||||||||||||||||||||
| 234 | { | - | ||||||||||||||||||||||||
| 235 | QList <QKeySequence> list = QKeySequence::keyBindings(key); | - | ||||||||||||||||||||||||
| 236 | setShortcuts(list); | - | ||||||||||||||||||||||||
| 237 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 238 | - | |||||||||||||||||||||||||
| 239 | - | |||||||||||||||||||||||||
| 240 | - | |||||||||||||||||||||||||
| 241 | - | |||||||||||||||||||||||||
| 242 | - | |||||||||||||||||||||||||
| 243 | - | |||||||||||||||||||||||||
| 244 | QKeySequence QAction::shortcut() const | - | ||||||||||||||||||||||||
| 245 | { | - | ||||||||||||||||||||||||
| 246 | const QActionPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 247 | return never executed: d->shortcut;return d->shortcut;never executed: return d->shortcut; | 0 | ||||||||||||||||||||||||
| 248 | } | - | ||||||||||||||||||||||||
| 249 | QList<QKeySequence> QAction::shortcuts() const | - | ||||||||||||||||||||||||
| 250 | { | - | ||||||||||||||||||||||||
| 251 | const QActionPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 252 | QList <QKeySequence> shortcuts; | - | ||||||||||||||||||||||||
| 253 | if (!d->shortcut.isEmpty()
| 0 | ||||||||||||||||||||||||
| 254 | shortcuts << d->shortcut; never executed: shortcuts << d->shortcut; | 0 | ||||||||||||||||||||||||
| 255 | if (!d->alternateShortcuts.isEmpty()
| 0 | ||||||||||||||||||||||||
| 256 | shortcuts << d->alternateShortcuts; never executed: shortcuts << d->alternateShortcuts; | 0 | ||||||||||||||||||||||||
| 257 | return never executed: shortcuts;return shortcuts;never executed: return shortcuts; | 0 | ||||||||||||||||||||||||
| 258 | } | - | ||||||||||||||||||||||||
| 259 | void QAction::setShortcutContext(Qt::ShortcutContext context) | - | ||||||||||||||||||||||||
| 260 | { | - | ||||||||||||||||||||||||
| 261 | QActionPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 262 | if (d->shortcutContext == context
| 0 | ||||||||||||||||||||||||
| 263 | return; never executed: return; | 0 | ||||||||||||||||||||||||
| 264 | if (__builtin_expect(!!(!(static_cast<QApplication *>(QCoreApplication::instance()))), false)
never executed: };return; | 0 | ||||||||||||||||||||||||
| 265 | d->shortcutContext = context; | - | ||||||||||||||||||||||||
| 266 | d->redoGrab((static_cast<QApplication *>(QCoreApplication::instance()))->d_func()->shortcutMap); | - | ||||||||||||||||||||||||
| 267 | d->redoGrabAlternate((static_cast<QApplication *>(QCoreApplication::instance()))->d_func()->shortcutMap); | - | ||||||||||||||||||||||||
| 268 | d->sendDataChanged(); | - | ||||||||||||||||||||||||
| 269 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 270 | - | |||||||||||||||||||||||||
| 271 | Qt::ShortcutContext QAction::shortcutContext() const | - | ||||||||||||||||||||||||
| 272 | { | - | ||||||||||||||||||||||||
| 273 | const QActionPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 274 | return never executed: d->shortcutContext;return d->shortcutContext;never executed: return d->shortcutContext; | 0 | ||||||||||||||||||||||||
| 275 | } | - | ||||||||||||||||||||||||
| 276 | void QAction::setAutoRepeat(bool on) | - | ||||||||||||||||||||||||
| 277 | { | - | ||||||||||||||||||||||||
| 278 | QActionPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 279 | if (d->autorepeat == on
| 0 | ||||||||||||||||||||||||
| 280 | return; never executed: return; | 0 | ||||||||||||||||||||||||
| 281 | if (__builtin_expect(!!(!(static_cast<QApplication *>(QCoreApplication::instance()))), false)
never executed: };return; | 0 | ||||||||||||||||||||||||
| 282 | d->autorepeat = on; | - | ||||||||||||||||||||||||
| 283 | d->redoGrab((static_cast<QApplication *>(QCoreApplication::instance()))->d_func()->shortcutMap); | - | ||||||||||||||||||||||||
| 284 | d->redoGrabAlternate((static_cast<QApplication *>(QCoreApplication::instance()))->d_func()->shortcutMap); | - | ||||||||||||||||||||||||
| 285 | d->sendDataChanged(); | - | ||||||||||||||||||||||||
| 286 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 287 | - | |||||||||||||||||||||||||
| 288 | bool QAction::autoRepeat() const | - | ||||||||||||||||||||||||
| 289 | { | - | ||||||||||||||||||||||||
| 290 | const QActionPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 291 | return never executed: d->autorepeat;return d->autorepeat;never executed: return d->autorepeat; | 0 | ||||||||||||||||||||||||
| 292 | } | - | ||||||||||||||||||||||||
| 293 | void QAction::setFont(const QFont &font) | - | ||||||||||||||||||||||||
| 294 | { | - | ||||||||||||||||||||||||
| 295 | QActionPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 296 | if (d->font == font
| 0 | ||||||||||||||||||||||||
| 297 | return; never executed: return; | 0 | ||||||||||||||||||||||||
| 298 | - | |||||||||||||||||||||||||
| 299 | d->fontSet = true; | - | ||||||||||||||||||||||||
| 300 | d->font = font; | - | ||||||||||||||||||||||||
| 301 | d->sendDataChanged(); | - | ||||||||||||||||||||||||
| 302 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 303 | - | |||||||||||||||||||||||||
| 304 | QFont QAction::font() const | - | ||||||||||||||||||||||||
| 305 | { | - | ||||||||||||||||||||||||
| 306 | const QActionPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 307 | return never executed: d->font;return d->font;never executed: return d->font; | 0 | ||||||||||||||||||||||||
| 308 | } | - | ||||||||||||||||||||||||
| 309 | - | |||||||||||||||||||||||||
| 310 | - | |||||||||||||||||||||||||
| 311 | - | |||||||||||||||||||||||||
| 312 | - | |||||||||||||||||||||||||
| 313 | - | |||||||||||||||||||||||||
| 314 | QAction::~QAction() | - | ||||||||||||||||||||||||
| 315 | { | - | ||||||||||||||||||||||||
| 316 | QActionPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 317 | for (int i = d->widgets.size()-1; i >= 0
| 0 | ||||||||||||||||||||||||
| 318 | QWidget *w = d->widgets.at(i); | - | ||||||||||||||||||||||||
| 319 | w->removeAction(this); | - | ||||||||||||||||||||||||
| 320 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 321 | - | |||||||||||||||||||||||||
| 322 | for (int i = d->graphicsWidgets.size()-1; i >= 0
| 0 | ||||||||||||||||||||||||
| 323 | QGraphicsWidget *w = d->graphicsWidgets.at(i); | - | ||||||||||||||||||||||||
| 324 | w->removeAction(this); | - | ||||||||||||||||||||||||
| 325 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 326 | - | |||||||||||||||||||||||||
| 327 | if (d->group
| 0 | ||||||||||||||||||||||||
| 328 | d->group->removeAction(this); never executed: d->group->removeAction(this); | 0 | ||||||||||||||||||||||||
| 329 | - | |||||||||||||||||||||||||
| 330 | if (d->shortcutId
| 0 | ||||||||||||||||||||||||
| 331 | (static_cast<QApplication *>(QCoreApplication::instance()))->d_func()->shortcutMap.removeShortcut(d->shortcutId, this); | - | ||||||||||||||||||||||||
| 332 | for(int i = 0; i < d->alternateShortcutIds.count()
| 0 | ||||||||||||||||||||||||
| 333 | const int id = d->alternateShortcutIds.at(i); | - | ||||||||||||||||||||||||
| 334 | (static_cast<QApplication *>(QCoreApplication::instance()))->d_func()->shortcutMap.removeShortcut(id, this); | - | ||||||||||||||||||||||||
| 335 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 336 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 337 | - | |||||||||||||||||||||||||
| 338 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 339 | void QAction::setActionGroup(QActionGroup *group) | - | ||||||||||||||||||||||||
| 340 | { | - | ||||||||||||||||||||||||
| 341 | QActionPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 342 | if(group == d->group
| 0 | ||||||||||||||||||||||||
| 343 | return; never executed: return; | 0 | ||||||||||||||||||||||||
| 344 | - | |||||||||||||||||||||||||
| 345 | if(d->group
| 0 | ||||||||||||||||||||||||
| 346 | d->group->removeAction(this); never executed: d->group->removeAction(this); | 0 | ||||||||||||||||||||||||
| 347 | d->group = group; | - | ||||||||||||||||||||||||
| 348 | if(group
| 0 | ||||||||||||||||||||||||
| 349 | group->addAction(this); never executed: group->addAction(this); | 0 | ||||||||||||||||||||||||
| 350 | d->sendDataChanged(); | - | ||||||||||||||||||||||||
| 351 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 352 | - | |||||||||||||||||||||||||
| 353 | - | |||||||||||||||||||||||||
| 354 | - | |||||||||||||||||||||||||
| 355 | - | |||||||||||||||||||||||||
| 356 | - | |||||||||||||||||||||||||
| 357 | - | |||||||||||||||||||||||||
| 358 | - | |||||||||||||||||||||||||
| 359 | QActionGroup *QAction::actionGroup() const | - | ||||||||||||||||||||||||
| 360 | { | - | ||||||||||||||||||||||||
| 361 | const QActionPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 362 | return never executed: d->group;return d->group;never executed: return d->group; | 0 | ||||||||||||||||||||||||
| 363 | } | - | ||||||||||||||||||||||||
| 364 | void QAction::setIcon(const QIcon &icon) | - | ||||||||||||||||||||||||
| 365 | { | - | ||||||||||||||||||||||||
| 366 | QActionPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 367 | d->icon = icon; | - | ||||||||||||||||||||||||
| 368 | d->sendDataChanged(); | - | ||||||||||||||||||||||||
| 369 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 370 | - | |||||||||||||||||||||||||
| 371 | QIcon QAction::icon() const | - | ||||||||||||||||||||||||
| 372 | { | - | ||||||||||||||||||||||||
| 373 | const QActionPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 374 | return never executed: d->icon;return d->icon;never executed: return d->icon; | 0 | ||||||||||||||||||||||||
| 375 | } | - | ||||||||||||||||||||||||
| 376 | QMenu *QAction::menu() const | - | ||||||||||||||||||||||||
| 377 | { | - | ||||||||||||||||||||||||
| 378 | const QActionPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 379 | return never executed: d->menu;return d->menu;never executed: return d->menu; | 0 | ||||||||||||||||||||||||
| 380 | } | - | ||||||||||||||||||||||||
| 381 | - | |||||||||||||||||||||||||
| 382 | - | |||||||||||||||||||||||||
| 383 | - | |||||||||||||||||||||||||
| 384 | - | |||||||||||||||||||||||||
| 385 | void QAction::setMenu(QMenu *menu) | - | ||||||||||||||||||||||||
| 386 | { | - | ||||||||||||||||||||||||
| 387 | QActionPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 388 | if (d->menu
| 0 | ||||||||||||||||||||||||
| 389 | d->menu->d_func()->setOverrideMenuAction(0); never executed: d->menu->d_func()->setOverrideMenuAction(0); | 0 | ||||||||||||||||||||||||
| 390 | d->menu = menu; | - | ||||||||||||||||||||||||
| 391 | if (menu
| 0 | ||||||||||||||||||||||||
| 392 | menu->d_func()->setOverrideMenuAction(this); never executed: menu->d_func()->setOverrideMenuAction(this); | 0 | ||||||||||||||||||||||||
| 393 | d->sendDataChanged(); | - | ||||||||||||||||||||||||
| 394 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 395 | void QAction::setSeparator(bool b) | - | ||||||||||||||||||||||||
| 396 | { | - | ||||||||||||||||||||||||
| 397 | QActionPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 398 | if (d->separator == b
| 0 | ||||||||||||||||||||||||
| 399 | return; never executed: return; | 0 | ||||||||||||||||||||||||
| 400 | - | |||||||||||||||||||||||||
| 401 | d->separator = b; | - | ||||||||||||||||||||||||
| 402 | d->sendDataChanged(); | - | ||||||||||||||||||||||||
| 403 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 404 | - | |||||||||||||||||||||||||
| 405 | - | |||||||||||||||||||||||||
| 406 | - | |||||||||||||||||||||||||
| 407 | - | |||||||||||||||||||||||||
| 408 | - | |||||||||||||||||||||||||
| 409 | - | |||||||||||||||||||||||||
| 410 | - | |||||||||||||||||||||||||
| 411 | bool QAction::isSeparator() const | - | ||||||||||||||||||||||||
| 412 | { | - | ||||||||||||||||||||||||
| 413 | const QActionPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 414 | return never executed: d->separator;return d->separator;never executed: return d->separator; | 0 | ||||||||||||||||||||||||
| 415 | } | - | ||||||||||||||||||||||||
| 416 | void QAction::setText(const QString &text) | - | ||||||||||||||||||||||||
| 417 | { | - | ||||||||||||||||||||||||
| 418 | QActionPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 419 | if (d->text == text
| 0 | ||||||||||||||||||||||||
| 420 | return; never executed: return; | 0 | ||||||||||||||||||||||||
| 421 | - | |||||||||||||||||||||||||
| 422 | d->text = text; | - | ||||||||||||||||||||||||
| 423 | d->sendDataChanged(); | - | ||||||||||||||||||||||||
| 424 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 425 | - | |||||||||||||||||||||||||
| 426 | QString QAction::text() const | - | ||||||||||||||||||||||||
| 427 | { | - | ||||||||||||||||||||||||
| 428 | const QActionPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 429 | QString s = d->text; | - | ||||||||||||||||||||||||
| 430 | if(s.isEmpty()
| 0 | ||||||||||||||||||||||||
| 431 | s = d->iconText; | - | ||||||||||||||||||||||||
| 432 | s.replace(QLatin1Char('&'), QLatin1String("&&")); | - | ||||||||||||||||||||||||
| 433 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 434 | return never executed: s;return s;never executed: return s; | 0 | ||||||||||||||||||||||||
| 435 | } | - | ||||||||||||||||||||||||
| 436 | void QAction::setIconText(const QString &text) | - | ||||||||||||||||||||||||
| 437 | { | - | ||||||||||||||||||||||||
| 438 | QActionPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 439 | if (d->iconText == text
| 0 | ||||||||||||||||||||||||
| 440 | return; never executed: return; | 0 | ||||||||||||||||||||||||
| 441 | - | |||||||||||||||||||||||||
| 442 | d->iconText = text; | - | ||||||||||||||||||||||||
| 443 | d->sendDataChanged(); | - | ||||||||||||||||||||||||
| 444 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 445 | - | |||||||||||||||||||||||||
| 446 | QString QAction::iconText() const | - | ||||||||||||||||||||||||
| 447 | { | - | ||||||||||||||||||||||||
| 448 | const QActionPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 449 | if (d->iconText.isEmpty()
| 0 | ||||||||||||||||||||||||
| 450 | return never executed: qt_strippedText(d->text);return qt_strippedText(d->text);never executed: return qt_strippedText(d->text); | 0 | ||||||||||||||||||||||||
| 451 | return never executed: d->iconText;return d->iconText;never executed: return d->iconText; | 0 | ||||||||||||||||||||||||
| 452 | } | - | ||||||||||||||||||||||||
| 453 | void QAction::setToolTip(const QString &tooltip) | - | ||||||||||||||||||||||||
| 454 | { | - | ||||||||||||||||||||||||
| 455 | QActionPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 456 | if (d->tooltip == tooltip
| 0 | ||||||||||||||||||||||||
| 457 | return; never executed: return; | 0 | ||||||||||||||||||||||||
| 458 | - | |||||||||||||||||||||||||
| 459 | d->tooltip = tooltip; | - | ||||||||||||||||||||||||
| 460 | d->sendDataChanged(); | - | ||||||||||||||||||||||||
| 461 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 462 | - | |||||||||||||||||||||||||
| 463 | QString QAction::toolTip() const | - | ||||||||||||||||||||||||
| 464 | { | - | ||||||||||||||||||||||||
| 465 | const QActionPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 466 | if (d->tooltip.isEmpty()
| 0 | ||||||||||||||||||||||||
| 467 | if (!d->text.isEmpty()
| 0 | ||||||||||||||||||||||||
| 468 | return never executed: qt_strippedText(d->text);return qt_strippedText(d->text);never executed: return qt_strippedText(d->text); | 0 | ||||||||||||||||||||||||
| 469 | return never executed: qt_strippedText(d->iconText);return qt_strippedText(d->iconText);never executed: return qt_strippedText(d->iconText); | 0 | ||||||||||||||||||||||||
| 470 | } | - | ||||||||||||||||||||||||
| 471 | return never executed: d->tooltip;return d->tooltip;never executed: return d->tooltip; | 0 | ||||||||||||||||||||||||
| 472 | } | - | ||||||||||||||||||||||||
| 473 | void QAction::setStatusTip(const QString &statustip) | - | ||||||||||||||||||||||||
| 474 | { | - | ||||||||||||||||||||||||
| 475 | QActionPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 476 | if (d->statustip == statustip
| 0 | ||||||||||||||||||||||||
| 477 | return; never executed: return; | 0 | ||||||||||||||||||||||||
| 478 | - | |||||||||||||||||||||||||
| 479 | d->statustip = statustip; | - | ||||||||||||||||||||||||
| 480 | d->sendDataChanged(); | - | ||||||||||||||||||||||||
| 481 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 482 | - | |||||||||||||||||||||||||
| 483 | QString QAction::statusTip() const | - | ||||||||||||||||||||||||
| 484 | { | - | ||||||||||||||||||||||||
| 485 | const QActionPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 486 | return never executed: d->statustip;return d->statustip;never executed: return d->statustip; | 0 | ||||||||||||||||||||||||
| 487 | } | - | ||||||||||||||||||||||||
| 488 | void QAction::setWhatsThis(const QString &whatsthis) | - | ||||||||||||||||||||||||
| 489 | { | - | ||||||||||||||||||||||||
| 490 | QActionPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 491 | if (d->whatsthis == whatsthis
| 0 | ||||||||||||||||||||||||
| 492 | return; never executed: return; | 0 | ||||||||||||||||||||||||
| 493 | - | |||||||||||||||||||||||||
| 494 | d->whatsthis = whatsthis; | - | ||||||||||||||||||||||||
| 495 | d->sendDataChanged(); | - | ||||||||||||||||||||||||
| 496 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 497 | - | |||||||||||||||||||||||||
| 498 | QString QAction::whatsThis() const | - | ||||||||||||||||||||||||
| 499 | { | - | ||||||||||||||||||||||||
| 500 | const QActionPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 501 | return never executed: d->whatsthis;return d->whatsthis;never executed: return d->whatsthis; | 0 | ||||||||||||||||||||||||
| 502 | } | - | ||||||||||||||||||||||||
| 503 | void QAction::setPriority(Priority priority) | - | ||||||||||||||||||||||||
| 504 | { | - | ||||||||||||||||||||||||
| 505 | QActionPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 506 | if (d->priority == priority
| 0 | ||||||||||||||||||||||||
| 507 | return; never executed: return; | 0 | ||||||||||||||||||||||||
| 508 | - | |||||||||||||||||||||||||
| 509 | d->priority = priority; | - | ||||||||||||||||||||||||
| 510 | d->sendDataChanged(); | - | ||||||||||||||||||||||||
| 511 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 512 | - | |||||||||||||||||||||||||
| 513 | QAction::Priority QAction::priority() const | - | ||||||||||||||||||||||||
| 514 | { | - | ||||||||||||||||||||||||
| 515 | const QActionPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 516 | return never executed: d->priority;return d->priority;never executed: return d->priority; | 0 | ||||||||||||||||||||||||
| 517 | } | - | ||||||||||||||||||||||||
| 518 | void QAction::setCheckable(bool b) | - | ||||||||||||||||||||||||
| 519 | { | - | ||||||||||||||||||||||||
| 520 | QActionPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 521 | if (d->checkable == b
| 0 | ||||||||||||||||||||||||
| 522 | return; never executed: return; | 0 | ||||||||||||||||||||||||
| 523 | - | |||||||||||||||||||||||||
| 524 | d->checkable = b; | - | ||||||||||||||||||||||||
| 525 | d->checked = false; | - | ||||||||||||||||||||||||
| 526 | d->sendDataChanged(); | - | ||||||||||||||||||||||||
| 527 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 528 | - | |||||||||||||||||||||||||
| 529 | bool QAction::isCheckable() const | - | ||||||||||||||||||||||||
| 530 | { | - | ||||||||||||||||||||||||
| 531 | const QActionPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 532 | return never executed: d->checkable;return d->checkable;never executed: return d->checkable; | 0 | ||||||||||||||||||||||||
| 533 | } | - | ||||||||||||||||||||||||
| 534 | - | |||||||||||||||||||||||||
| 535 | - | |||||||||||||||||||||||||
| 536 | - | |||||||||||||||||||||||||
| 537 | - | |||||||||||||||||||||||||
| 538 | - | |||||||||||||||||||||||||
| 539 | - | |||||||||||||||||||||||||
| 540 | - | |||||||||||||||||||||||||
| 541 | void QAction::toggle() | - | ||||||||||||||||||||||||
| 542 | { | - | ||||||||||||||||||||||||
| 543 | QActionPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 544 | setChecked(!d->checked); | - | ||||||||||||||||||||||||
| 545 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 546 | void QAction::setChecked(bool b) | - | ||||||||||||||||||||||||
| 547 | { | - | ||||||||||||||||||||||||
| 548 | QActionPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 549 | if (!d->checkable
| 0 | ||||||||||||||||||||||||
| 550 | return; never executed: return; | 0 | ||||||||||||||||||||||||
| 551 | - | |||||||||||||||||||||||||
| 552 | QPointer<QAction> guard(this); | - | ||||||||||||||||||||||||
| 553 | d->checked = b; | - | ||||||||||||||||||||||||
| 554 | d->sendDataChanged(); | - | ||||||||||||||||||||||||
| 555 | if (guard
| 0 | ||||||||||||||||||||||||
| 556 | toggled(b); never executed: toggled(b); | 0 | ||||||||||||||||||||||||
| 557 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 558 | - | |||||||||||||||||||||||||
| 559 | bool QAction::isChecked() const | - | ||||||||||||||||||||||||
| 560 | { | - | ||||||||||||||||||||||||
| 561 | const QActionPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 562 | return never executed: d->checked;return d->checked;never executed: return d->checked; | 0 | ||||||||||||||||||||||||
| 563 | } | - | ||||||||||||||||||||||||
| 564 | void QAction::setEnabled(bool b) | - | ||||||||||||||||||||||||
| 565 | { | - | ||||||||||||||||||||||||
| 566 | QActionPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 567 | if (b == d->enabled
| 0 | ||||||||||||||||||||||||
| 568 | return; never executed: return; | 0 | ||||||||||||||||||||||||
| 569 | d->forceDisabled = !b; | - | ||||||||||||||||||||||||
| 570 | if (b
| 0 | ||||||||||||||||||||||||
| 571 | return; never executed: return; | 0 | ||||||||||||||||||||||||
| 572 | if (__builtin_expect(!!(!(static_cast<QApplication *>(QCoreApplication::instance()))), false)
never executed: };return; | 0 | ||||||||||||||||||||||||
| 573 | d->enabled = b; | - | ||||||||||||||||||||||||
| 574 | - | |||||||||||||||||||||||||
| 575 | d->setShortcutEnabled(b, (static_cast<QApplication *>(QCoreApplication::instance()))->d_func()->shortcutMap); | - | ||||||||||||||||||||||||
| 576 | - | |||||||||||||||||||||||||
| 577 | d->sendDataChanged(); | - | ||||||||||||||||||||||||
| 578 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 579 | - | |||||||||||||||||||||||||
| 580 | bool QAction::isEnabled() const | - | ||||||||||||||||||||||||
| 581 | { | - | ||||||||||||||||||||||||
| 582 | const QActionPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 583 | return never executed: d->enabled;return d->enabled;never executed: return d->enabled; | 0 | ||||||||||||||||||||||||
| 584 | } | - | ||||||||||||||||||||||||
| 585 | void QAction::setVisible(bool b) | - | ||||||||||||||||||||||||
| 586 | { | - | ||||||||||||||||||||||||
| 587 | QActionPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 588 | if (b == d->visible
| 0 | ||||||||||||||||||||||||
| 589 | return; never executed: return; | 0 | ||||||||||||||||||||||||
| 590 | if (__builtin_expect(!!(!(static_cast<QApplication *>(QCoreApplication::instance()))), false)
never executed: };return; | 0 | ||||||||||||||||||||||||
| 591 | d->forceInvisible = !b; | - | ||||||||||||||||||||||||
| 592 | d->visible = b; | - | ||||||||||||||||||||||||
| 593 | d->enabled = b
| 0 | ||||||||||||||||||||||||
| 594 | - | |||||||||||||||||||||||||
| 595 | d->setShortcutEnabled(d->enabled, (static_cast<QApplication *>(QCoreApplication::instance()))->d_func()->shortcutMap); | - | ||||||||||||||||||||||||
| 596 | - | |||||||||||||||||||||||||
| 597 | d->sendDataChanged(); | - | ||||||||||||||||||||||||
| 598 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 599 | - | |||||||||||||||||||||||||
| 600 | - | |||||||||||||||||||||||||
| 601 | bool QAction::isVisible() const | - | ||||||||||||||||||||||||
| 602 | { | - | ||||||||||||||||||||||||
| 603 | const QActionPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 604 | return never executed: d->visible;return d->visible;never executed: return d->visible; | 0 | ||||||||||||||||||||||||
| 605 | } | - | ||||||||||||||||||||||||
| 606 | - | |||||||||||||||||||||||||
| 607 | - | |||||||||||||||||||||||||
| 608 | - | |||||||||||||||||||||||||
| 609 | - | |||||||||||||||||||||||||
| 610 | bool | - | ||||||||||||||||||||||||
| 611 | QAction::event(QEvent *e) | - | ||||||||||||||||||||||||
| 612 | { | - | ||||||||||||||||||||||||
| 613 | - | |||||||||||||||||||||||||
| 614 | if (e->type() == QEvent::Shortcut
| 0 | ||||||||||||||||||||||||
| 615 | QShortcutEvent *se = static_cast<QShortcutEvent *>(e); | - | ||||||||||||||||||||||||
| 616 | ((!(se->key() == d_func()->shortcut || d_func()->alternateShortcuts.contains(se->key()))) ? qt_assert_x("QAction::event", "Received shortcut event from incorrect shortcut", | - | ||||||||||||||||||||||||
| 617 | - | |||||||||||||||||||||||||
| 618 | __FILE__ | - | ||||||||||||||||||||||||
| 619 | , | - | ||||||||||||||||||||||||
| 620 | - | |||||||||||||||||||||||||
| 621 | 1094 | - | ||||||||||||||||||||||||
| 622 | ) : qt_noop()) | - | ||||||||||||||||||||||||
| 623 | - | |||||||||||||||||||||||||
| 624 | ; | - | ||||||||||||||||||||||||
| 625 | if (se->isAmbiguous()
| 0 | ||||||||||||||||||||||||
| 626 | QMessageLogger(__FILE__, 1096, __PRETTY_FUNCTION__).warning("QAction::eventFilter: Ambiguous shortcut overload: %s", se->key().toString(QKeySequence::NativeText).toLatin1().constData()); never executed: QMessageLogger(__FILE__, 1096, __PRETTY_FUNCTION__).warning("QAction::eventFilter: Ambiguous shortcut overload: %s", se->key().toString(QKeySequence::NativeText).toLatin1().constData()); | 0 | ||||||||||||||||||||||||
| 627 | else | - | ||||||||||||||||||||||||
| 628 | activate(Trigger); never executed: activate(Trigger); | 0 | ||||||||||||||||||||||||
| 629 | return never executed: true;return true;never executed: return true; | 0 | ||||||||||||||||||||||||
| 630 | } | - | ||||||||||||||||||||||||
| 631 | - | |||||||||||||||||||||||||
| 632 | return never executed: QObject::event(e);return QObject::event(e);never executed: return QObject::event(e); | 0 | ||||||||||||||||||||||||
| 633 | } | - | ||||||||||||||||||||||||
| 634 | - | |||||||||||||||||||||||||
| 635 | - | |||||||||||||||||||||||||
| 636 | - | |||||||||||||||||||||||||
| 637 | - | |||||||||||||||||||||||||
| 638 | - | |||||||||||||||||||||||||
| 639 | - | |||||||||||||||||||||||||
| 640 | QVariant | - | ||||||||||||||||||||||||
| 641 | QAction::data() const | - | ||||||||||||||||||||||||
| 642 | { | - | ||||||||||||||||||||||||
| 643 | const QActionPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 644 | return never executed: d->userData;return d->userData;never executed: return d->userData; | 0 | ||||||||||||||||||||||||
| 645 | } | - | ||||||||||||||||||||||||
| 646 | void | - | ||||||||||||||||||||||||
| 647 | QAction::setData(const QVariant &data) | - | ||||||||||||||||||||||||
| 648 | { | - | ||||||||||||||||||||||||
| 649 | QActionPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 650 | d->userData = data; | - | ||||||||||||||||||||||||
| 651 | d->sendDataChanged(); | - | ||||||||||||||||||||||||
| 652 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 653 | bool | - | ||||||||||||||||||||||||
| 654 | QAction::showStatusText(QWidget *widget) | - | ||||||||||||||||||||||||
| 655 | { | - | ||||||||||||||||||||||||
| 656 | return never executed: d_func()->showStatusText(widget, statusTip());return d_func()->showStatusText(widget, statusTip());never executed: return d_func()->showStatusText(widget, statusTip()); | 0 | ||||||||||||||||||||||||
| 657 | } | - | ||||||||||||||||||||||||
| 658 | - | |||||||||||||||||||||||||
| 659 | - | |||||||||||||||||||||||||
| 660 | - | |||||||||||||||||||||||||
| 661 | - | |||||||||||||||||||||||||
| 662 | - | |||||||||||||||||||||||||
| 663 | - | |||||||||||||||||||||||||
| 664 | - | |||||||||||||||||||||||||
| 665 | void QAction::activate(ActionEvent event) | - | ||||||||||||||||||||||||
| 666 | { | - | ||||||||||||||||||||||||
| 667 | QActionPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 668 | if(event == Trigger
| 0 | ||||||||||||||||||||||||
| 669 | QPointer<QObject> guard = this; | - | ||||||||||||||||||||||||
| 670 | if(d->checkable
| 0 | ||||||||||||||||||||||||
| 671 | - | |||||||||||||||||||||||||
| 672 | if (d->checked
| 0 | ||||||||||||||||||||||||
| 673 | && d->group->checkedAction() == this
| 0 | ||||||||||||||||||||||||
| 674 | if (!guard.isNull()
| 0 | ||||||||||||||||||||||||
| 675 | triggered(true); never executed: triggered(true); | 0 | ||||||||||||||||||||||||
| 676 | return; never executed: return; | 0 | ||||||||||||||||||||||||
| 677 | } | - | ||||||||||||||||||||||||
| 678 | setChecked(!d->checked); | - | ||||||||||||||||||||||||
| 679 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 680 | if (!guard.isNull()
| 0 | ||||||||||||||||||||||||
| 681 | triggered(d->checked); never executed: triggered(d->checked); | 0 | ||||||||||||||||||||||||
| 682 | } never executed: else if(event == Hoverend of block
| 0 | ||||||||||||||||||||||||
| 683 | hovered(); | - | ||||||||||||||||||||||||
| 684 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 685 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 686 | void QAction::setMenuRole(MenuRole menuRole) | - | ||||||||||||||||||||||||
| 687 | { | - | ||||||||||||||||||||||||
| 688 | QActionPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 689 | if (d->menuRole == menuRole
| 0 | ||||||||||||||||||||||||
| 690 | return; never executed: return; | 0 | ||||||||||||||||||||||||
| 691 | - | |||||||||||||||||||||||||
| 692 | d->menuRole = menuRole; | - | ||||||||||||||||||||||||
| 693 | d->sendDataChanged(); | - | ||||||||||||||||||||||||
| 694 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 695 | - | |||||||||||||||||||||||||
| 696 | QAction::MenuRole QAction::menuRole() const | - | ||||||||||||||||||||||||
| 697 | { | - | ||||||||||||||||||||||||
| 698 | const QActionPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 699 | return never executed: d->menuRole;return d->menuRole;never executed: return d->menuRole; | 0 | ||||||||||||||||||||||||
| 700 | } | - | ||||||||||||||||||||||||
| 701 | void QAction::setIconVisibleInMenu(bool visible) | - | ||||||||||||||||||||||||
| 702 | { | - | ||||||||||||||||||||||||
| 703 | QActionPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 704 | if (d->iconVisibleInMenu == -1
| 0 | ||||||||||||||||||||||||
| 705 | int oldValue = d->iconVisibleInMenu; | - | ||||||||||||||||||||||||
| 706 | d->iconVisibleInMenu = visible; | - | ||||||||||||||||||||||||
| 707 | - | |||||||||||||||||||||||||
| 708 | if (oldValue != -1
| 0 | ||||||||||||||||||||||||
| 709 | || (oldValue == -1
| 0 | ||||||||||||||||||||||||
| 710 | && visible == !QApplication::instance()->testAttribute(Qt::AA_DontShowIconsInMenus)
| 0 | ||||||||||||||||||||||||
| 711 | d->sendDataChanged(); | - | ||||||||||||||||||||||||
| 712 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 713 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 714 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 715 | - | |||||||||||||||||||||||||
| 716 | bool QAction::isIconVisibleInMenu() const | - | ||||||||||||||||||||||||
| 717 | { | - | ||||||||||||||||||||||||
| 718 | const QActionPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 719 | if (d->iconVisibleInMenu == -1
| 0 | ||||||||||||||||||||||||
| 720 | return never executed: !QApplication::instance()->testAttribute(Qt::AA_DontShowIconsInMenus);return !QApplication::instance()->testAttribute(Qt::AA_DontShowIconsInMenus);never executed: return !QApplication::instance()->testAttribute(Qt::AA_DontShowIconsInMenus); | 0 | ||||||||||||||||||||||||
| 721 | } | - | ||||||||||||||||||||||||
| 722 | return never executed: d->iconVisibleInMenu;return d->iconVisibleInMenu;never executed: return d->iconVisibleInMenu; | 0 | ||||||||||||||||||||||||
| 723 | } | - | ||||||||||||||||||||||||
| 724 | - | |||||||||||||||||||||||||
| 725 | - | |||||||||||||||||||||||||
| 726 | __attribute__((visibility("default"))) QDebug operator<<(QDebug d, const QAction *action) | - | ||||||||||||||||||||||||
| 727 | { | - | ||||||||||||||||||||||||
| 728 | QDebugStateSaver saver(d); | - | ||||||||||||||||||||||||
| 729 | d.nospace(); | - | ||||||||||||||||||||||||
| 730 | d << "QAction(" << static_cast<const void *>(action); | - | ||||||||||||||||||||||||
| 731 | if (action
| 0 | ||||||||||||||||||||||||
| 732 | d << " text=" << action->text(); | - | ||||||||||||||||||||||||
| 733 | if (!action->toolTip().isEmpty()
| 0 | ||||||||||||||||||||||||
| 734 | d << " toolTip=" << action->toolTip(); never executed: d << " toolTip=" << action->toolTip(); | 0 | ||||||||||||||||||||||||
| 735 | if (action->isCheckable()
| 0 | ||||||||||||||||||||||||
| 736 | d << " checked=" << action->isChecked(); never executed: d << " checked=" << action->isChecked(); | 0 | ||||||||||||||||||||||||
| 737 | if (!action->shortcut().isEmpty()
| 0 | ||||||||||||||||||||||||
| 738 | d << " shortcut=" << action->shortcut(); never executed: d << " shortcut=" << action->shortcut(); | 0 | ||||||||||||||||||||||||
| 739 | d << " menuRole="; | - | ||||||||||||||||||||||||
| 740 | QtDebugUtils::formatQEnum(d, action->menuRole()); | - | ||||||||||||||||||||||||
| 741 | d << " visible=" << action->isVisible(); | - | ||||||||||||||||||||||||
| 742 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
| 743 | d << '0'; | - | ||||||||||||||||||||||||
| 744 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 745 | d << ')'; | - | ||||||||||||||||||||||||
| 746 | return never executed: d;return d;never executed: return d; | 0 | ||||||||||||||||||||||||
| 747 | } | - | ||||||||||||||||||||||||
| 748 | - | |||||||||||||||||||||||||
| 749 | - | |||||||||||||||||||||||||
| 750 | - | |||||||||||||||||||||||||
| 751 | - | |||||||||||||||||||||||||
| Switch to Source code | Preprocessed file |