CPropertyDelegate: Make use of in-class initializers where applicable

This commit is contained in:
Lioncash 2020-06-28 04:45:03 -04:00
parent d6752c2468
commit e5e2b4be1a
2 changed files with 12 additions and 16 deletions

View File

@ -26,13 +26,8 @@
connect(pRelay, SIGNAL(WidgetEdited(QWidget*, const QModelIndex&)), this, SLOT(WidgetEdited(QWidget*, const QModelIndex&))); \
}
CPropertyDelegate::CPropertyDelegate(QObject* pParent /*= 0*/)
CPropertyDelegate::CPropertyDelegate(QObject* pParent)
: QStyledItemDelegate(pParent)
, mpEditor(nullptr)
, mpModel(nullptr)
, mInRelayWidgetEdit(false)
, mEditInProgress(false)
, mRelaysBlocked(false)
{
mpEditor = UICommon::FindAncestor<IEditor>(pParent);
}

View File

@ -9,21 +9,22 @@ class CPropertyDelegate : public QStyledItemDelegate
{
Q_OBJECT
IEditor* mpEditor;
CPropertyModel* mpModel;
bool mInRelayWidgetEdit;
mutable bool mEditInProgress;
mutable bool mRelaysBlocked;
IEditor* mpEditor = nullptr;
CPropertyModel* mpModel = nullptr;
bool mInRelayWidgetEdit = false;
mutable bool mEditInProgress = false;
mutable bool mRelaysBlocked = false;
public:
CPropertyDelegate(QObject* pParent = 0);
explicit CPropertyDelegate(QObject* pParent = nullptr);
void SetEditor(IEditor* pEditor);
void SetPropertyModel(CPropertyModel* pModel);
virtual QWidget* createEditor(QWidget* pParent, const QStyleOptionViewItem& rkOption, const QModelIndex& rkIndex) const;
virtual void setEditorData(QWidget* pEditor, const QModelIndex& rkIndex) const;
virtual void setModelData(QWidget* pEditor, QAbstractItemModel* pModel, const QModelIndex& rkIndex) const;
bool eventFilter(QObject* pObject, QEvent* pEvent);
QWidget* createEditor(QWidget* pParent, const QStyleOptionViewItem& rkOption, const QModelIndex& rkIndex) const override;
void setEditorData(QWidget* pEditor, const QModelIndex& rkIndex) const override;
void setModelData(QWidget* pEditor, QAbstractItemModel* pModel, const QModelIndex& rkIndex) const override;
bool eventFilter(QObject* pObject, QEvent* pEvent) override;
QWidget* CreateCharacterEditor(QWidget* pParent, const QModelIndex& rkIndex) const;
void SetCharacterEditorData(QWidget* pEditor, const QModelIndex& rkIndex) const;