fixes 0003341: Undoing is missing steps

This commit is contained in:
wmayer
2018-10-13 12:21:17 +02:00
parent 2a85174148
commit a9e9bc21e4

View File

@@ -103,8 +103,15 @@ void PropertyEditor::closeEditor (QWidget * editor, QAbstractItemDelegate::EndEd
{
if (autoupdate) {
App::Document* doc = App::GetApplication().getActiveDocument();
if (doc && doc->isTouched())
doc->recompute();
if (doc) {
if (doc->isTouched()) {
doc->commitTransaction();
doc->recompute();
}
else {
doc->abortTransaction();
}
}
}
QTreeView::closeEditor(editor, hint);
}
@@ -140,6 +147,13 @@ void PropertyEditor::currentChanged ( const QModelIndex & current, const QModelI
void PropertyEditor::onItemActivated ( const QModelIndex & index )
{
if (autoupdate) {
PropertyItem* property = static_cast<PropertyItem*>(index.internalPointer());
QString edit = tr("Edit %1").arg(property->propertyName());
App::Document* doc = App::GetApplication().getActiveDocument();
if (doc)
doc->openTransaction(edit.toUtf8());
}
openPersistentEditor(model()->buddy(index));
}