| 26 | #include <cassert> |
| 27 | |
| 28 | WidgetSettingBool::WidgetSettingBool(QTreeWidget* tree, QTreeWidgetItem* item, const SettingMetaBool& meta, |
| 29 | SettingDataSet& data_set) |
| 30 | : WidgetSettingBase(tree, item), meta(meta), data_set(data_set), field(new QCheckBox(this)) { |
| 31 | this->field->setText(GetLabel(this->meta).c_str()); |
| 32 | this->field->setFont(this->tree->font()); |
| 33 | this->field->show(); |
| 34 | this->connect(this->field, SIGNAL(clicked()), this, SLOT(OnClicked())); |
| 35 | |
| 36 | this->item->setToolTip(0, this->meta.description.c_str()); |
| 37 | this->item->setSizeHint(0, QSize(0, ITEM_HEIGHT)); |
| 38 | this->tree->setItemWidget(this->item, 0, this); |
| 39 | |
| 40 | this->Refresh(REFRESH_ENABLE_AND_STATE); |
| 41 | } |
| 42 | |
| 43 | void WidgetSettingBool::Refresh(RefreshAreas refresh_areas) { |
| 44 | const SettingDependenceMode enabled = ::CheckDependence(this->meta, this->data_set); |