Changeset 84582 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- May 28, 2020 11:11:40 AM (5 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/manager
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManagerWidget.cpp
r84557 r84582 494 494 495 495 /* Create Chooser-pane: */ 496 m_pPaneChooser = new UIChooser(this );496 m_pPaneChooser = new UIChooser(this, actionPool()); 497 497 if (m_pPaneChooser) 498 498 { -
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooser.cpp
r84578 r84582 24 24 #include "UIChooserModel.h" 25 25 #include "UIChooserView.h" 26 #include "UIVirtualBoxManagerWidget.h" 27 28 29 UIChooser::UIChooser(UIVirtualBoxManagerWidget *pParent) 26 27 28 UIChooser::UIChooser(QWidget *pParent, UIActionPool *pActionPool) 30 29 : QWidget(pParent) 31 , m_p ManagerWidget(pParent)30 , m_pActionPool(pActionPool) 32 31 , m_pChooserModel(0) 33 32 , m_pChooserView(0) … … 39 38 { 40 39 cleanup(); 41 }42 43 UIActionPool *UIChooser::actionPool() const44 {45 AssertPtrReturn(managerWidget(), 0);46 return managerWidget()->actionPool();47 40 } 48 41 … … 205 198 { 206 199 /* Prepare Chooser-model: */ 207 m_pChooserModel = new UIChooserModel(this );200 m_pChooserModel = new UIChooserModel(this, actionPool()); 208 201 } 209 202 -
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooser.h
r84557 r84582 32 32 class UIChooserModel; 33 33 class UIChooserView; 34 class UIVirtualBoxManagerWidget;35 34 class UIVirtualMachineItem; 36 35 … … 80 79 public: 81 80 82 /** Constructs Chooser-pane passing @a pParent to the base-class. */ 83 UIChooser(UIVirtualBoxManagerWidget *pParent); 81 /** Constructs Chooser-pane passing @a pParent to the base-class. 82 * @param pActionPool Brings the action-pool reference. */ 83 UIChooser(QWidget *pParent, UIActionPool *pActionPool); 84 84 /** Destructs Chooser-pane. */ 85 85 virtual ~UIChooser() /* override */; … … 87 87 /** @name General stuff. 88 88 * @{ */ 89 /** Returns the manager-widget reference. */90 UIVirtualBoxManagerWidget *managerWidget() const { return m_pManagerWidget; }91 92 89 /** Returns the action-pool reference. */ 93 UIActionPool *actionPool() const ;90 UIActionPool *actionPool() const { return m_pActionPool; } 94 91 95 92 /** Return the Chooser-model instance. */ … … 197 194 /** @name General stuff. 198 195 * @{ */ 199 /** Holds the manager-widgetreference. */200 UI VirtualBoxManagerWidget *m_pManagerWidget;196 /** Holds the action-pool reference. */ 197 UIActionPool *m_pActionPool; 201 198 202 199 /** Holds the Chooser-model instane. */ -
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserItem.cpp
r83884 r84582 30 30 31 31 /* GUI includes: */ 32 #include "UIChooser.h"33 32 #include "UIChooserItem.h" 34 33 #include "UIChooserItemGroup.h" … … 91 90 92 91 /* Return the parent: */ 93 return QAccessible::queryAccessibleInterface(item()->model()-> chooser()->view());92 return QAccessible::queryAccessibleInterface(item()->model()->view()); 94 93 } 95 94 … … 138 137 const QSize itemSize = item()->size().toSize(); 139 138 const QPointF itemPosInScene = item()->mapToScene(QPointF(0, 0)); 140 const QPoint itemPosInView = item()->model()-> chooser()->view()->mapFromScene(itemPosInScene);141 const QPoint itemPosInScreen = item()->model()-> chooser()->view()->mapToGlobal(itemPosInView);139 const QPoint itemPosInView = item()->model()->view()->mapFromScene(itemPosInScene); 140 const QPoint itemPosInScreen = item()->model()->view()->mapToGlobal(itemPosInView); 142 141 const QRect itemRectInScreen = QRect(itemPosInScreen, itemSize); 143 142 return itemRectInScreen; … … 345 344 AssertMsg(pModel, ("Incorrect graphics scene parent set!")); 346 345 return pModel; 347 }348 349 UIActionPool *UIChooserItem::actionPool() const350 {351 return model()->actionPool();352 346 } 353 347 -
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserItem.h
r83672 r84582 108 108 /** Returns model reference. */ 109 109 UIChooserModel *model() const; 110 /** Returns action-pool reference. */111 UIActionPool *actionPool() const;112 110 113 111 /** Returns whether item is root. */ -
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserModel.cpp
r84574 r84582 57 57 58 58 59 UIChooserModel:: UIChooserModel(UIChooser *pParent)59 UIChooserModel::UIChooserModel(UIChooser *pParent, UIActionPool *pActionPool) 60 60 : UIChooserAbstractModel(pParent) 61 , m_p Chooser(pParent)61 , m_pActionPool(pActionPool) 62 62 , m_pScene(0) 63 63 , m_pMouseHandler(0) … … 98 98 } 99 99 100 UIChooser *UIChooserModel::chooser() const101 {102 return m_pChooser;103 }104 105 100 UIActionPool *UIChooserModel::actionPool() const 106 101 { 107 return chooser() ? chooser()->actionPool() : 0;102 return m_pActionPool; 108 103 } 109 104 -
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserModel.h
r84569 r84582 99 99 100 100 /** Constructs Chooser-model passing @a pParent to the base-class. */ 101 UIChooserModel(UIChooser *pParent );101 UIChooserModel(UIChooser *pParent, UIActionPool *pActionPool); 102 102 /** Destructs Chooser-model. */ 103 103 virtual ~UIChooserModel() /* override */; … … 110 110 virtual void deinit() /* override */; 111 111 112 /** Returns the Chooser reference. */113 UIChooser *chooser() const;114 112 /** Returns the action-pool reference. */ 115 113 UIActionPool *actionPool() const; … … 381 379 /** @name General stuff. 382 380 * @{ */ 383 /** Holds the Chooserreference. */384 UI Chooser *m_pChooser;381 /** Holds the action-pool reference. */ 382 UIActionPool *m_pActionPool; 385 383 386 384 /** Holds the scene reference. */
Note:
See TracChangeset
for help on using the changeset viewer.