#include <ModuleBase_WidgetPoint2D.h>
#include <ModuleBase_WidgetValueFeature.h>
+#include <ModuleBase_DoubleSpinBox.h>
#include <Config_Keywords.h>
#include <Config_WidgetAPI.h>
#include <QGroupBox>
#include <QGridLayout>
-#include <QDoubleSpinBox>
#include <QLabel>
#include <QEvent>
#include <QKeyEvent>
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");
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");
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)