Gui: fix missing auto update when edit property expression

It only happens when editing expression through property editor context
menu action.
This commit is contained in:
Zheng, Lei
2019-09-30 11:43:31 +08:00
committed by wmayer
parent f14dfd41cd
commit da19c8489a

View File

@@ -155,6 +155,20 @@ void PropertyEditor::commitData (QWidget * editor)
void PropertyEditor::editorDestroyed (QObject * editor)
{
QTreeView::editorDestroyed(editor);
// When editing expression through context menu, the editor (ExpLineEditor)
// deletes itself when finished, so it won't trigger closeEditor signal. We
// must handle it here to perform auto update.
if (autoupdate) {
App::Document* doc = App::GetApplication().getActiveDocument();
if (doc) {
if (!doc->isTransactionEmpty()) {
if (doc->isTouched())
doc->recompute();
}
}
App::GetApplication().closeActiveTransaction();
}
}
void PropertyEditor::currentChanged ( const QModelIndex & current, const QModelIndex & previous )
@@ -561,6 +575,7 @@ void PropertyEditor::contextMenuEvent(QContextMenuEvent *) {
closePersistentEditor(contextIndex);
Base::FlagToggler<> flag(binding);
edit(contextIndex,AllEditTriggers,0);
setupTransaction(contextIndex);
}
break;
case MA_AddProp: {