Changeset 59644 in vbox
- Timestamp:
- Feb 12, 2016 10:48:52 AM (9 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/runtime/information
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/UIInformationModel.cpp
r59484 r59644 44 44 /* Prepare information-model: */ 45 45 prepare(); 46 47 /* Prepare data for information-model: */48 prepareData();49 46 } 50 47 … … 72 69 roleNames[Qt::DisplayRole] = ""; 73 70 roleNames[Qt::DecorationRole] = ""; 74 roleNames[Qt:: SizeHintRole] = "";75 roleNames[Qt::UserRole +1] = "";71 roleNames[Qt::UserRole + 1] = ""; 72 roleNames[Qt::UserRole + 2] = ""; 76 73 setRoleNames(roleNames); 77 74 78 75 /* Register meta-type: */ 79 76 qRegisterMetaType<InformationElementType>(); 80 }81 82 void UIInformationModel::prepareData()83 {84 /* Prepare data for information-model: */85 UIInformationDataItem *pGeneral = new UIInformationDataGeneral(m_machine, m_console);86 AssertPtrReturnVoid(pGeneral);87 {88 m_list.append(pGeneral);89 }90 UIInformationDataSystem *pSystem = new UIInformationDataSystem(m_machine, m_console);91 AssertPtrReturnVoid(pSystem);92 {93 m_list.append(pSystem);94 }95 UIInformationDataDisplay *pDisplay = new UIInformationDataDisplay(m_machine, m_console);96 AssertPtrReturnVoid(pDisplay);97 {98 m_list.append(pDisplay);99 }100 77 } 101 78 … … 105 82 roleNames[Qt::DisplayRole] = ""; 106 83 roleNames[Qt::DecorationRole] = ""; 107 roleNames[Qt:: SizeHintRole] = "";108 roleNames[Qt::UserRole +1] = "";84 roleNames[Qt::UserRole + 1] = ""; 85 roleNames[Qt::UserRole + 2] = ""; 109 86 return roleNames; 110 87 } 111 88 89 void UIInformationModel::addItem(UIInformationDataItem *pItem) 90 { 91 AssertPtrReturnVoid(pItem); 92 m_list.append(pItem); 93 } 94 95 void UIInformationModel::updateData(const QModelIndex &idx) 96 { 97 emit dataChanged(idx, idx); 98 } 99 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/UIInformationModel.h
r59484 r59644 67 67 QVariant data(const QModelIndex &idx, int role = Qt::DisplayRole) const; 68 68 69 /** Adds the item. */ 70 void addItem(UIInformationDataItem *pItem); 71 72 /** Updates Data. */ 73 void updateData(const QModelIndex &idx); 74 69 75 private: 70 76 71 77 /** Prepares information-model. */ 72 78 void prepare(); 73 74 /** Prepares data for information-model. */75 void prepareData();76 79 77 80 /** Returns the list of role-names supported by model. */
Note:
See TracChangeset
for help on using the changeset viewer.