Open property editor on single click, fix for sub-value edits

This commit is contained in:
parax0 2016-01-31 14:48:29 -07:00
parent f6f36f4f2e
commit 7a28db3d40
2 changed files with 3 additions and 2 deletions

View File

@ -451,8 +451,8 @@ void CPropertyDelegate::setModelData(QWidget *pEditor, QAbstractItemModel* /*pMo
{ {
pProp = mpModel->PropertyForIndex(rkIndex, true); pProp = mpModel->PropertyForIndex(rkIndex, true);
IPropertyValue *pOldValue = pProp->RawValue(); IPropertyValue *pRawValue = pProp->RawValue();
pOldValue = pOldValue ? pOldValue->Clone() : nullptr; pOldValue = pRawValue ? pRawValue->Clone() : nullptr;
if (pProp->Type() == eCharacterProperty) if (pProp->Type() == eCharacterProperty)
SetCharacterModelData(pEditor, rkIndex); SetCharacterModelData(pEditor, rkIndex);

View File

@ -15,6 +15,7 @@ CPropertyView::CPropertyView(QWidget *pParent)
setModel(mpModel); setModel(mpModel);
connect(this, SIGNAL(expanded(QModelIndex)), this, SLOT(SetPersistentEditors(QModelIndex))); connect(this, SIGNAL(expanded(QModelIndex)), this, SLOT(SetPersistentEditors(QModelIndex)));
connect(this, SIGNAL(clicked(QModelIndex)), this, SLOT(edit(QModelIndex)));
connect(mpModel, SIGNAL(rowsInserted(QModelIndex,int,int)), this, SLOT(SetPersistentEditors(QModelIndex))); connect(mpModel, SIGNAL(rowsInserted(QModelIndex,int,int)), this, SLOT(SetPersistentEditors(QModelIndex)));
connect(mpModel, SIGNAL(PropertyModified(QModelIndex)), this, SLOT(OnPropertyModified(QModelIndex))); connect(mpModel, SIGNAL(PropertyModified(QModelIndex)), this, SLOT(OnPropertyModified(QModelIndex)));
} }