Changeset 65578 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- Feb 1, 2017 8:54:47 PM (8 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/widgets
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIApplianceEditorWidget.cpp
r64798 r65578 1094 1094 } 1095 1095 1096 void UIApplianceModel::restoreDefaults(const QModelIndex &parentIdx /* = QModelIndex() */) 1097 { 1098 UIApplianceModelItem *pParentItem; 1099 1096 void UIApplianceModel::restoreDefaults(QModelIndex parentIdx /* = QModelIndex() */) 1097 { 1098 /* By default use the root: */ 1100 1099 if (!parentIdx.isValid()) 1101 p ParentItem = m_pRootItem;1102 else 1103 pParentItem = static_cast<UIApplianceModelItem*>(parentIdx.internalPointer());1104 1100 parentIdx = root(); 1101 1102 /* Get corresponding parent item and enumerate it's children: */ 1103 UIApplianceModelItem *pParentItem = static_cast<UIApplianceModelItem*>(parentIdx.internalPointer()); 1105 1104 for (int i = 0; i < pParentItem->childCount(); ++i) 1106 1105 { 1106 /* Reset children item data to default: */ 1107 1107 pParentItem->childItem(i)->restoreDefaults(); 1108 /* Recursively process children item: */ 1108 1109 restoreDefaults(index(i, 0, parentIdx)); 1109 1110 } 1110 emit dataChanged(index(0, 0, parentIdx), index(pParentItem->childCount()-1, 0, parentIdx)); 1111 /* Notify the model about the changes: */ 1112 emit dataChanged(index(0, 0, parentIdx), index(pParentItem->childCount() - 1, 0, parentIdx)); 1111 1113 } 1112 1114 -
trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIApplianceEditorWidget.h
r64748 r65578 97 97 98 98 /** Restores the default values for the item with the given @a parentIdx. */ 99 void restoreDefaults( const QModelIndex &parentIdx = QModelIndex());99 void restoreDefaults(QModelIndex parentIdx = QModelIndex()); 100 100 101 101 /** Cache currently stored values. */
Note:
See TracChangeset
for help on using the changeset viewer.