Changeset 65328 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Jan 16, 2017 1:27:07 PM (8 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/UIInformationItem.cpp
r65327 r65328 101 101 } 102 102 103 void UIInformationItem::updateData(const QModelIndex &index) const 104 { 105 /* Set name: */ 106 setName(index.data().toString()); 107 /* Set icon: */ 108 setIcon(index.data(Qt::DecorationRole).toString()); 109 /* Set text: */ 110 setText(index.data(Qt::UserRole + 1).value<UITextTable>()); 111 /* Get type of the item: */ 112 m_type = index.data(Qt::UserRole + 2).value<InformationElementType>(); 113 } 114 115 QString UIInformationItem::htmlData() 116 { 117 /* Return html-data: */ 118 return m_pTextDocument->toHtml(); 119 } 120 103 121 void UIInformationItem::paint(QPainter *pPainter, const QStyleOptionViewItem &option, const QModelIndex &index) const 104 122 { … … 134 152 /* Return size: */ 135 153 return m_pTextDocument->size().toSize(); 136 }137 138 void UIInformationItem::updateData(const QModelIndex &index) const139 {140 /* Set name: */141 setName(index.data().toString());142 /* Set icon: */143 setIcon(index.data(Qt::DecorationRole).toString());144 /* Set text: */145 setText(index.data(Qt::UserRole + 1).value<UITextTable>());146 /* Get type of the item: */147 m_type = index.data(Qt::UserRole + 2).value<InformationElementType>();148 }149 150 QString UIInformationItem::htmlData()151 {152 /* Return html-data: */153 return m_pTextDocument->toHtml();154 154 } 155 155 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/UIInformationItem.h
r65327 r65328 63 63 void setText(const UITextTable &text) const; 64 64 65 /** Updates data for information-item with @a index. */ 66 void updateData(const QModelIndex &index) const; 67 68 /** Returns html data. */ 69 QString htmlData(); 70 71 protected: 72 65 73 /** Performs painting for @a index using @a pPainter and @a option set. */ 66 74 void paint(QPainter *pPainter, const QStyleOptionViewItem &option, const QModelIndex &index) const; … … 68 76 /** Calculates size-hint for @a index using @a option set. */ 69 77 QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const; 70 71 /** Updates data for information-item with @a index. */72 void updateData(const QModelIndex &index) const;73 74 /** Returns html data. */75 QString htmlData();76 78 77 79 private:
Note:
See TracChangeset
for help on using the changeset viewer.