Salome HOME
Fix fillet validator
[modules/shaper.git] / src / ModuleBase / ModuleBase_WidgetDoubleValue.cpp
index 9cd6797fc09bc2049ba89beaa6d0e50e6fc7b34b..06cfe0c0496cde8457a649cc5548cca53905badd 100644 (file)
@@ -31,8 +31,6 @@
 #include <iostream>
 #endif
 
-#define APPLY_BY_ENTER_OR_TAB
-
 ModuleBase_WidgetDoubleValue::ModuleBase_WidgetDoubleValue(QWidget* theParent,
                                                            const Config_WidgetAPI* theData,
                                                            const std::string& theParentId)
@@ -88,16 +86,7 @@ ModuleBase_WidgetDoubleValue::ModuleBase_WidgetDoubleValue(QWidget* theParent,
   myLabel->setToolTip(aTTip);
 
   aControlLay->addRow(myLabel, mySpinBox);
-#ifdef APPLY_BY_ENTER_OR_TAB
-  // Apply widget value change by enter/tab event.
-  //connect(mySpinBox, SIGNAL(editingFinished()), this, SIGNAL(valuesChanged()));
-  connect(mySpinBox, SIGNAL(valueStored()), this, SIGNAL(valuesChanged()));
   connect(mySpinBox, SIGNAL(valueChanged(const QString&)), this, SIGNAL(valuesModified()));
-  connect(mySpinBox, SIGNAL(focusNextPrev()), this, SIGNAL(focusNextPrev()));
-
-#else
-  connect(mySpinBox, SIGNAL(valueChanged(const QString&)), this, SIGNAL(valuesChanged()));
-#endif
 }
 
 ModuleBase_WidgetDoubleValue::~ModuleBase_WidgetDoubleValue()
@@ -155,6 +144,11 @@ bool ModuleBase_WidgetDoubleValue::restoreValueCustom()
   return true;
 }
 
+void ModuleBase_WidgetDoubleValue::selectContent()
+{
+  mySpinBox->selectAll();
+}
+
 QList<QWidget*> ModuleBase_WidgetDoubleValue::getControls() const
 {
   QList<QWidget*> aList;
@@ -164,10 +158,11 @@ QList<QWidget*> ModuleBase_WidgetDoubleValue::getControls() const
 
 bool ModuleBase_WidgetDoubleValue::processEnter()
 {
-  bool isModified = mySpinBox->isModified();
+  bool isModified = getValueState() == ModifiedInPP;
+  //bool isModified = mySpinBox->isModified();
   if (isModified) {
     emit valuesChanged();
-    mySpinBox->clearModified();
+    //mySpinBox->clearModified();
     mySpinBox->selectAll();
   }
   return isModified;