#include <ModuleBase_WidgetDoubleValue.h>
#include <ModelAPI_AttributeDouble.h>
-#include <ModelAPI_AttributeBoolean.h>
#include <ModelAPI_Data.h>
#include <Config_Keywords.h>
#include <QLayout>
#include <QLabel>
#include <QDoubleSpinBox>
-#include <QCheckBox>
ModuleBase_WidgetDoubleValue::ModuleBase_WidgetDoubleValue(QWidget* theParent, const Config_WidgetAPI* theData)
- : ModuleBase_ModelWidget(theParent)
+ : ModuleBase_ModelWidget(theParent, theData)
{
myContainer = new QWidget(theParent);
QHBoxLayout* aControlLay = new QHBoxLayout(myContainer);
myLabel->setPixmap(QPixmap(aLabelIcon));
aControlLay->addWidget(myLabel);
- myAttributeID = theData->widgetId();
mySpinBox = new QDoubleSpinBox(myContainer);
- QString anObjName = QString::fromStdString(myAttributeID);
+ QString anObjName = QString::fromStdString(attributeID());
mySpinBox->setObjectName(anObjName);
bool isOk = false;
bool ModuleBase_WidgetDoubleValue::storeValue(FeaturePtr theFeature) const
{
DataPtr aData = theFeature->data();
- boost::shared_ptr<ModelAPI_AttributeDouble> aReal = aData->real(myAttributeID);
+ boost::shared_ptr<ModelAPI_AttributeDouble> aReal = aData->real(attributeID());
if (aReal->value() != mySpinBox->value()) {
aReal->setValue(mySpinBox->value());
Events_Loop::loop()->flush(Events_Loop::eventByName(EVENT_FEATURE_UPDATED));
bool ModuleBase_WidgetDoubleValue::restoreValue(FeaturePtr theFeature)
{
DataPtr aData = theFeature->data();
- boost::shared_ptr<ModelAPI_AttributeDouble> aRef = aData->real(myAttributeID);
+ boost::shared_ptr<ModelAPI_AttributeDouble> aRef = aData->real(attributeID());
bool isBlocked = mySpinBox->blockSignals(true);
mySpinBox->setValue(aRef->value());