From 7a28db3d40b7031e6afe0e45a3d9cc584bee94cb Mon Sep 17 00:00:00 2001 From: parax0 Date: Sun, 31 Jan 2016 14:48:29 -0700 Subject: [PATCH] Open property editor on single click, fix for sub-value edits --- src/Editor/PropertyEdit/CPropertyDelegate.cpp | 4 ++-- src/Editor/PropertyEdit/CPropertyView.cpp | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Editor/PropertyEdit/CPropertyDelegate.cpp b/src/Editor/PropertyEdit/CPropertyDelegate.cpp index 44925167..3f6b9333 100644 --- a/src/Editor/PropertyEdit/CPropertyDelegate.cpp +++ b/src/Editor/PropertyEdit/CPropertyDelegate.cpp @@ -451,8 +451,8 @@ void CPropertyDelegate::setModelData(QWidget *pEditor, QAbstractItemModel* /*pMo { pProp = mpModel->PropertyForIndex(rkIndex, true); - IPropertyValue *pOldValue = pProp->RawValue(); - pOldValue = pOldValue ? pOldValue->Clone() : nullptr; + IPropertyValue *pRawValue = pProp->RawValue(); + pOldValue = pRawValue ? pRawValue->Clone() : nullptr; if (pProp->Type() == eCharacterProperty) SetCharacterModelData(pEditor, rkIndex); diff --git a/src/Editor/PropertyEdit/CPropertyView.cpp b/src/Editor/PropertyEdit/CPropertyView.cpp index b61e17a0..7d226d5a 100644 --- a/src/Editor/PropertyEdit/CPropertyView.cpp +++ b/src/Editor/PropertyEdit/CPropertyView.cpp @@ -15,6 +15,7 @@ CPropertyView::CPropertyView(QWidget *pParent) setModel(mpModel); 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(PropertyModified(QModelIndex)), this, SLOT(OnPropertyModified(QModelIndex))); }