21 #include <QGridLayout>
30 this->setEnabled(dataInterface->getEnabled());
32 mData = dataInterface;
33 connect(mData.get(), SIGNAL(changed()),
this, SLOT(
setModified()));
35 mLabel =
new QLabel(
this);
36 mLabel->setText(dataInterface->getDisplayName());
38 mCheckBox =
new QCheckBox(
this);
39 connect(mCheckBox, SIGNAL(toggled(
bool)),
this, SLOT(valueChanged(
bool)));
44 gridLayout->addWidget(mCheckBox, row, 1);
48 QHBoxLayout* topLayout =
new QHBoxLayout;
49 topLayout->setMargin(0);
50 this->setLayout(topLayout);
52 topLayout->addWidget(mLabel);
53 topLayout->addWidget(mCheckBox, 1);
59 void CheckBoxWidget::valueChanged(
bool val)
61 if (val == mData->getValue())
66 void CheckBoxWidget::prePaintEvent()
68 mCheckBox->blockSignals(
true);
70 this->setEnabled(mData->getEnabled());
71 mCheckBox->setEnabled(mData->getEnabled());
73 mCheckBox->setChecked(mData->getValue());
74 mCheckBox->setToolTip(mData->getHelp());
75 mLabel->setToolTip(mData->getHelp());
77 mCheckBox->blockSignals(
false);