Salome HOME
Apply modifications in the editors by Enter/Tab event only.
[modules/shaper.git] / src / ModuleBase / ModuleBase_WidgetDoubleValue.cpp
index 9b478cc8e0ff4edf54a17f0d2a7a7253f0baa6ad..5f9dc8a5b6d3cbf350ede6b4e0e9bfe43b027e87 100644 (file)
@@ -31,7 +31,7 @@
 #include <iostream>
 #endif
 
-//#define APPLY_BY_ENTER_OR_TAB
+#define APPLY_BY_ENTER_OR_TAB
 
 ModuleBase_WidgetDoubleValue::ModuleBase_WidgetDoubleValue(QWidget* theParent,
                                                            const Config_WidgetAPI* theData,
@@ -91,6 +91,8 @@ ModuleBase_WidgetDoubleValue::ModuleBase_WidgetDoubleValue(QWidget* theParent,
 #ifdef APPLY_BY_ENTER_OR_TAB
   // Apply widget value change by enter/tab event.
   connect(mySpinBox, SIGNAL(editingFinished()), this, SIGNAL(valuesChanged()));
+  connect(mySpinBox, SIGNAL(valueChanged(const QString&)), this, SIGNAL(valuesModified()));
+
 #else
   connect(mySpinBox, SIGNAL(valueChanged(const QString&)), this, SIGNAL(valuesChanged()));
 #endif
@@ -157,3 +159,8 @@ QList<QWidget*> ModuleBase_WidgetDoubleValue::getControls() const
   aList.append(mySpinBox);
   return aList;
 }
+
+bool ModuleBase_WidgetDoubleValue::isEventProcessed(QKeyEvent* theEvent)
+{
+  return mySpinBox->isEventProcessed(theEvent);
+}