Save position of last edited property item and restore it when selection changes
This commit is contained in:
parent
738e8c3d15
commit
fa3bbd093a
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -63,6 +63,7 @@ protected:
|
|||
|
||||
private:
|
||||
PropertyModel* propertyModel;
|
||||
QStringList selectedProperty;
|
||||
bool autoupdate;
|
||||
bool committing;
|
||||
bool delaybuild;
|
||||
|
|
Loading…
Reference in New Issue
Block a user