VirtualBox

Changeset 81683 in vbox


Ignore:
Timestamp:
Nov 5, 2019 7:09:02 PM (5 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:9601: Since we are filtering UIFormEditorView, it is actually using UIFormEditorProxyModel, not UIFormEditorModel as was designed before, so implementing corresponding proxy mapping for accessibility interface stuff is required.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIFormEditorWidget.cpp

    r81326 r81683  
    483483    /** Constructs the Form Editor proxy-model passing @a pParent to the base-class. */
    484484    UIFormEditorProxyModel(QObject *pParent = 0);
     485
     486    /** Returns the number of children. */
     487    int childCount() const;
     488    /** Returns the child item with @a iIndex. */
     489    QITableViewRow *childItem(int iIndex) const;
    485490
    486491protected:
     
    13501355}
    13511356
     1357int UIFormEditorProxyModel::childCount() const
     1358{
     1359    return rowCount();
     1360}
     1361
     1362QITableViewRow *UIFormEditorProxyModel::childItem(int iIndex) const
     1363{
     1364    /* Make sure iIndex within the bounds: */
     1365    AssertReturn(iIndex >= 0 && iIndex < rowCount(), 0);
     1366    /* Acquire actual index of source model: */
     1367    const QModelIndex i = sourceModel()->index(iIndex, 0);
     1368    AssertReturn(i.isValid(), 0);
     1369    /* Get packed item pointer: */
     1370    UIFormEditorRow *pItem = static_cast<UIFormEditorRow*>(i.internalPointer());
     1371    AssertReturn(pItem, 0);
     1372    return pItem;
     1373}
     1374
    13521375bool UIFormEditorProxyModel::filterAcceptsRow(int iSourceRow, const QModelIndex &sourceParent) const
    13531376{
     
    13801403    /* Redirect request to model: */
    13811404    AssertPtrReturn(model(), 0);
    1382     return qobject_cast<UIFormEditorModel*>(model())->childCount();
     1405    return qobject_cast<UIFormEditorProxyModel*>(model())->childCount();
    13831406}
    13841407
     
    13871410    /* Redirect request to model: */
    13881411    AssertPtrReturn(model(), 0);
    1389     return qobject_cast<UIFormEditorModel*>(model())->childItem(iIndex);
     1412    return qobject_cast<UIFormEditorProxyModel*>(model())->childItem(iIndex);
    13901413}
    13911414
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