MCPcopy Create free account
hub / github.com/LunarG/VulkanTools / WidgetSettingFlag

Method WidgetSettingFlag

vkconfig_gui/widget_setting_flags.cpp:44–63  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

42}
43
44WidgetSettingFlag::WidgetSettingFlag(QTreeWidget* tree, QTreeWidgetItem* item, const SettingMetaFlags& meta,
45 SettingDataSet& data_set, const std::string& flag)
46 : WidgetSettingBase(tree, item), meta(meta), data_set(data_set), flag(flag), field(new QCheckBox(this)) {
47 assert(!flag.empty());
48
49 const SettingEnumValue* enum_value = FindByKey(meta.enum_values, flag.c_str());
50 assert(enum_value);
51
52 const std::string status = enum_value->status == STATUS_STABLE ? "" : std::string(" (") + GetToken(enum_value->status) + ")";
53
54 this->field->setText((enum_value->label + status).c_str());
55 this->field->setFont(tree->font());
56 this->field->show();
57 this->connect(this->field, SIGNAL(clicked(bool)), this, SLOT(OnClicked(bool)));
58
59 this->item->setSizeHint(0, QSize(0, ITEM_HEIGHT));
60 this->tree->setItemWidget(this->item, 0, this);
61
62 this->Refresh(REFRESH_ENABLE_AND_STATE);
63}
64
65void WidgetSettingFlag::Refresh(RefreshAreas refresh_areas) {
66 const SettingDependenceMode enabled = ::CheckDependence(this->meta, data_set);

Callers

nothing calls this directly

Calls 3

RefreshMethod · 0.95
FindByKeyFunction · 0.70
GetTokenFunction · 0.50

Tested by

no test coverage detected