VirtualBox

Changeset 64695 in vbox


Ignore:
Timestamp:
Nov 17, 2016 5:31:09 PM (8 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:6899: Accessibility support (step 135): A bit more refactoring for UIApplianceEditorWidget.

Location:
trunk/src/VBox/Frontends/VirtualBox/src/widgets
Files:
2 edited

Legend:

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

    r64692 r64695  
    124124
    125125    /** Returns the data stored under the given @a iRole for the item referred to by the @a iColumn. */
    126     virtual QVariant data(int iColumn, int iRole) const;
     126    virtual QVariant data(int iColumn, int iRole) const /* override */;
    127127
    128128    /** Cache currently stored values, such as @a finalStates, @a finalValues and @a finalExtraValues. */
    129     virtual void putBack(QVector<BOOL> &finalStates, QVector<QString> &finalValues, QVector<QString> &finalExtraValues);
     129    virtual void putBack(QVector<BOOL> &finalStates, QVector<QString> &finalValues, QVector<QString> &finalExtraValues) /* override */;
    130130
    131131private:
    132132
    133133    /** Holds the Virtual System Description. */
    134     CVirtualSystemDescription m_comDescription;
     134    CVirtualSystemDescription  m_comDescription;
    135135};
    136136
     
    165165
    166166    /** Returns the item flags for the given @a iColumn. */
    167     virtual Qt::ItemFlags itemFlags(int iColumn) const;
     167    virtual Qt::ItemFlags itemFlags(int iColumn) const /* override */;
    168168
    169169    /** Defines the @a iRole data for the item at @a iColumn to @a value. */
    170     virtual bool setData(int iColumn, const QVariant &value, int iRole);
     170    virtual bool setData(int iColumn, const QVariant &value, int iRole) /* override */;
    171171    /** Returns the data stored under the given @a iRole for the item referred to by the @a iColumn. */
    172     virtual QVariant data(int iColumn, int iRole) const;
     172    virtual QVariant data(int iColumn, int iRole) const /* override */;
    173173
    174174    /** Returns the widget used to edit the item specified by @a idx for editing.
    175175      * @param  pParent      Brings the parent to be assigned for newly created editor.
    176176      * @param  styleOption  Bring the style option set for the newly created editor. */
    177     virtual QWidget *createEditor(QWidget *pParent, const QStyleOptionViewItem &styleOption, const QModelIndex &idx) const;
     177    virtual QWidget *createEditor(QWidget *pParent, const QStyleOptionViewItem &styleOption, const QModelIndex &idx) const /* override */;
    178178
    179179    /** Defines the contents of the given @a pEditor to the data for the item at the given @a idx. */
    180     virtual bool setEditorData(QWidget *pEditor, const QModelIndex &idx) const;
     180    virtual bool setEditorData(QWidget *pEditor, const QModelIndex &idx) const /* override */;
    181181    /** Defines the data for the item at the given @a idx in the @a pModel to the contents of the given @a pEditor. */
    182     virtual bool setModelData(QWidget *pEditor, QAbstractItemModel *pModel, const QModelIndex &idx);
     182    virtual bool setModelData(QWidget *pEditor, QAbstractItemModel *pModel, const QModelIndex &idx) /* override */;
    183183
    184184    /** Restores the default values. */
    185     virtual void restoreDefaults();
     185    virtual void restoreDefaults() /* override */;
    186186
    187187    /** Cache currently stored values, such as @a finalStates, @a finalValues and @a finalExtraValues. */
    188     virtual void putBack(QVector<BOOL> &finalStates, QVector<QString> &finalValues, QVector<QString> &finalExtraValues);
     188    virtual void putBack(QVector<BOOL> &finalStates, QVector<QString> &finalValues, QVector<QString> &finalExtraValues) /* override */;
    189189
    190190private:
    191191
    192192    /** Holds the Virtual System Description type. */
    193     KVirtualSystemDescriptionType m_enmType;
     193    KVirtualSystemDescriptionType  m_enmType;
    194194    /** Holds something totally useless. */
    195     QString                       m_strRef;
     195    QString                        m_strRef;
    196196    /** Holds the original value. */
    197     QString                       m_strOrigValue;
     197    QString                        m_strOrigValue;
    198198    /** Holds the configuration value. */
    199     QString                       m_strConfigValue;
     199    QString                        m_strConfigValue;
    200200    /** Holds the default configuration value. */
    201     QString                       m_strConfigDefaultValue;
     201    QString                        m_strConfigDefaultValue;
    202202    /** Holds the extra configuration value. */
    203     QString                       m_strExtraConfigValue;
     203    QString                        m_strExtraConfigValue;
    204204    /** Holds the item check state. */
    205     Qt::CheckState                m_checkState;
     205    Qt::CheckState                 m_checkState;
    206206    /** Holds whether item was modified. */
    207     bool                          m_fModified;
     207    bool                           m_fModified;
    208208};
    209209
     
    12941294
    12951295/* static */
    1296 int UIApplianceEditorWidget::m_minGuestRAM      = -1;
    1297 int UIApplianceEditorWidget::m_maxGuestRAM      = -1;
     1296int UIApplianceEditorWidget::m_minGuestRAM = -1;
     1297int UIApplianceEditorWidget::m_maxGuestRAM = -1;
    12981298int UIApplianceEditorWidget::m_minGuestCPUCount = -1;
    12991299int UIApplianceEditorWidget::m_maxGuestCPUCount = -1;
  • trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIApplianceEditorWidget.h

    r64692 r64695  
    6161class UIApplianceModel : public QAbstractItemModel
    6262{
     63    Q_OBJECT;
     64
    6365public:
    6466
     
    7072
    7173    /** Returns the index of the item in the model specified by the given @a iRow, @a iColumn and @a parentIdx. */
    72     QModelIndex index(int iRow, int iColumn, const QModelIndex &parentIdx = QModelIndex()) const;
     74    virtual QModelIndex index(int iRow, int iColumn, const QModelIndex &parentIdx = QModelIndex()) const /* override */;
    7375    /** Returns the parent of the model item with the given @a idx. */
    74     QModelIndex parent(const QModelIndex &idx) const;
     76    virtual QModelIndex parent(const QModelIndex &idx) const /* override */;
    7577
    7678    /** Returns the number of rows for the children of the given @a parentIdx. */
    77     int rowCount(const QModelIndex &parentIdx = QModelIndex()) const;
     79    virtual int rowCount(const QModelIndex &parentIdx = QModelIndex()) const /* override */;
    7880    /** Returns the number of columns for the children of the given @a parentIdx. */
    79     int columnCount(const QModelIndex &parentIdx = QModelIndex()) const;
     81    virtual int columnCount(const QModelIndex &parentIdx = QModelIndex()) const /* override */;
    8082
    8183    /** Returns the item flags for the given @a idx. */
    82     Qt::ItemFlags flags(const QModelIndex &idx) const;
     84    virtual Qt::ItemFlags flags(const QModelIndex &idx) const /* override */;
    8385    /** Returns the data for the given @a iRole and @a iSection in the header with the specified @a enmOrientation. */
    84     QVariant headerData(int iSection, Qt::Orientation enmOrientation, int iRole) const;
     86    virtual QVariant headerData(int iSection, Qt::Orientation enmOrientation, int iRole) const /* override */;
    8587
    8688    /** Defines the @a iRole data for the item at @a idx to @a value. */
    87     bool setData(const QModelIndex &idx, const QVariant &value, int iRole);
     89    virtual bool setData(const QModelIndex &idx, const QVariant &value, int iRole) /* override */;
    8890    /** Returns the data stored under the given @a iRole for the item referred to by the @a idx. */
    89     QVariant data(const QModelIndex &idx, int iRole = Qt::DisplayRole) const;
     91    virtual QVariant data(const QModelIndex &idx, int iRole = Qt::DisplayRole) const /* override */;
    9092
    9193    /** Returns a model index for the buddy of the item represented by @a idx. */
    92     QModelIndex buddy(const QModelIndex &idx) const;
     94    virtual QModelIndex buddy(const QModelIndex &idx) const /* override */;
    9395
    9496    /** Restores the default values for the item with the given @a parentIdx. */
     
    108110class UIApplianceDelegate : public QItemDelegate
    109111{
     112    Q_OBJECT;
     113
    110114public:
    111115
     
    117121      * @param  pParent      Brings the parent to be assigned for newly created editor.
    118122      * @param  styleOption  Bring the style option set for the newly created editor. */
    119     QWidget *createEditor(QWidget *pParent, const QStyleOptionViewItem &styleOption, const QModelIndex &idx) const;
     123    virtual QWidget *createEditor(QWidget *pParent, const QStyleOptionViewItem &styleOption, const QModelIndex &idx) const /* override */;
    120124
    121125    /** Defines the contents of the given @a pEditor to the data for the item at the given @a idx. */
    122     void setEditorData(QWidget *pEditor, const QModelIndex &idx) const;
     126    virtual void setEditorData(QWidget *pEditor, const QModelIndex &idx) const /* override */;
    123127    /** Defines the data for the item at the given @a idx in the @a pModel to the contents of the given @a pEditor. */
    124     void setModelData(QWidget *pEditor, QAbstractItemModel *pModel, const QModelIndex &idx) const;
     128    virtual void setModelData(QWidget *pEditor, QAbstractItemModel *pModel, const QModelIndex &idx) const /* override */;
    125129
    126130    /** Updates the geometry of the @a pEditor for the item with the given @a idx, according to the rectangle specified in the @a styleOption. */
    127     void updateEditorGeometry(QWidget *pEditor, const QStyleOptionViewItem &styleOption, const QModelIndex &idx) const;
     131    virtual void updateEditorGeometry(QWidget *pEditor, const QStyleOptionViewItem &styleOption, const QModelIndex &idx) const /* override */;
    128132
    129133    /** Returns the size hint for the item at the given @a idx and specified @a styleOption. */
    130     QSize sizeHint(const QStyleOptionViewItem &styleOption, const QModelIndex &idx) const;
     134    virtual QSize sizeHint(const QStyleOptionViewItem &styleOption, const QModelIndex &idx) const /* override */;
    131135
    132136protected:
     
    134138#ifdef VBOX_WS_MAC
    135139    /** Filters @a pEvent if this object has been installed as an event filter for the watched @a pObject. */
    136     bool eventFilter(QObject *pObject, QEvent *pEvent);
     140    virtual bool eventFilter(QObject *pObject, QEvent *pEvent) /* override */;
    137141#endif
    138142
     
    147151class UIApplianceSortProxyModel : public QSortFilterProxyModel
    148152{
     153    Q_OBJECT;
     154
    149155public:
    150156
     
    155161
    156162    /** Returns whether item in the row indicated by the given @a iSourceRow and @a srcParenIdx should be included in the model. */
    157     bool filterAcceptsRow(int iSourceRow, const QModelIndex &srcParenIdx) const;
     163    virtual bool filterAcceptsRow(int iSourceRow, const QModelIndex &srcParenIdx) const /* override */;
    158164
    159165    /** Returns whether value of the item referred to by the given index @a leftIdx is less
    160166      * than the value of the item referred to by the given index @a rightIdx. */
    161     bool lessThan(const QModelIndex &leftIdx, const QModelIndex &rightIdx) const;
     167    virtual bool lessThan(const QModelIndex &leftIdx, const QModelIndex &rightIdx) const /* override */;
    162168
    163169    /** Holds the array of sorted Virtual System Description types. */
     
    201207
    202208    /** Handles translation event. */
    203     virtual void retranslateUi();
     209    virtual void retranslateUi() /* override */;
    204210
    205211    /** Holds the currently set appliance reference. */
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