Salome HOME
Merge branch 'master' of newgeom:newgeom.git
[modules/shaper.git] / src / ModuleBase / ModuleBase_WidgetPoint2D.cpp
index 881a6486d6437e3696ce2e271e86fc1170210fb2..8feec7a6c5e96aa9f7d7983c0d4e7af82a8b9cf7 100644 (file)
@@ -4,6 +4,7 @@
 
 #include <ModuleBase_WidgetPoint2D.h>
 #include <ModuleBase_WidgetValueFeature.h>
+#include <ModuleBase_DoubleSpinBox.h>
 
 #include <Config_Keywords.h>
 #include <Config_WidgetAPI.h>
@@ -19,7 +20,6 @@
 
 #include <QGroupBox>
 #include <QGridLayout>
-#include <QDoubleSpinBox>
 #include <QLabel>
 #include <QEvent>
 #include <QKeyEvent>
@@ -44,7 +44,7 @@ ModuleBase_WidgetPoint2D::ModuleBase_WidgetPoint2D(QWidget* theParent,
     aLabel->setPixmap(QPixmap(":pictures/x_point.png"));
     aGroupLay->addWidget(aLabel, 0, 0);
 
-    myXSpin = new QDoubleSpinBox(myGroupBox);
+    myXSpin = new ModuleBase_DoubleSpinBox(myGroupBox);
     myXSpin->setMinimum(-DBL_MAX);
     myXSpin->setMaximum(DBL_MAX);
     myXSpin->setToolTip("X");
@@ -58,7 +58,7 @@ ModuleBase_WidgetPoint2D::ModuleBase_WidgetPoint2D(QWidget* theParent,
     aLabel->setPixmap(QPixmap(":pictures/y_point.png"));
     aGroupLay->addWidget(aLabel, 1, 0);
 
-    myYSpin = new QDoubleSpinBox(myGroupBox);
+    myYSpin = new ModuleBase_DoubleSpinBox(myGroupBox);
     myYSpin->setMinimum(-DBL_MAX);
     myYSpin->setMaximum(DBL_MAX);
     myYSpin->setToolTip("X");
@@ -144,22 +144,6 @@ QList<QWidget*> ModuleBase_WidgetPoint2D::getControls() const
   return aControls;
 }
 
-bool ModuleBase_WidgetPoint2D::eventFilter(QObject *theObject, QEvent *theEvent)
-{
-  if (theObject == myXSpin || theObject == myYSpin) {
-    if (theEvent->type() == QEvent::KeyRelease) {
-      QKeyEvent* aKeyEvent = (QKeyEvent*) theEvent;
-      if (aKeyEvent && (aKeyEvent->key() == Qt::Key_Return ||
-                        aKeyEvent->key() == Qt::Key_Enter)) {
-        emit focusOutWidget(this);
-      }
-      emit keyReleased((QKeyEvent*) theEvent);
-      return true;
-    }
-  }
-  return ModuleBase_ModelWidget::eventFilter(theObject, theEvent);
-}
-
 bool ModuleBase_WidgetPoint2D::initFromPrevious(ObjectPtr theObject)
 {
   if (myOptionParam.length() == 0)