VirtualBox

Ignore:
Timestamp:
Feb 1, 2017 8:54:47 PM (8 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:6899: Accessibility support (step 180): Update UIApplianceModel ability to reset values to defaults which was forgotten in r112079.

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  
    10941094}
    10951095
    1096 void UIApplianceModel::restoreDefaults(const QModelIndex &parentIdx /* = QModelIndex() */)
    1097 {
    1098     UIApplianceModelItem *pParentItem;
    1099 
     1096void UIApplianceModel::restoreDefaults(QModelIndex parentIdx /* = QModelIndex() */)
     1097{
     1098    /* By default use the root: */
    11001099    if (!parentIdx.isValid())
    1101         pParentItem = 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());
    11051104    for (int i = 0; i < pParentItem->childCount(); ++i)
    11061105    {
     1106        /* Reset children item data to default: */
    11071107        pParentItem->childItem(i)->restoreDefaults();
     1108        /* Recursively process children item: */
    11081109        restoreDefaults(index(i, 0, parentIdx));
    11091110    }
    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));
    11111113}
    11121114
  • trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIApplianceEditorWidget.h

    r64748 r65578  
    9797
    9898    /** 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());
    100100
    101101    /** Cache currently stored values. */
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette