CLinkModel: Make use of in-class initializers where applicable

This commit is contained in:
Lioncash 2020-06-28 04:04:47 -04:00
parent 48bef1f346
commit 28e6efb060
2 changed files with 8 additions and 9 deletions

View File

@ -5,8 +5,6 @@
CLinkModel::CLinkModel(QObject *pParent)
: QAbstractTableModel(pParent)
, mpObject(nullptr)
, mType(ELinkType::Outgoing)
{
}

View File

@ -8,17 +8,18 @@ class CLinkModel : public QAbstractTableModel
{
Q_OBJECT
CScriptObject *mpObject;
ELinkType mType;
CScriptObject *mpObject = nullptr;
ELinkType mType{ELinkType::Outgoing};
public:
explicit CLinkModel(QObject *pParent = 0);
explicit CLinkModel(QObject *pParent = nullptr);
void SetObject(CScriptObject *pObj);
void SetConnectionType(ELinkType Type);
int rowCount(const QModelIndex& rkParent = QModelIndex()) const;
int columnCount(const QModelIndex& rkParent) const;
QVariant data(const QModelIndex& rkIndex, int Role) const;
QVariant headerData(int Section, Qt::Orientation Orientation, int Role) const;
int rowCount(const QModelIndex& rkParent = QModelIndex()) const override;
int columnCount(const QModelIndex& rkParent) const override;
QVariant data(const QModelIndex& rkIndex, int Role) const override;
QVariant headerData(int Section, Qt::Orientation Orientation, int Role) const override;
};
#endif // CCONNECTIONMODEL_H