add some comments

This commit is contained in:
wmayer
2019-03-04 19:25:43 +01:00
parent f24bed170a
commit 16a84b9605
2 changed files with 4 additions and 0 deletions

View File

@@ -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) {

View File

@@ -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();
}