Add flag to constructor of LineEditor

This commit is contained in:
Magne Sjaastad 2023-09-21 15:03:04 +02:00
parent 27c769f714
commit 6f845f0d42
3 changed files with 5 additions and 8 deletions

View File

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

View File

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

View File

@ -102,7 +102,7 @@ class PdmUiLineEdit : public QLineEdit
{
Q_OBJECT
public:
PdmUiLineEdit( QWidget* parent );
PdmUiLineEdit( QWidget* parent, bool avoidSendingEnterEvent );
void setAvoidSendingEnterEventToParentWidget( bool avoidSendingEnter );
protected: