VirtualBox

Changeset 78247 in vbox for trunk


Ignore:
Timestamp:
Apr 22, 2019 11:57:15 AM (6 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:9434: Import Appliance wizard: Form Editor widget: A bit of cleanup (coding-style + reordering, no other changes).

File:
1 edited

Legend:

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

    r78246 r78247  
    230230
    231231    /** Returns flags for item with certain @a index. */
    232     Qt::ItemFlags flags(const QModelIndex &index) const;
     232    virtual Qt::ItemFlags flags(const QModelIndex &index) const /* override */;
    233233
    234234    /** Returns row count of certain @a parent. */
    235     int rowCount(const QModelIndex &parent = QModelIndex()) const;
    236 
     235    virtual int rowCount(const QModelIndex &parent = QModelIndex()) const /* override */;
    237236    /** Returns column count of certain @a parent. */
    238     int columnCount(const QModelIndex &parent = QModelIndex()) const;
     237    virtual int columnCount(const QModelIndex &parent = QModelIndex()) const /* override */;
    239238
    240239    /** Returns header data for @a iSection, @a enmOrientation and @a iRole specified. */
    241     QVariant headerData(int iSection, Qt::Orientation enmOrientation, int iRole) const;
     240    virtual QVariant headerData(int iSection, Qt::Orientation enmOrientation, int iRole) const /* override */;
    242241
    243242    /** Defines the @a iRole data for item with @a index as @a value. */
    244     bool setData(const QModelIndex &index, const QVariant &value, int iRole = Qt::EditRole);
     243    virtual bool setData(const QModelIndex &index, const QVariant &value, int iRole = Qt::EditRole) /* override */;
    245244    /** Returns the @a iRole data for item with @a index. */
    246     QVariant data(const QModelIndex &index, int iRole) const;
     245    virtual QVariant data(const QModelIndex &index, int iRole) const /* override */;
    247246
    248247private:
     
    256255    /** Holds the Form Editor row list. */
    257256    QList<UIFormEditorRow*>  m_dataList;
     257};
     258
     259
     260/** QSortFilterProxyModel subclass used as the Form Editor proxy-model. */
     261class UIFormEditorProxyModel : public QSortFilterProxyModel
     262{
     263    Q_OBJECT;
     264
     265public:
     266
     267    /** Constructs the Form Editor proxy-model passing @a pParent to the base-class. */
     268    UIFormEditorProxyModel(QObject *pParent = 0);
     269
     270protected:
     271
     272    /** Returns whether item in the row indicated by the given @a iSourceRow and @a srcParenIdx should be included in the model. */
     273    virtual bool filterAcceptsRow(int iSourceRow, const QModelIndex &srcParenIdx) const /* override */;
    258274};
    259275
     
    275291    /** Returns the child item with @a iIndex. */
    276292    virtual QITableViewRow *childItem(int iIndex) const /* override */;
    277 };
    278 
    279 
    280 /** QSortFilterProxyModel subclass used as the Form Editor proxy-model. */
    281 class UIFormEditorProxyModel : public QSortFilterProxyModel
    282 {
    283     Q_OBJECT;
    284 
    285 public:
    286 
    287     /** Constructs the Form Editor proxy-model passing @a pParent to the base-class. */
    288     UIFormEditorProxyModel(QObject *pParent = 0);
    289 
    290 protected:
    291 
    292     /** Returns whether item in the row indicated by the given @a iSourceRow and @a srcParenIdx should be included in the model. */
    293     virtual bool filterAcceptsRow(int iSourceRow, const QModelIndex &srcParenIdx) const /* override */;
    294293};
    295294
     
    780779
    781780/*********************************************************************************************************************************
    782 *   Class UIFormEditorView implementation.                                                                                       *
    783 *********************************************************************************************************************************/
    784 
    785 UIFormEditorView::UIFormEditorView(QWidget * /* pParent = 0 */)
    786 {
    787 }
    788 
    789 int UIFormEditorView::childCount() const
    790 {
    791     /* Redirect request to model: */
    792     AssertPtrReturn(model(), 0);
    793     return qobject_cast<UIFormEditorModel*>(model())->childCount();
    794 }
    795 
    796 QITableViewRow *UIFormEditorView::childItem(int iIndex) const
    797 {
    798     /* Redirect request to model: */
    799     AssertPtrReturn(model(), 0);
    800     return qobject_cast<UIFormEditorModel*>(model())->childItem(iIndex);
    801 }
    802 
    803 
    804 /*********************************************************************************************************************************
    805781*   Class UIFormEditorProxyModel implementation.                                                                                 *
    806782*********************************************************************************************************************************/
     
    824800    }
    825801    return true;
     802}
     803
     804
     805/*********************************************************************************************************************************
     806*   Class UIFormEditorView implementation.                                                                                       *
     807*********************************************************************************************************************************/
     808
     809UIFormEditorView::UIFormEditorView(QWidget * /* pParent = 0 */)
     810{
     811}
     812
     813int UIFormEditorView::childCount() const
     814{
     815    /* Redirect request to model: */
     816    AssertPtrReturn(model(), 0);
     817    return qobject_cast<UIFormEditorModel*>(model())->childCount();
     818}
     819
     820QITableViewRow *UIFormEditorView::childItem(int iIndex) const
     821{
     822    /* Redirect request to model: */
     823    AssertPtrReturn(model(), 0);
     824    return qobject_cast<UIFormEditorModel*>(model())->childItem(iIndex);
    826825}
    827826
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