| 46 | } |
| 47 | |
| 48 | WidgetSettingEnum::WidgetSettingEnum(QTreeWidget* tree, QTreeWidgetItem* item, const SettingMetaEnum& meta, |
| 49 | SettingDataSet& data_set) |
| 50 | : WidgetSettingBase(tree, item), meta(meta), data_set(data_set), field(new ComboBox(this)), last_resize(0, 0) { |
| 51 | this->field->setFocusPolicy(Qt::StrongFocus); |
| 52 | this->field->show(); |
| 53 | |
| 54 | this->item->setText(0, GetLabel(this->meta).c_str()); |
| 55 | this->item->setFont(0, this->tree->font()); |
| 56 | this->item->setToolTip(0, this->meta.description.c_str()); |
| 57 | this->item->setSizeHint(0, QSize(0, ITEM_HEIGHT)); |
| 58 | this->tree->setItemWidget(this->item, 0, this); |
| 59 | |
| 60 | this->Refresh(REFRESH_ENABLE_AND_STATE); |
| 61 | |
| 62 | this->connect(this->field, SIGNAL(currentIndexChanged(int)), this, SLOT(OnIndexChanged(int))); |
| 63 | } |
| 64 | |
| 65 | void WidgetSettingEnum::Refresh(RefreshAreas refresh_areas) { |
| 66 | const SettingDependenceMode enabled = ::CheckDependence(this->meta, data_set); |