+// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
+
// File: ModuleBase_Widgets.h
// Created: 04 June 2014
// Author: Vitaly Smetannikov
{
QString aText = QString::fromStdString(theData->widgetLabel());
QString aToolTip = QString::fromStdString(theData->widgetTooltip());
- QString aDefault = QString::fromStdString(theData->getProperty("default"));
+ bool isChecked = theData->getBooleanAttribute(ATTR_DEFAULT, false);
myCheckBox = new QCheckBox(aText, theParent);
myCheckBox->setToolTip(aToolTip);
- myCheckBox->setChecked(aDefault == "true");
+ myCheckBox->setChecked(isChecked);
connect(myCheckBox, SIGNAL(toggled(bool)), this, SIGNAL(valuesChanged()));
}
bool ModuleBase_WidgetBoolValue::storeValue() const
{
DataPtr aData = myFeature->data();
- boost::shared_ptr<ModelAPI_AttributeBoolean> aBool = aData->boolean(attributeID());
-
- if (aBool->value() != myCheckBox->isChecked()) {
- aBool->setValue(myCheckBox->isChecked());
- updateObject(myFeature);
- }
+ std::shared_ptr<ModelAPI_AttributeBoolean> aBool = aData->boolean(attributeID());
+ aBool->setValue(myCheckBox->isChecked());
+ updateObject(myFeature);
return true;
}
bool ModuleBase_WidgetBoolValue::restoreValue()
{
DataPtr aData = myFeature->data();
- boost::shared_ptr<ModelAPI_AttributeBoolean> aRef = aData->boolean(attributeID());
+ std::shared_ptr<ModelAPI_AttributeBoolean> aRef = aData->boolean(attributeID());
bool isBlocked = myCheckBox->blockSignals(true);
myCheckBox->setChecked(aRef->value());