42 #include <QGridLayout> 51 this->setEnabled(dataInterface->getEnabled());
53 mData = dataInterface;
54 connect(mData.get(), SIGNAL(changed()),
this, SLOT(
setModified()));
56 mLabel =
new QLabel(
this);
57 mLabel->setText(dataInterface->getDisplayName());
59 mCheckBox =
new QCheckBox(
this);
60 connect(mCheckBox, SIGNAL(toggled(
bool)),
this, SLOT(valueChanged(
bool)));
65 gridLayout->addWidget(mCheckBox, row, 1);
69 QHBoxLayout* topLayout =
new QHBoxLayout;
70 topLayout->setMargin(0);
71 this->setLayout(topLayout);
73 topLayout->addWidget(mLabel);
74 topLayout->addWidget(mCheckBox, 1);
80 void CheckBoxWidget::valueChanged(
bool val)
82 if (val == mData->getValue())
87 void CheckBoxWidget::prePaintEvent()
89 mCheckBox->blockSignals(
true);
91 this->setEnabled(mData->getEnabled());
93 mCheckBox->setChecked(mData->getValue());
94 mCheckBox->setToolTip(mData->getHelp());
95 mLabel->setToolTip(mData->getHelp());
97 mCheckBox->blockSignals(
false);
boost::shared_ptr< class BoolPropertyBase > BoolPropertyBasePtr
Namespace for all CustusX production code.