From 16a84b9605b9e09ce1b22ca4bdbe49eed21721fb Mon Sep 17 00:00:00 2001 From: wmayer Date: Mon, 4 Mar 2019 19:25:43 +0100 Subject: [PATCH] add some comments --- src/Gui/propertyeditor/PropertyEditor.cpp | 3 +++ src/Gui/propertyeditor/PropertyItemDelegate.cpp | 1 + 2 files changed, 4 insertions(+) diff --git a/src/Gui/propertyeditor/PropertyEditor.cpp b/src/Gui/propertyeditor/PropertyEditor.cpp index c1075fa670..9f79f73230 100644 --- a/src/Gui/propertyeditor/PropertyEditor.cpp +++ b/src/Gui/propertyeditor/PropertyEditor.cpp @@ -185,6 +185,9 @@ void PropertyEditor::closeEditor (QWidget * editor, QAbstractItemDelegate::EndEd QTreeView::closeEditor(editor, hint); + // If after closing the editor this widget is still in editing state + // then a new editor must have been created. So, a transaction must be + // opened, too. if (autoupdate && this->state() == EditingState) { App::Document* doc = App::GetApplication().getActiveDocument(); if (doc) { diff --git a/src/Gui/propertyeditor/PropertyItemDelegate.cpp b/src/Gui/propertyeditor/PropertyItemDelegate.cpp index f5d367d271..bb9a11c5f8 100644 --- a/src/Gui/propertyeditor/PropertyItemDelegate.cpp +++ b/src/Gui/propertyeditor/PropertyItemDelegate.cpp @@ -117,6 +117,7 @@ bool PropertyItemDelegate::editorEvent (QEvent * event, QAbstractItemModel* mode void PropertyItemDelegate::editorClosed(QWidget *editor, QAbstractItemDelegate::EndEditHint hint) { // don't close the editor when pressing Tab or Shift+Tab + // https://forum.freecadweb.org/viewtopic.php?f=3&t=34627#p290957 if (hint != EditNextItem && hint != EditPreviousItem) editor->close(); }