Changeset 57880 in vbox
- Timestamp:
- Sep 24, 2015 2:05:48 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
r57809 r57880 112 112 UIMenu* UIAction::menu() const 113 113 { 114 return qobject_cast<UIMenu*>(QAction::menu());114 return QAction::menu() ? qobject_cast<UIMenu*>(QAction::menu()) : 0; 115 115 } 116 116 … … 959 959 { 960 960 /* Make sure menu is valid: */ 961 AssertPtrReturnVoid(sender()); 961 962 UIMenu *pMenu = qobject_cast<UIMenu*>(sender()); 962 963 AssertPtrReturnVoid(pMenu); 963 964 /* Make sure action is valid: */ 965 AssertPtrReturnVoid(pMenu->menuAction()); 964 966 UIAction *pAction = qobject_cast<UIAction*>(pMenu->menuAction()); 965 967 AssertPtrReturnVoid(pAction); -
trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIPopupStack.cpp
r57809 r57880 314 314 { 315 315 /* Menu-bar can exist only on QMainWindow sub-class: */ 316 if (QMainWindow *pMainWindow = qobject_cast<QMainWindow*>(pParent)) 317 { 318 /* Search for existing menu-bar child: */ 319 if (QMenuBar *pMenuBar = pMainWindow->findChild<QMenuBar*>()) 320 return pMenuBar->height(); 316 if (pParent) 317 { 318 if (QMainWindow *pMainWindow = qobject_cast<QMainWindow*>(pParent)) 319 { 320 /* Search for existing menu-bar child: */ 321 if (QMenuBar *pMenuBar = pMainWindow->findChild<QMenuBar*>()) 322 return pMenuBar->height(); 323 } 321 324 } 322 325 /* Zero by default: */ … … 328 331 { 329 332 /* Status-bar can exist only on QMainWindow sub-class: */ 330 if (QMainWindow *pMainWindow = qobject_cast<QMainWindow*>(pParent)) 331 { 332 /* Search for existing status-bar child: */ 333 if (QStatusBar *pStatusBar = pMainWindow->findChild<QStatusBar*>()) 334 return pStatusBar->height(); 333 if (pParent) 334 { 335 if (QMainWindow *pMainWindow = qobject_cast<QMainWindow*>(pParent)) 336 { 337 /* Search for existing status-bar child: */ 338 if (QStatusBar *pStatusBar = pMainWindow->findChild<QStatusBar*>()) 339 return pStatusBar->height(); 340 } 335 341 } 336 342 /* Zero by default: */
Note:
See TracChangeset
for help on using the changeset viewer.