From b2ca24e7ae7220b3b89c91aed6083accea56314f Mon Sep 17 00:00:00 2001 From: spo Date: Tue, 17 Nov 2015 17:36:06 +0300 Subject: [PATCH] Issue #1083: errors in parameter --- src/ModuleBase/ModuleBase_WidgetLineEdit.cpp | 11 ++++++++--- src/ModuleBase/ModuleBase_WidgetLineEdit.h | 5 ++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/ModuleBase/ModuleBase_WidgetLineEdit.cpp b/src/ModuleBase/ModuleBase_WidgetLineEdit.cpp index defdbee48..7f7e187b8 100644 --- a/src/ModuleBase/ModuleBase_WidgetLineEdit.cpp +++ b/src/ModuleBase/ModuleBase_WidgetLineEdit.cpp @@ -99,7 +99,7 @@ ModuleBase_WidgetLineEdit::ModuleBase_WidgetLineEdit(QWidget* theParent, aMainLay->addRow(aLabel, myLineEdit); this->setLayout(aMainLay); - connect(myLineEdit, SIGNAL(textChanged(const QString&)), this, SLOT(onTextChanged())); + connect(myLineEdit, SIGNAL(textChanged(const QString&)), this, SIGNAL(valuesModified())); } ModuleBase_WidgetLineEdit::~ModuleBase_WidgetLineEdit() @@ -141,7 +141,12 @@ QList ModuleBase_WidgetLineEdit::getControls() const return result; } -void ModuleBase_WidgetLineEdit::onTextChanged() +bool ModuleBase_WidgetLineEdit::processEnter() { - storeValue(); + bool isModified = getValueState() == ModifiedInPP; + if (isModified) { + emit valuesChanged(); + myLineEdit->selectAll(); + } + return isModified; } diff --git a/src/ModuleBase/ModuleBase_WidgetLineEdit.h b/src/ModuleBase/ModuleBase_WidgetLineEdit.h index 1f5f3fd71..5b6b22e57 100644 --- a/src/ModuleBase/ModuleBase_WidgetLineEdit.h +++ b/src/ModuleBase/ModuleBase_WidgetLineEdit.h @@ -43,9 +43,8 @@ class MODULEBASE_EXPORT ModuleBase_WidgetLineEdit : public ModuleBase_ModelWidge /// Redefinition of virtual method virtual QList getControls() const; - public slots: - /// A slot for processing text changed event - void onTextChanged(); + /// Returns true if the event is processed. + virtual bool processEnter(); protected: /// Saves the internal parameters to the given feature -- 2.39.2