X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FModuleBase%2FModuleBase_WidgetDoubleValue.cpp;h=7400d7f7d48db95bc329456d6a75aa6c7a567282;hb=60bbd6f564271cbd47808e7acc3c9b725499d45a;hp=16837acce7f66f27bb19032263bb96be839ebccf;hpb=6d9f778b60206147106c918852c4a9595898f892;p=modules%2Fshaper.git diff --git a/src/ModuleBase/ModuleBase_WidgetDoubleValue.cpp b/src/ModuleBase/ModuleBase_WidgetDoubleValue.cpp index 16837acce..7400d7f7d 100644 --- a/src/ModuleBase/ModuleBase_WidgetDoubleValue.cpp +++ b/src/ModuleBase/ModuleBase_WidgetDoubleValue.cpp @@ -4,6 +4,7 @@ #include #include +#include #include #include @@ -18,7 +19,6 @@ #include #include #include -#include #include #include @@ -37,7 +37,7 @@ ModuleBase_WidgetDoubleValue::ModuleBase_WidgetDoubleValue(QWidget* theParent, { myContainer = new QWidget(theParent); QHBoxLayout* aControlLay = new QHBoxLayout(myContainer); - aControlLay->setContentsMargins(0, 0, 0, 0); + ModuleBase_Tools::adjustMargins(aControlLay); QString aLabelText = QString::fromStdString(theData->widgetLabel()); QString aLabelIcon = QString::fromStdString(theData->widgetIcon()); @@ -77,7 +77,7 @@ ModuleBase_WidgetDoubleValue::ModuleBase_WidgetDoubleValue(QWidget* theParent, mySpinBox->setSingleStep(aStepVal); } - aProp = theData->getProperty(DOUBLE_WDG_DEFAULT); + aProp = theData->getProperty(ANY_WDG_DEFAULT); double aDefVal = QString::fromStdString(aProp).toDouble(&isOk); if (isOk) { mySpinBox->setValue(aDefVal); @@ -92,8 +92,6 @@ ModuleBase_WidgetDoubleValue::ModuleBase_WidgetDoubleValue(QWidget* theParent, aControlLay->setStretch(1, 1); connect(mySpinBox, SIGNAL(valueChanged(double)), this, SIGNAL(valuesChanged())); - - mySpinBox->installEventFilter(this); } ModuleBase_WidgetDoubleValue::~ModuleBase_WidgetDoubleValue() @@ -124,24 +122,6 @@ bool ModuleBase_WidgetDoubleValue::restoreValue() QList ModuleBase_WidgetDoubleValue::getControls() const { QList aList; - aList.append(myLabel); aList.append(mySpinBox); return aList; } - -bool ModuleBase_WidgetDoubleValue::eventFilter(QObject *theObject, QEvent *theEvent) -{ - if (theObject == mySpinBox) { - 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); -} -