VirtualBox

Changeset 64228 in vbox


Ignore:
Timestamp:
Oct 12, 2016 5:48:34 PM (8 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
111237
Message:

FE/Qt: bugref:6899: Accessibility support (step 81): Extend QITableView with API allowing to make table rows and cells accessible.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/extensions/QITableView.h

    r64178 r64228  
    2222#include <QTableView>
    2323
     24/* Forward declarations: */
     25class QITableViewCell;
     26class QITableViewRow;
     27class QITableView;
     28
     29
     30/** OObject subclass used as cell for the QITableView. */
     31class QITableViewCell : public QObject
     32{
     33    Q_OBJECT;
     34
     35public:
     36
     37    /** Constructs table-view cell for passed @a pParent. */
     38    QITableViewCell(QITableViewRow *pParent)
     39        : m_pRow(pParent)
     40    {}
     41
     42    /** Defines the parent @a pRow reference. */
     43    void setRow(QITableViewRow *pRow) { m_pRow = pRow; }
     44    /** Returns the parent row reference. */
     45    QITableViewRow *row() const { return m_pRow; }
     46
     47    /** Returns the cell text. */
     48    virtual QString text() const = 0;
     49
     50private:
     51
     52    /** Holds the parent row reference. */
     53    QITableViewRow *m_pRow;
     54};
     55
     56
     57/** OObject subclass used as row for the QITableView. */
     58class QITableViewRow : public QObject
     59{
     60    Q_OBJECT;
     61
     62public:
     63
     64    /** Constructs table-view row for passed @a pParent. */
     65    QITableViewRow(QITableView *pParent)
     66        : m_pTable(pParent)
     67    {}
     68
     69    /** Defines the parent @a pTable reference. */
     70    void setTable(QITableView *pTable) { m_pTable = pTable; }
     71    /** Returns the parent table reference. */
     72    QITableView *table() const { return m_pTable; }
     73
     74    /** Returns the number of children. */
     75    virtual int childCount() const = 0;
     76    /** Returns the child item with @a iIndex. */
     77    virtual QITableViewCell *childItem(int iIndex) const = 0;
     78
     79private:
     80
     81    /** Holds the parent table reference. */
     82    QITableView *m_pTable;
     83};
     84
    2485
    2586/** QTableView subclass extending standard functionality. */
     
    3798    /** Constructs table-view passing @a pParent to the base-class. */
    3899    QITableView(QWidget *pParent = 0);
     100
     101    /** Returns the number of children. */
     102    virtual int childCount() const { return 0; }
     103    /** Returns the child item with @a iIndex. */
     104    virtual QITableViewRow *childItem(int iIndex) const { Q_UNUSED(iIndex); return 0; }
    39105
    40106    /** Makes sure current editor data committed. */
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