Changeset 65274 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- Jan 13, 2017 8:13:30 AM (8 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/runtime/information
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/UIInformationConfiguration.cpp
r62347 r65274 33 33 #endif /* !VBOX_WITH_PRECOMPILED_HEADERS */ 34 34 35 35 36 UIInformationConfiguration::UIInformationConfiguration(QWidget *pParent, const CMachine &machine, const CConsole &console) 36 37 : QWidget(pParent) … … 41 42 , m_pView(0) 42 43 { 43 /* Prepare main-layout: */44 prepare MainLayout();44 /* Prepare layout: */ 45 prepareLayout(); 45 46 46 47 /* Prepare model: */ … … 51 52 } 52 53 53 void UIInformationConfiguration::prepare MainLayout()54 void UIInformationConfiguration::prepareLayout() 54 55 { 55 /* Create main-layout: */56 m_pMainLayout = new QVBoxLayout ;56 /* Create layout: */ 57 m_pMainLayout = new QVBoxLayout(this); 57 58 AssertPtrReturnVoid(m_pMainLayout); 58 59 { 59 /* Configure main-layout: */60 /* Configure layout: */ 60 61 m_pMainLayout->setContentsMargins(2, 0, 0, 0); 61 62 m_pMainLayout->setSpacing(0); 62 /* Set main-layout: */63 setLayout(m_pMainLayout);64 63 } 65 64 } … … 163 162 /* Configure information-view: */ 164 163 m_pView->setResizeMode(QListView::Adjust); 164 165 165 /* Create information-delegate item: */ 166 166 UIInformationItem *pItem = new UIInformationItem(m_pView); … … 170 170 m_pView->setItemDelegate(pItem); 171 171 } 172 /* Connect data changed signal: */173 connect(m_pModel, SIGNAL(dataChanged(const QModelIndex &, const QModelIndex&)),174 m_pView, SLOT(updateData(const QModelIndex &, const QModelIndex&)));172 /* Connect data changed signal: */ 173 connect(m_pModel, SIGNAL(dataChanged(const QModelIndex &, const QModelIndex &)), 174 m_pView, SLOT(updateData(const QModelIndex &, const QModelIndex &))); 175 175 176 176 /* Set model for view: */ 177 177 m_pView->setModel(m_pModel); 178 /* Add information-view to the main-layout: */178 /* Add information-view to the layout: */ 179 179 m_pMainLayout->addWidget(m_pView); 180 180 } -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/UIInformationConfiguration.h
r62347 r65274 33 33 class UIInformationModel; 34 34 35 35 36 /** QWidget extension 36 37 * providing GUI with configuration-information tab in session-information window. */ … … 48 49 private: 49 50 50 /** Prepares main-layout. */51 void prepare MainLayout();51 /** Prepares layout. */ 52 void prepareLayout(); 52 53 53 54 /** Prepares model. */ -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/UIInformationRuntime.cpp
r60021 r65274 33 33 #endif /* !VBOX_WITH_PRECOMPILED_HEADERS */ 34 34 35 35 36 UIInformationRuntime::UIInformationRuntime(QWidget *pParent, const CMachine &machine, const CConsole &console) 36 37 : QWidget(pParent) … … 41 42 , m_pView(0) 42 43 { 43 /* Prepare main-layout: */44 /* Prepare layout: */ 44 45 prepareLayout(); 45 46 … … 53 54 void UIInformationRuntime::prepareLayout() 54 55 { 55 /* Create main-layout: */56 /* Create layout: */ 56 57 m_pMainLayout = new QVBoxLayout(this); 57 58 AssertPtrReturnVoid(m_pMainLayout); 58 59 { 59 /* Configure main-layout: */60 /* Configure layout: */ 60 61 m_pMainLayout->setContentsMargins(2, 0, 0, 0); 61 62 m_pMainLayout->setSpacing(0); 62 /* Set main-layout: */63 setLayout(m_pMainLayout);64 63 } 65 64 } … … 67 66 void UIInformationRuntime::prepareModel() 68 67 { 69 /* Create model: */68 /* Create information-model: */ 70 69 m_pModel = new UIInformationModel(this, m_machine, m_console); 71 70 AssertPtrReturnVoid(m_pModel); 71 { 72 /* Create runtime-attributes data-item: */ 73 UIInformationDataRuntimeAttributes *pGeneral = new UIInformationDataRuntimeAttributes(m_machine, m_console, m_pModel); 74 AssertPtrReturnVoid(pGeneral); 75 { 76 /* Add runtime-attributes data-item to model: */ 77 m_pModel->addItem(pGeneral); 78 } 72 79 73 /* Create runtime-attributesitem: */74 UIInformationDataRuntimeAttributes *pGeneral = new UIInformationDataRuntimeAttributes(m_machine, m_console, m_pModel);75 AssertPtrReturnVoid(pGeneral);76 {77 /* Add runtime-attributesitem to model: */78 m_pModel->addItem(pGeneral);79 }80 /* Create network-statistics data-item: */ 81 UIInformationDataNetworkStatistics *pNetwork = new UIInformationDataNetworkStatistics(m_machine, m_console, m_pModel); 82 AssertPtrReturnVoid(pNetwork); 83 { 84 /* Add network-statistics data-item to model: */ 85 m_pModel->addItem(pNetwork); 86 } 80 87 81 /* Create network-statistics item: */ 82 UIInformationDataNetworkStatistics *pNetwork = new UIInformationDataNetworkStatistics(m_machine, m_console, m_pModel); 83 AssertPtrReturnVoid(pNetwork); 84 { 85 /* Add network-statistics item to model: */ 86 m_pModel->addItem(pNetwork); 87 } 88 89 /* Create storage-statistics item: */ 90 UIInformationDataStorageStatistics *pStorage = new UIInformationDataStorageStatistics(m_machine, m_console, m_pModel); 91 AssertPtrReturnVoid(pStorage); 92 { 93 /* Add storage-statistics item to model: */ 94 m_pModel->addItem(pStorage); 88 /* Create storage-statistics data-item: */ 89 UIInformationDataStorageStatistics *pStorage = new UIInformationDataStorageStatistics(m_machine, m_console, m_pModel); 90 AssertPtrReturnVoid(pStorage); 91 { 92 /* Add storage-statistics data-item to model: */ 93 m_pModel->addItem(pStorage); 94 } 95 95 } 96 96 } … … 98 98 void UIInformationRuntime::prepareView() 99 99 { 100 /* Create view: */100 /* Create information-view: */ 101 101 m_pView = new UIInformationView; 102 102 AssertPtrReturnVoid(m_pView); 103 103 { 104 /* Configure view: */104 /* Configure information-view: */ 105 105 m_pView->setResizeMode(QListView::Adjust); 106 106 107 107 /* Create information-delegate item: */ 108 UIInformationItem *pItem = new UIInformationItem(m_pView);108 UIInformationItem *pItem = new UIInformationItem(m_pView); 109 109 AssertPtrReturnVoid(pItem); 110 110 { 111 /* Set item-delegate : */111 /* Set item-delegate for information-view: */ 112 112 m_pView->setItemDelegate(pItem); 113 113 } 114 /* Connect data changed signal: */115 connect(m_pModel, SIGNAL(dataChanged(const QModelIndex , const QModelIndex)),116 m_pView, SLOT(updateData(const QModelIndex ,const QModelIndex)));114 /* Connect data changed signal: */ 115 connect(m_pModel, SIGNAL(dataChanged(const QModelIndex &, const QModelIndex &)), 116 m_pView, SLOT(updateData(const QModelIndex &, const QModelIndex &))); 117 117 118 /* Set model : */118 /* Set model for view: */ 119 119 m_pView->setModel(m_pModel); 120 /* Layout view: */120 /* Add information-view to the layout: */ 121 121 m_pMainLayout->addWidget(m_pView); 122 122 } -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/UIInformationRuntime.h
r59646 r65274 28 28 #include "CConsole.h" 29 29 30 /* Forward declartions: */ 31 class UIVMItem; 30 /* Forward declarations: */ 32 31 class QVBoxLayout; 33 32 class UIInformationView; 34 33 class UIInformationModel; 34 class UIVMItem; 35 35 36 36 37 /** QWidget extension … … 49 50 private: 50 51 51 /** Prepares main-layout. */52 /** Prepares layout. */ 52 53 void prepareLayout(); 53 54
Note:
See TracChangeset
for help on using the changeset viewer.