From dba447e3b813ff36c13ba4a96a6da6e69430d804 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Fri, 23 Sep 2022 09:53:38 +0200 Subject: [PATCH] #9312 Return line edit instead of placeholder widget if auto value is not supported --- Fwk/AppFwk/cafUserInterface/cafPdmUiLineEditor.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Fwk/AppFwk/cafUserInterface/cafPdmUiLineEditor.cpp b/Fwk/AppFwk/cafUserInterface/cafPdmUiLineEditor.cpp index 7cc93740ce..cee18b48d1 100644 --- a/Fwk/AppFwk/cafUserInterface/cafPdmUiLineEditor.cpp +++ b/Fwk/AppFwk/cafUserInterface/cafPdmUiLineEditor.cpp @@ -104,7 +104,14 @@ QWidget* PdmUiLineEditor::createEditorWidget( QWidget* parent ) connect( m_autoValueToolButton, SIGNAL( clicked() ), this, SLOT( slotApplyAutoValue() ) ); - return m_placeholder; + if ( uiField()->isAutoValueSupported() ) + { + // If we return the placeholder widget to be used in a table editor, Qt will crash when the editor is closed + return m_placeholder; + } + + // Return line edit if no auto value is supported + return m_lineEdit; } //--------------------------------------------------------------------------------------------------