| 28 | #include "IPPropertyWidget.h" |
| 29 | |
| 30 | class IPPropertyButtonBool : public IPPropertyWidget |
| 31 | { |
| 32 | Q_OBJECT |
| 33 | public: |
| 34 | IPPropertyButtonBool(IPLProcessPropertyBool* property, QWidget *parent) : |
| 35 | IPPropertyWidget(property, parent), |
| 36 | _button(new QPushButton(this)), |
| 37 | _value(false), |
| 38 | _property(property) |
| 39 | { |
| 40 | setLayout(new QHBoxLayout); |
| 41 | layout()->setMargin(0); |
| 42 | |
| 43 | _button->setText(property->title()); |
| 44 | layout()->addWidget(_button); |
| 45 | |
| 46 | connect(_button, &QPushButton::clicked, this, &IPPropertyButtonBool::onClick ); |
| 47 | } |
| 48 | |
| 49 | bool value() const { return _value; } |
| 50 | void saveValue() { _property->setValue(value()); } |
| 51 | void resetValue() { _property->resetValue(); } |
| 52 | |