diff --git a/Fwk/AppFwk/cafUserInterface/cafPdmUiCheckBoxAndTextEditor.cpp b/Fwk/AppFwk/cafUserInterface/cafPdmUiCheckBoxAndTextEditor.cpp index 14bcf20c52..51aae11d98 100644 --- a/Fwk/AppFwk/cafUserInterface/cafPdmUiCheckBoxAndTextEditor.cpp +++ b/Fwk/AppFwk/cafUserInterface/cafPdmUiCheckBoxAndTextEditor.cpp @@ -100,10 +100,7 @@ QWidget* PdmUiCheckBoxAndTextEditor::createEditorWidget( QWidget* parent ) { auto* containerWidget = new QWidget( parent ); - auto lineEditWidget = new PdmUiLineEdit( containerWidget ); - lineEditWidget->setAvoidSendingEnterEventToParentWidget( true ); - - m_lineEdit = lineEditWidget; + m_lineEdit = new PdmUiLineEdit( containerWidget, true ); connect( m_lineEdit, SIGNAL( editingFinished() ), this, SLOT( slotSetValueToField() ) ); m_checkBox = new QCheckBox( "", containerWidget ); diff --git a/Fwk/AppFwk/cafUserInterface/cafPdmUiLineEditor.cpp b/Fwk/AppFwk/cafUserInterface/cafPdmUiLineEditor.cpp index 3a3405107b..db582988bd 100644 --- a/Fwk/AppFwk/cafUserInterface/cafPdmUiLineEditor.cpp +++ b/Fwk/AppFwk/cafUserInterface/cafPdmUiLineEditor.cpp @@ -88,7 +88,7 @@ void PdmUiLineEditor::updateLineEditFromReadOnlyState( QLineEdit* lineEdit, bool //-------------------------------------------------------------------------------------------------- QWidget* PdmUiLineEditor::createEditorWidget( QWidget* parent ) { - m_lineEdit = new PdmUiLineEdit( parent ); + m_lineEdit = new PdmUiLineEdit( parent, false ); connect( m_lineEdit, SIGNAL( editingFinished() ), this, SLOT( slotEditingFinished() ) ); @@ -394,9 +394,9 @@ bool PdmUiLineEditor::isMultipleFieldsWithSameKeywordSelected( PdmFieldHandle* e //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -PdmUiLineEdit::PdmUiLineEdit( QWidget* parent ) +PdmUiLineEdit::PdmUiLineEdit( QWidget* parent, bool avoidSendingEnterEvent ) : QLineEdit( parent ) - , m_avoidSendingEnterEvent( false ) + , m_avoidSendingEnterEvent( avoidSendingEnterEvent ) { } diff --git a/Fwk/AppFwk/cafUserInterface/cafPdmUiLineEditor.h b/Fwk/AppFwk/cafUserInterface/cafPdmUiLineEditor.h index 20b1fe51f9..0dccd8c03c 100644 --- a/Fwk/AppFwk/cafUserInterface/cafPdmUiLineEditor.h +++ b/Fwk/AppFwk/cafUserInterface/cafPdmUiLineEditor.h @@ -102,7 +102,7 @@ class PdmUiLineEdit : public QLineEdit { Q_OBJECT public: - PdmUiLineEdit( QWidget* parent ); + PdmUiLineEdit( QWidget* parent, bool avoidSendingEnterEvent ); void setAvoidSendingEnterEventToParentWidget( bool avoidSendingEnter ); protected: