#include <QLayout>
#include <QCheckBox>
-ModuleBase_WidgetBoolValue::ModuleBase_WidgetBoolValue(QWidget* theParent,
- const Config_WidgetAPI* theData,
- const std::string& theParentId)
- : ModuleBase_ModelWidget(theParent, theData, theParentId)
+ModuleBase_WidgetBoolValue::ModuleBase_WidgetBoolValue(QWidget* theParent,
+ const Config_WidgetAPI* theData,
+ const std::string& theParentId)
+ : ModuleBase_ModelWidget(theParent, theData, theParentId)
{
QString aText = QString::fromStdString(theData->widgetLabel());
QString aToolTip = QString::fromStdString(theData->widgetTooltip());
{
}
-QWidget* ModuleBase_WidgetBoolValue::getControl() const
-{
- return myCheckBox;
+QWidget* ModuleBase_WidgetBoolValue::getControl() const
+{
+ return myCheckBox;
}
-bool ModuleBase_WidgetBoolValue::storeValue(ObjectPtr theObject) const
+bool ModuleBase_WidgetBoolValue::storeValue() const
{
- DataPtr aData = theObject->data();
+ DataPtr aData = myFeature->data();
boost::shared_ptr<ModelAPI_AttributeBoolean> aBool = aData->boolean(attributeID());
if (aBool->value() != myCheckBox->isChecked()) {
aBool->setValue(myCheckBox->isChecked());
- Events_Loop::loop()->flush(Events_Loop::eventByName(EVENT_OBJECT_UPDATED));
+ updateObject(myFeature);
}
return true;
}
-bool ModuleBase_WidgetBoolValue::restoreValue(ObjectPtr theObject)
+bool ModuleBase_WidgetBoolValue::restoreValue()
{
- DataPtr aData = theObject->data();
+ DataPtr aData = myFeature->data();
boost::shared_ptr<ModelAPI_AttributeBoolean> aRef = aData->boolean(attributeID());
bool isBlocked = myCheckBox->blockSignals(true);