Changeset 85619 in vbox
- Timestamp:
- Aug 5, 2020 6:34:08 PM (5 years ago)
- svn:sync-xref-src-repo-rev:
- 139728
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/globals
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIActionPool.cpp
r85613 r85619 196 196 void UIAction::updateIcon() 197 197 { 198 QAction::setIcon(m_icons.value(m_iState ));198 QAction::setIcon(m_icons.value(m_iState, m_icons.value(0))); 199 199 } 200 200 … … 264 264 void UIActionMenu::setShowToolTip(bool fShowToolTip) 265 265 { 266 qobject_cast<UIMenu*>(menu())->setShowToolTip(fShowToolTip); 266 UIMenu *pMenu = qobject_cast<UIMenu*>(menu()); 267 AssertPtrReturnVoid(pMenu); 268 pMenu->setShowToolTip(fShowToolTip); 267 269 } 268 270 … … 421 423 void UIActionPolymorphicMenu::setShowToolTip(bool fShowToolTip) 422 424 { 423 qobject_cast<UIMenu*>(menu())->setShowToolTip(fShowToolTip); 425 UIMenu *pMenu = qobject_cast<UIMenu*>(menu()); 426 if (pMenu) 427 pMenu->setShowToolTip(fShowToolTip); 424 428 } 425 429 -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIActionPool.h
r85610 r85619 144 144 }; 145 145 146 /** Restriction levels. */146 /** Action restriction levels. */ 147 147 enum UIActionRestrictionLevel 148 148 { … … 237 237 /** Defines action @a strShortcutScope. */ 238 238 void setShortcutScope(const QString &strShortcutScope) { m_strShortcutScope = strShortcutScope; } 239 240 /** Defines current keyboard shortcuts for this action. */ 241 void setShortcuts(const QList<QKeySequence> &shortcuts); 242 /** Make action show keyboard shortcut. */ 243 void showShortcut(); 244 /** Make action hide keyboard shortcut. */ 245 void hideShortcut(); 239 246 240 247 /** Returns action extra-data ID. */ … … 252 259 virtual QKeySequence standardShortcut(UIActionPoolType) const { return QKeySequence(); } 253 260 254 /** Defines current keyboard shortcuts for this action. */255 void setShortcuts(const QList<QKeySequence> &shortcuts);256 /** Make action show keyboard shortcut. */257 void showShortcut();258 /** Make action hide keyboard shortcut. */259 void hideShortcut();260 261 261 /** Retranslates action. */ 262 262 virtual void retranslateUi() = 0; … … 286 286 287 287 /** Holds the action type. */ 288 UIActionType m_enmType;288 const UIActionType m_enmType; 289 289 /** Holds whether this is machine-menu action. */ 290 bool m_fMachineMenuAction;290 const bool m_fMachineMenuAction; 291 291 292 292 /** Holds the reference to the action-pool this action belongs to. */ 293 UIActionPool *m_pActionPool;293 UIActionPool *m_pActionPool; 294 294 /** Holds the type of the action-pool this action belongs to. */ 295 UIActionPoolType m_enmActionPoolType;295 const UIActionPoolType m_enmActionPoolType; 296 296 297 297 /** Holds current action state. */ 298 int 298 int m_iState; 299 299 /** Holds action icons. */ 300 QVector<QIcon> m_icons; 300 QVector<QIcon> m_icons; 301 301 302 /** Holds the action name. */ 302 QString m_strName; 303 QString m_strName; 304 303 305 /** Holds the action shortcut scope. */ 304 306 QString m_strShortcutScope; … … 321 323 * @param strIconDisabled Brings the disabled-icon name. */ 322 324 UIActionMenu(UIActionPool *pParent, 323 const QString &strIcon = QString(), 324 const QString &strIconDisabled = QString()); 325 const QString &strIcon = QString(), const QString &strIconDisabled = QString()); 325 326 /** Constructs menu action passing @a pParent to the base-class. 326 327 * @param strIconNormal Brings the normal-icon name.
Note:
See TracChangeset
for help on using the changeset viewer.