Changeset 80352 in vbox
- Timestamp:
- Aug 20, 2019 9:24:24 AM (6 years ago)
- svn:sync-xref-src-repo-rev:
- 132817
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/runtime/information
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/UIInformationConfiguration.cpp
r80351 r80352 31 31 #include "UIIconPool.h" 32 32 #include "UIInformationConfiguration.h" 33 #include "UIInformationDataItem.h"34 #include "UIInformationItem.h"35 #include "UIInformationView.h"36 #include "UIInformationModel.h"37 33 38 34 … … 42 38 , m_console(console) 43 39 , m_pMainLayout(0) 44 , m_pModel(0)45 , m_pView(0)46 40 , m_pTableWidget(0) 47 41 , m_iColumCount(3) … … 51 45 , m_iRowBottomMargin(0.2 * qApp->style()->pixelMetric(QStyle::PM_LayoutBottomMargin)) 52 46 { 53 /* Prepare model: */54 prepareModel();55 56 47 /* Prepare view: */ 57 48 prepareObjects(); … … 79 70 } 80 71 81 void UIInformationConfiguration::prepareModel()82 {83 /* Create information-model: */84 m_pModel = new UIInformationModel(this, m_machine, m_console);85 AssertPtrReturnVoid(m_pModel);86 {87 /* Create general data-item: */88 UIInformationDataItem *pGeneral = new UIInformationDataGeneral(m_machine, m_console, m_pModel);89 AssertPtrReturnVoid(pGeneral);90 {91 /* Add general data-item to model: */92 m_pModel->addItem(pGeneral);93 }94 95 /* Create system data-item: */96 UIInformationDataItem *pSystem = new UIInformationDataSystem(m_machine, m_console, m_pModel);97 AssertPtrReturnVoid(pSystem);98 {99 /* Add system data-item to model: */100 m_pModel->addItem(pSystem);101 }102 103 /* Create display data-item: */104 UIInformationDataItem *pDisplay = new UIInformationDataDisplay(m_machine, m_console, m_pModel);105 AssertPtrReturnVoid(pDisplay);106 {107 /* Add display data-item to model: */108 m_pModel->addItem(pDisplay);109 }110 111 /* Create storage data-item: */112 UIInformationDataItem *pStorage = new UIInformationDataStorage(m_machine, m_console, m_pModel);113 AssertPtrReturnVoid(pStorage);114 {115 /* Add storage data-item to model: */116 m_pModel->addItem(pStorage);117 }118 119 /* Create audio data-item: */120 UIInformationDataItem *pAudio = new UIInformationDataAudio(m_machine, m_console, m_pModel);121 AssertPtrReturnVoid(pAudio);122 {123 /* Add audio data-item to model: */124 m_pModel->addItem(pAudio);125 }126 127 /* Create network data-item: */128 UIInformationDataItem *pNetwork = new UIInformationDataNetwork(m_machine, m_console, m_pModel);129 AssertPtrReturnVoid(pNetwork);130 {131 /* Add network data-item to model: */132 m_pModel->addItem(pNetwork);133 }134 135 /* Create serial-ports data-item: */136 UIInformationDataItem *pSerialPorts = new UIInformationDataSerialPorts(m_machine, m_console, m_pModel);137 AssertPtrReturnVoid(pSerialPorts);138 {139 /* Add serial-ports data-item to model: */140 m_pModel->addItem(pSerialPorts);141 }142 143 /* Create usb data-item: */144 UIInformationDataItem *pUSB = new UIInformationDataUSB(m_machine, m_console, m_pModel);145 AssertPtrReturnVoid(pUSB);146 {147 /* Add usb data-item to model: */148 m_pModel->addItem(pUSB);149 }150 151 /* Create shared-folders data-item: */152 UIInformationDataItem *pSharedFolders = new UIInformationDataSharedFolders(m_machine, m_console, m_pModel);153 AssertPtrReturnVoid(pSharedFolders);154 {155 /* Add shared-folders data-item to model: */156 m_pModel->addItem(pSharedFolders);157 }158 }159 }160 161 72 void UIInformationConfiguration::prepareObjects() 162 73 { … … 167 78 m_pMainLayout->setSpacing(0); 168 79 169 170 /* Create information-view: */171 m_pView = new UIInformationView;172 AssertPtrReturnVoid(m_pView);173 {174 /* Configure information-view: */175 m_pView->setResizeMode(QListView::Adjust);176 177 /* Create information-delegate item: */178 UIInformationItem *pItem = new UIInformationItem(m_pView);179 AssertPtrReturnVoid(pItem);180 {181 /* Set item-delegate for information-view: */182 m_pView->setItemDelegate(pItem);183 }184 /* Connect data changed signal: */185 connect(m_pModel, &UIInformationModel::dataChanged, m_pView, &UIInformationView::updateData);186 187 /* Set model for view: */188 m_pView->setModel(m_pModel);189 /* Add information-view to the layout: */190 m_pMainLayout->addWidget(m_pView);191 }192 193 80 m_pTableWidget = new QTableWidget; 194 195 81 if (m_pTableWidget) 196 82 { … … 201 87 m_pTableWidget->setShowGrid(false); 202 88 m_pMainLayout->addWidget(m_pTableWidget); 203 m_pTableWidget->hide();204 89 } 205 90 } -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/UIInformationConfiguration.h
r80351 r80352 38 38 /* Forward declarations: */ 39 39 class QVBoxLayout; 40 class UIInformationView;41 class UIInformationModel;42 40 class QTableWidget; 43 41 class QTableWidgetItem; … … 64 62 65 63 private: 66 /** Prepares model. */ 67 void prepareModel(); 64 68 65 void prepareObjects(); 69 66 void createTableItems(); … … 82 79 /** Holds the instance of layout we create. */ 83 80 QVBoxLayout *m_pMainLayout; 84 /** Holds the instance of model we create. */85 UIInformationModel *m_pModel;86 /** Holds the instance of view we create. */87 UIInformationView *m_pView;88 81 QTableWidget *m_pTableWidget; 89 82 //QMap<TableRow, UIInformationTableRow*> m_rows;
Note:
See TracChangeset
for help on using the changeset viewer.