Skip to content

Commit

Permalink
Add flag to constructor of LineEditor
Browse files Browse the repository at this point in the history
  • Loading branch information
magnesj committed Sep 22, 2023
1 parent 27c769f commit 6f845f0
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand Down
6 changes: 3 additions & 3 deletions Fwk/AppFwk/cafUserInterface/cafPdmUiLineEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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() ) );

Expand Down Expand Up @@ -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 )
{
}

Expand Down
2 changes: 1 addition & 1 deletion Fwk/AppFwk/cafUserInterface/cafPdmUiLineEditor.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ class PdmUiLineEdit : public QLineEdit
{
Q_OBJECT
public:
PdmUiLineEdit( QWidget* parent );
PdmUiLineEdit( QWidget* parent, bool avoidSendingEnterEvent );
void setAvoidSendingEnterEventToParentWidget( bool avoidSendingEnter );

protected:
Expand Down

0 comments on commit 6f845f0

Please sign in to comment.