VirtualBox

Changeset 63895 in vbox


Ignore:
Timestamp:
Sep 19, 2016 4:07:41 PM (8 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
110769
Message:

FE/Qt: bugref:6899: Accessibility support (step 37): Selector UI: Extend Snapshot item with the additional API required to be visible by the accessibility interface.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/UISnapshotPane.cpp

    r63894 r63895  
    5555
    5656/** QTreeWidgetItem subclass for snapshots items. */
    57 class UISnapshotItem : public QTreeWidgetItem
    58 {
     57class UISnapshotItem : public QObject, public QTreeWidgetItem
     58{
     59    Q_OBJECT;
     60
    5961public:
    6062
     
    7981    QString snapshotID() const { return m_strSnapshotID; }
    8082
     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
    8190    /** Returns item data for corresponding @a iColumn and @a iRole. */
    8291    QVariant data(int iColumn, int iRole) const;
     
    206215    /* Fetch current machine state: */
    207216    updateCurrentState(m_comMachine.GetState());
     217}
     218
     219UISnapshotTree *UISnapshotItem::parentSnapshotTree() const
     220{
     221    /* Return the parent snapshot tree if any: */
     222    return treeWidget() ? qobject_cast<UISnapshotTree*>(treeWidget()) : 0;
     223}
     224
     225UISnapshotItem *UISnapshotItem::parentSnapshotItem() const
     226{
     227    /* Return the parent snapshot item if any: */
     228    return QTreeWidgetItem::parent() ? UISnapshotPane::toSnapshotItem(QTreeWidgetItem::parent()) : 0;
     229}
     230
     231UISnapshotItem *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;
    208235}
    209236
     
    308335        m_strDesc = m_fCurrentStateModified ?
    309336                    UISnapshotPane::tr("The current state differs from the state stored in the current snapshot") :
    310                     parent() != 0 ?
     337                    QTreeWidgetItem::parent() != 0 ?
    311338                    UISnapshotPane::tr("The current state is identical to the state stored in the current snapshot") :
    312339                    QString();
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