Changeset 63895 in vbox
- Timestamp:
- Sep 19, 2016 4:07:41 PM (8 years ago)
- svn:sync-xref-src-repo-rev:
- 110769
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/selector/UISnapshotPane.cpp
r63894 r63895 55 55 56 56 /** QTreeWidgetItem subclass for snapshots items. */ 57 class UISnapshotItem : public QTreeWidgetItem 58 { 57 class UISnapshotItem : public QObject, public QTreeWidgetItem 58 { 59 Q_OBJECT; 60 59 61 public: 60 62 … … 79 81 QString snapshotID() const { return m_strSnapshotID; } 80 82 83 /** Returns the parent snapshot tree. */ 84 UISnapshotTree *parentSnapshotTree() const; 85 /** Returns the parent snapshot item. */ 86 UISnapshotItem *parentSnapshotItem() const; 87 /** Returns the child snapshot item with @a iIndex. */ 88 UISnapshotItem *childSnapshotItem(int iIndex) const; 89 81 90 /** Returns item data for corresponding @a iColumn and @a iRole. */ 82 91 QVariant data(int iColumn, int iRole) const; … … 206 215 /* Fetch current machine state: */ 207 216 updateCurrentState(m_comMachine.GetState()); 217 } 218 219 UISnapshotTree *UISnapshotItem::parentSnapshotTree() const 220 { 221 /* Return the parent snapshot tree if any: */ 222 return treeWidget() ? qobject_cast<UISnapshotTree*>(treeWidget()) : 0; 223 } 224 225 UISnapshotItem *UISnapshotItem::parentSnapshotItem() const 226 { 227 /* Return the parent snapshot item if any: */ 228 return QTreeWidgetItem::parent() ? UISnapshotPane::toSnapshotItem(QTreeWidgetItem::parent()) : 0; 229 } 230 231 UISnapshotItem *UISnapshotItem::childSnapshotItem(int iIndex) const 232 { 233 /* Return the child snapshot item with iIndex if any: */ 234 return QTreeWidgetItem::child(iIndex) ? UISnapshotPane::toSnapshotItem(QTreeWidgetItem::child(iIndex)) : 0; 208 235 } 209 236 … … 308 335 m_strDesc = m_fCurrentStateModified ? 309 336 UISnapshotPane::tr("The current state differs from the state stored in the current snapshot") : 310 parent() != 0 ?337 QTreeWidgetItem::parent() != 0 ? 311 338 UISnapshotPane::tr("The current state is identical to the state stored in the current snapshot") : 312 339 QString();
Note:
See TracChangeset
for help on using the changeset viewer.