X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FModuleBase%2FModuleBase_WidgetBoolValue.cpp;h=b0ff0d2a10343f2a15d929598b7824557acb5f62;hb=e32f95642855a63da2727cb324ce2a75632a712f;hp=af2e7ee0ef3b79879863c3f61a17f8470133a47d;hpb=0a76161addf39a6d03b90308eb99abc3a8d10e74;p=modules%2Fshaper.git diff --git a/src/ModuleBase/ModuleBase_WidgetBoolValue.cpp b/src/ModuleBase/ModuleBase_WidgetBoolValue.cpp index af2e7ee0e..b0ff0d2a1 100644 --- a/src/ModuleBase/ModuleBase_WidgetBoolValue.cpp +++ b/src/ModuleBase/ModuleBase_WidgetBoolValue.cpp @@ -1,10 +1,11 @@ // Copyright (C) 2014-20xx CEA/DEN, EDF R&D -// File: ModuleBase_Widgets.h +// File: ModuleBase_WidgetBoolValue.cpp // Created: 04 June 2014 // Author: Vitaly Smetannikov #include +#include #include #include @@ -20,18 +21,22 @@ #include ModuleBase_WidgetBoolValue::ModuleBase_WidgetBoolValue(QWidget* theParent, - const Config_WidgetAPI* theData, - const std::string& theParentId) - : ModuleBase_ModelWidget(theParent, theData, theParentId) + const Config_WidgetAPI* theData) +: ModuleBase_ModelWidget(theParent, theData) { QString aText = QString::fromStdString(theData->widgetLabel()); QString aToolTip = QString::fromStdString(theData->widgetTooltip()); bool isChecked = theData->getBooleanAttribute(ATTR_DEFAULT, false); - myCheckBox = new QCheckBox(aText, theParent); + myCheckBox = new QCheckBox(aText, this); myCheckBox->setToolTip(aToolTip); myCheckBox->setChecked(isChecked); + QVBoxLayout* aMainLayout = new QVBoxLayout(this); + ModuleBase_Tools::adjustMargins(aMainLayout); + aMainLayout->addWidget(myCheckBox); + setLayout(aMainLayout); + connect(myCheckBox, SIGNAL(toggled(bool)), this, SIGNAL(valuesChanged())); } @@ -39,12 +44,7 @@ ModuleBase_WidgetBoolValue::~ModuleBase_WidgetBoolValue() { } -QWidget* ModuleBase_WidgetBoolValue::getControl() const -{ - return myCheckBox; -} - -bool ModuleBase_WidgetBoolValue::storeValueCustom() const +bool ModuleBase_WidgetBoolValue::storeValueCustom() { DataPtr aData = myFeature->data(); std::shared_ptr aBool = aData->boolean(attributeID()); @@ -53,7 +53,7 @@ bool ModuleBase_WidgetBoolValue::storeValueCustom() const return true; } -bool ModuleBase_WidgetBoolValue::restoreValue() +bool ModuleBase_WidgetBoolValue::restoreValueCustom() { DataPtr aData = myFeature->data(); std::shared_ptr aRef = aData->boolean(attributeID()); @@ -71,3 +71,8 @@ QList ModuleBase_WidgetBoolValue::getControls() const aList.append(myCheckBox); return aList; } + +void ModuleBase_WidgetBoolValue::setHighlighted(bool) +{ + return; +}