From a9f5c120e820d7b3eaf33ba836bdf6fa0581bfcc Mon Sep 17 00:00:00 2001 From: wmayer Date: Wed, 8 May 2013 15:07:46 +0200 Subject: [PATCH] Save position of last edited property item and restore it when selection changes --- src/Gui/propertyeditor/PropertyEditor.cpp | 6 ++++-- src/Gui/propertyeditor/PropertyEditor.h | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Gui/propertyeditor/PropertyEditor.cpp b/src/Gui/propertyeditor/PropertyEditor.cpp index 239d2399c7..92180f7ca4 100644 --- a/src/Gui/propertyeditor/PropertyEditor.cpp +++ b/src/Gui/propertyeditor/PropertyEditor.cpp @@ -136,9 +136,11 @@ void PropertyEditor::buildUp(const std::mapcurrentIndex(); QStringList propertyPath = propertyModel->propertyPathFromIndex(index); + if (!propertyPath.isEmpty()) + this->selectedProperty = propertyPath; propertyModel->buildUp(props); - if (!propertyPath.isEmpty()) { - QModelIndex index = propertyModel->propertyIndexFromPath(propertyPath); + if (!this->selectedProperty.isEmpty()) { + QModelIndex index = propertyModel->propertyIndexFromPath(this->selectedProperty); this->setCurrentIndex(index); } } diff --git a/src/Gui/propertyeditor/PropertyEditor.h b/src/Gui/propertyeditor/PropertyEditor.h index 6e59d96319..aa9c895876 100644 --- a/src/Gui/propertyeditor/PropertyEditor.h +++ b/src/Gui/propertyeditor/PropertyEditor.h @@ -63,6 +63,7 @@ protected: private: PropertyModel* propertyModel; + QStringList selectedProperty; bool autoupdate; bool committing; bool delaybuild;