Changeset 57808 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- Sep 17, 2015 4:09:23 PM (9 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIActionPool.cpp
r57785 r57808 112 112 UIMenu* UIAction::menu() const 113 113 { 114 return qobject_cast<UIMenu*>(QAction::menu());114 return QAction::menu() ? qobject_cast<UIMenu*>(QAction::menu()) : NULL; 115 115 } 116 116 117 117 UIActionPolymorphic* UIAction::toActionPolymorphic() 118 118 { 119 return qobject_cast<UIActionPolymorphic*>(this);119 return this ? qobject_cast<UIActionPolymorphic*>(this) : NULL; 120 120 } 121 121 122 122 UIActionPolymorphicMenu* UIAction::toActionPolymorphicMenu() 123 123 { 124 return qobject_cast<UIActionPolymorphicMenu*>(this);124 return this ? qobject_cast<UIActionPolymorphicMenu*>(this) : NULL; 125 125 } 126 126 … … 890 890 UIActionPoolRuntime* UIActionPool::toRuntime() 891 891 { 892 return qobject_cast<UIActionPoolRuntime*>(this);892 return this ? qobject_cast<UIActionPoolRuntime*>(this) : NULL; 893 893 } 894 894 895 895 UIActionPoolSelector* UIActionPool::toSelector() 896 896 { 897 return qobject_cast<UIActionPoolSelector*>(this);897 return this ? qobject_cast<UIActionPoolSelector*>(this) : NULL; 898 898 } 899 899 … … 959 959 { 960 960 /* Make sure menu is valid: */ 961 AssertPtrReturnVoid(sender()); 961 962 UIMenu *pMenu = qobject_cast<UIMenu*>(sender()); 962 AssertPtrReturnVoid(pMenu);963 963 /* Make sure action is valid: */ 964 AssertPtrReturnVoid(pMenu->menuAction()); 964 965 UIAction *pAction = qobject_cast<UIAction*>(pMenu->menuAction()); 965 AssertPtrReturnVoid(pAction);966 966 967 967 /* Determine action index: */ -
trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIPopupStack.cpp
r55436 r57808 314 314 { 315 315 /* Menu-bar can exist only on QMainWindow sub-class: */ 316 if (QMainWindow *pMainWindow = qobject_cast<QMainWindow*>(pParent)) 317 { 316 if (pParent) 317 { 318 QMainWindow *pMainWindow = qobject_cast<QMainWindow*>(pParent); 319 318 320 /* Search for existing menu-bar child: */ 319 321 if (QMenuBar *pMenuBar = pMainWindow->findChild<QMenuBar*>()) … … 328 330 { 329 331 /* Status-bar can exist only on QMainWindow sub-class: */ 330 if (QMainWindow *pMainWindow = qobject_cast<QMainWindow*>(pParent)) 331 { 332 if (pParent) 333 { 334 QMainWindow *pMainWindow = qobject_cast<QMainWindow*>(pParent); 335 332 336 /* Search for existing status-bar child: */ 333 337 if (QStatusBar *pStatusBar = pMainWindow->findChild<QStatusBar*>())
Note:
See TracChangeset
for help on using the changeset viewer.