VirtualBox

Changeset 105061 in vbox


Ignore:
Timestamp:
Jun 27, 2024 1:27:11 PM (9 months ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
163680
Message:

FE/Qt: bugref:10681: UIShortcutConfigurationEditor: Extend the model with proper index() method providing third parties with table row access pointer; That is used by the accessibility interfaces for example.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/editors/UIShortcutConfigurationEditor.cpp

    r105060 r105061  
    217217    bool isAllShortcutsUnique();
    218218
     219    /** Returns the index of the item in the model specified by the given @a iRow, @a iColumn and @a parentIdx index. */
     220    virtual QModelIndex index(int iRow, int iColumn, const QModelIndex &parentIdx = QModelIndex()) const RT_OVERRIDE RT_FINAL;
     221
    219222    /** Returns the item flags for the given @a index. */
    220223    virtual Qt::ItemFlags flags(const QModelIndex &index) const RT_OVERRIDE RT_FINAL;
     
    416419    /* True by default: */
    417420    return true;
     421}
     422
     423QModelIndex UIShortcutConfigurationModel::index(int iRow, int iColumn, const QModelIndex &parentIdx /* = QModelIndex() */) const
     424{
     425    /* No index for unknown items: */
     426    if (!hasIndex(iRow, iColumn, parentIdx))
     427        return QModelIndex();
     428
     429    /* Provide index users with packed item pointer: */
     430    UIShortcutTableViewRow *pItem = iRow >= 0 && iRow < m_shortcuts.size() ? m_shortcuts.at(iRow) : 0;
     431    return pItem ? createIndex(iRow, iColumn, pItem) : QModelIndex();
    418432}
    419433
Note: See TracChangeset for help on using the changeset viewer.

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