Salome HOME
Issue #1083: errors in parameter
authorspo <sergey.pokhodenko@opencascade.com>
Tue, 17 Nov 2015 14:36:06 +0000 (17:36 +0300)
committerspo <sergey.pokhodenko@opencascade.com>
Tue, 17 Nov 2015 14:36:20 +0000 (17:36 +0300)
src/ModuleBase/ModuleBase_WidgetLineEdit.cpp
src/ModuleBase/ModuleBase_WidgetLineEdit.h

index defdbee482ed7223535ec29324eb8e3d00b781e8..7f7e187b8319149030c1d77e65de0b407dfec026 100644 (file)
@@ -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<QWidget*> 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;
 }
index 1f5f3fd71160ec93d574907c27e0ad09d32284ae..5b6b22e57e16848e130575753a6539beec46fb60 100644 (file)
@@ -43,9 +43,8 @@ class MODULEBASE_EXPORT ModuleBase_WidgetLineEdit : public ModuleBase_ModelWidge
   /// Redefinition of virtual method
   virtual QList<QWidget*> 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