Save position of last edited property item and restore it when selection changes

This commit is contained in:
wmayer 2013-05-08 15:07:46 +02:00
parent 738e8c3d15
commit fa3bbd093a
2 changed files with 5 additions and 2 deletions

View File

@ -136,9 +136,11 @@ void PropertyEditor::buildUp(const std::map<std::string, std::vector<App::Proper
QModelIndex index = this->currentIndex();
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);
}
}

View File

@ -63,6 +63,7 @@ protected:
private:
PropertyModel* propertyModel;
QStringList selectedProperty;
bool autoupdate;
bool committing;
bool delaybuild;