mirror of
https://github.com/AxioDL/PrimeWorldEditor.git
synced 2025-07-05 04:35:53 +00:00
CPropertyDelegate: Make use of in-class initializers where applicable
This commit is contained in:
parent
d6752c2468
commit
e5e2b4be1a
@ -26,13 +26,8 @@
|
|||||||
connect(pRelay, SIGNAL(WidgetEdited(QWidget*, const QModelIndex&)), this, SLOT(WidgetEdited(QWidget*, const QModelIndex&))); \
|
connect(pRelay, SIGNAL(WidgetEdited(QWidget*, const QModelIndex&)), this, SLOT(WidgetEdited(QWidget*, const QModelIndex&))); \
|
||||||
}
|
}
|
||||||
|
|
||||||
CPropertyDelegate::CPropertyDelegate(QObject* pParent /*= 0*/)
|
CPropertyDelegate::CPropertyDelegate(QObject* pParent)
|
||||||
: QStyledItemDelegate(pParent)
|
: QStyledItemDelegate(pParent)
|
||||||
, mpEditor(nullptr)
|
|
||||||
, mpModel(nullptr)
|
|
||||||
, mInRelayWidgetEdit(false)
|
|
||||||
, mEditInProgress(false)
|
|
||||||
, mRelaysBlocked(false)
|
|
||||||
{
|
{
|
||||||
mpEditor = UICommon::FindAncestor<IEditor>(pParent);
|
mpEditor = UICommon::FindAncestor<IEditor>(pParent);
|
||||||
}
|
}
|
||||||
|
@ -9,21 +9,22 @@ class CPropertyDelegate : public QStyledItemDelegate
|
|||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
IEditor* mpEditor;
|
IEditor* mpEditor = nullptr;
|
||||||
CPropertyModel* mpModel;
|
CPropertyModel* mpModel = nullptr;
|
||||||
bool mInRelayWidgetEdit;
|
bool mInRelayWidgetEdit = false;
|
||||||
mutable bool mEditInProgress;
|
mutable bool mEditInProgress = false;
|
||||||
mutable bool mRelaysBlocked;
|
mutable bool mRelaysBlocked = false;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
CPropertyDelegate(QObject* pParent = 0);
|
explicit CPropertyDelegate(QObject* pParent = nullptr);
|
||||||
|
|
||||||
void SetEditor(IEditor* pEditor);
|
void SetEditor(IEditor* pEditor);
|
||||||
void SetPropertyModel(CPropertyModel* pModel);
|
void SetPropertyModel(CPropertyModel* pModel);
|
||||||
|
|
||||||
virtual QWidget* createEditor(QWidget* pParent, const QStyleOptionViewItem& rkOption, const QModelIndex& rkIndex) const;
|
QWidget* createEditor(QWidget* pParent, const QStyleOptionViewItem& rkOption, const QModelIndex& rkIndex) const override;
|
||||||
virtual void setEditorData(QWidget* pEditor, const QModelIndex& rkIndex) const;
|
void setEditorData(QWidget* pEditor, const QModelIndex& rkIndex) const override;
|
||||||
virtual void setModelData(QWidget* pEditor, QAbstractItemModel* pModel, const QModelIndex& rkIndex) const;
|
void setModelData(QWidget* pEditor, QAbstractItemModel* pModel, const QModelIndex& rkIndex) const override;
|
||||||
bool eventFilter(QObject* pObject, QEvent* pEvent);
|
bool eventFilter(QObject* pObject, QEvent* pEvent) override;
|
||||||
|
|
||||||
QWidget* CreateCharacterEditor(QWidget* pParent, const QModelIndex& rkIndex) const;
|
QWidget* CreateCharacterEditor(QWidget* pParent, const QModelIndex& rkIndex) const;
|
||||||
void SetCharacterEditorData(QWidget* pEditor, const QModelIndex& rkIndex) const;
|
void SetCharacterEditorData(QWidget* pEditor, const QModelIndex& rkIndex) const;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user