From ec18f070d13b195d946c3d955d8c21b2e60550e2 Mon Sep 17 00:00:00 2001 From: wmayer Date: Wed, 1 Jan 2020 10:43:12 +0100 Subject: [PATCH] Spreadsheet: [skip ci] fix regression when pressing Return/Enter when completion list is shown --- src/Mod/Spreadsheet/Gui/SpreadsheetDelegate.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Mod/Spreadsheet/Gui/SpreadsheetDelegate.cpp b/src/Mod/Spreadsheet/Gui/SpreadsheetDelegate.cpp index a202d2d8bd..835a0ec6af 100644 --- a/src/Mod/Spreadsheet/Gui/SpreadsheetDelegate.cpp +++ b/src/Mod/Spreadsheet/Gui/SpreadsheetDelegate.cpp @@ -50,10 +50,7 @@ QWidget *SpreadsheetDelegate::createEditor(QWidget *parent, editor->setIndex(index); editor->setDocumentObject(sheet); - // See https://forum.freecadweb.org/viewtopic.php?f=3&t=41694 - // It looks like the slot commitAndCloseEditor() is not needed any more and even - // causes a crash when doing so because the LineEdit is still accessed after its destruction. - //connect(editor, SIGNAL(returnPressed()), this, SLOT(commitAndCloseEditor())); + connect(editor, SIGNAL(returnPressed()), this, SLOT(commitAndCloseEditor())); return editor; } @@ -65,8 +62,11 @@ void SpreadsheetDelegate::commitAndCloseEditor() return; } - Q_EMIT commitData(editor); - Q_EMIT closeEditor(editor); + // See https://forum.freecadweb.org/viewtopic.php?f=3&t=41694 + // It looks like the slot commitAndCloseEditor() is not needed any more and even + // causes a crash when doing so because the LineEdit is still accessed after its destruction. + //Q_EMIT commitData(editor); + //Q_EMIT closeEditor(editor); } void SpreadsheetDelegate::setEditorData(QWidget *editor,