Changeset 67091 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- May 25, 2017 3:21:01 PM (8 years ago)
- svn:sync-xref-src-repo-rev:
- 115754
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/selector
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/selector/UIToolsPane.cpp
r67090 r67091 21 21 22 22 /* Qt includes: */ 23 # include <QStacked Widget>23 # include <QStackedLayout> 24 24 # include <QTabBar> 25 25 … … 42 42 : QIWithRetranslateUI<QWidget>(pParent) 43 43 , m_pLayoutMain(0) 44 , m_pStacked Widget(0)44 , m_pStackedLayout(0) 45 45 , m_pPaneSnapshots(0) 46 46 , m_pLayoutControls(0) … … 53 53 } 54 54 55 UIToolsPane::~UIToolsPane() 56 { 57 /* Cleanup: */ 58 cleanup(); 59 } 60 55 61 void UIToolsPane::setMachine(const CMachine &comMachine) 56 62 { … … 96 102 { 97 103 /* Swap stack-widget pages as well: */ 98 QWidget *pWidget = m_pStacked Widget->widget(iFrom);99 m_pStacked Widget->removeWidget(pWidget);100 m_pStacked Widget->insertWidget(iTo, pWidget);104 QWidget *pWidget = m_pStackedLayout->widget(iFrom); 105 m_pStackedLayout->removeWidget(pWidget); 106 m_pStackedLayout->insertWidget(iTo, pWidget); 101 107 } 102 108 … … 104 110 { 105 111 /* Activate corresponding indexes: */ 106 m_pStacked Widget->setCurrentIndex(iIndex);112 m_pStackedLayout->setCurrentIndex(iIndex); 107 113 } 108 114 … … 126 132 /* Delete the tab and corresponding widget: */ 127 133 m_pTabBar->removeTab(iActualTabIndex); 128 QWidget *pWidget = m_pStacked Widget->widget(iActualTabIndex);129 m_pStacked Widget->removeWidget(pWidget);134 QWidget *pWidget = m_pStackedLayout->widget(iActualTabIndex); 135 m_pStackedLayout->removeWidget(pWidget); 130 136 delete pWidget; 131 137 } … … 141 147 m_pLayoutMain->setContentsMargins(3, 4, 5, 0); 142 148 143 /* Prepare stacked- widget: */144 prepareStacked Widget();149 /* Prepare stacked-layout: */ 150 prepareStackedLayout(); 145 151 146 152 /* Create controls layout: */ … … 173 179 } 174 180 175 void UIToolsPane::prepareStacked Widget()176 { 177 /* Create stacked- widget: */178 m_pStacked Widget = new QStackedWidget;179 AssertPtrReturnVoid(m_pStacked Widget);181 void UIToolsPane::prepareStackedLayout() 182 { 183 /* Create stacked-layout: */ 184 m_pStackedLayout = new QStackedLayout; 185 AssertPtrReturnVoid(m_pStackedLayout); 180 186 { 181 187 /* Add into layout: */ 182 m_pLayoutMain->add Widget(m_pStackedWidget);188 m_pLayoutMain->addLayout(m_pStackedLayout); 183 189 } 184 190 } … … 268 274 } 269 275 276 void UIToolsPane::cleanup() 277 { 278 /* Remove all tab prematurelly: */ 279 while (m_pTabBar->count()) 280 { 281 m_pTabBar->removeTab(0); 282 QWidget *pWidget = m_pStackedLayout->widget(0); 283 m_pStackedLayout->removeWidget(pWidget); 284 delete pWidget; 285 } 286 } 287 270 288 void UIToolsPane::activateTabBarTab(ToolsType enmType, bool fCloseable) 271 289 { … … 285 303 case ToolsType_SnapshotManager: 286 304 m_pPaneSnapshots = new UISnapshotPane; 287 m_pStacked Widget->addWidget(m_pPaneSnapshots);305 m_pStackedLayout->addWidget(m_pPaneSnapshots); 288 306 break; 289 307 case ToolsType_VirtualMediaManager: 290 m_pStacked Widget->addWidget(new UIMediumManagerWidget(EmbedTo_Stack));308 m_pStackedLayout->addWidget(new UIMediumManagerWidget(EmbedTo_Stack)); 291 309 break; 292 310 case ToolsType_HostNetworkManager: 293 m_pStacked Widget->addWidget(new UIHostNetworkManagerWidget(EmbedTo_Stack));311 m_pStackedLayout->addWidget(new UIHostNetworkManagerWidget(EmbedTo_Stack)); 294 312 break; 295 313 default: … … 320 338 321 339 /* Activate corresponding indexes: */ 322 m_pStacked Widget->setCurrentIndex(iActualTabIndex);340 m_pStackedLayout->setCurrentIndex(iActualTabIndex); 323 341 m_pTabBar->setCurrentIndex(iActualTabIndex); 324 342 m_pTabBar->blockSignals(false); -
trunk/src/VBox/Frontends/VirtualBox/src/selector/UIToolsPane.h
r67090 r67091 29 29 class QHBoxLayout; 30 30 class QMenu; 31 class QStacked Widget;31 class QStackedLayout; 32 32 class QTabBar; 33 33 class QVBoxLayout; … … 55 55 /** Constructs tools pane passing @a pParent to the base-class. */ 56 56 UIToolsPane(QWidget *pParent = 0); 57 /** Destructs tools pane. */ 58 virtual ~UIToolsPane() /* override */; 57 59 58 60 /** Defines the @a comMachine object. */ … … 80 82 /** Prepares all. */ 81 83 void prepare(); 82 /** Prepares stacked- widget. */83 void prepareStacked Widget();84 /** Prepares stacked-layout. */ 85 void prepareStackedLayout(); 84 86 /** Prepares tab-bar. */ 85 87 void prepareTabBar(); … … 88 90 /** Prepares menu. */ 89 91 void prepareMenu(); 92 /** Cleanups all. */ 93 void cleanup(); 90 94 91 95 /** Activates corresponding tab-bar tab, adds new if necessary. */ … … 94 98 /** Holds the main layout isntance. */ 95 99 QVBoxLayout *m_pLayoutMain; 96 /** Holds the stacked- widget instance. */97 QStacked Widget *m_pStackedWidget;100 /** Holds the stacked-layout instance. */ 101 QStackedLayout *m_pStackedLayout; 98 102 /** Holds the snapshot pane. */ 99 103 UISnapshotPane *m_pPaneSnapshots;
Note:
See TracChangeset
for help on using the changeset viewer.