Skip to content

Commit

Permalink
Gui: do not change property view editing content
Browse files Browse the repository at this point in the history
Fixes #896
  • Loading branch information
realthunder committed Oct 28, 2023
1 parent 3b9196b commit 4b62826
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Gui/propertyeditor/PropertyItemDelegate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,8 @@ QWidget * PropertyItemDelegate::createEditor (QWidget * parent, const QStyleOpti
if(parentEditor)
parentEditor->closeEditor();

editingInited = false;

if (childItem->isSeparator())
return nullptr;

Expand Down Expand Up @@ -242,8 +244,9 @@ void PropertyItemDelegate::valueChanged()

void PropertyItemDelegate::setEditorData(QWidget *editor, const QModelIndex &index) const
{
if (!index.isValid())
if (!index.isValid() || editingInited)
return;
editingInited = true;
QVariant data = index.data(Qt::EditRole);
auto childItem = static_cast<PropertyItem*>(index.internalPointer());
editor->blockSignals(true);
Expand Down
1 change: 1 addition & 0 deletions src/Gui/propertyeditor/PropertyItemDelegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ public Q_SLOTS:
mutable PropertyEditorWidget *userEditor = nullptr;
mutable bool pressed;
bool changed;
mutable bool editingInited = false;
};

} // namespace PropertyEditor
Expand Down

0 comments on commit 4b62826

Please sign in to comment.