MCPcopy Create free account
hub / github.com/WarmUpTill/SceneSwitcher / CurrentSelection

Method CurrentSelection

plugins/base/utils/filter-selection.cpp:154–174  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

152}
153
154FilterSelection FilterSelectionWidget::CurrentSelection()
155{
156 FilterSelection s;
157 const int idx = currentIndex();
158 const auto name = currentText();
159 if (idx == -1 || name.isEmpty()) {
160 return s;
161 }
162
163 if (idx < _allEndIdx) {
164 s._type = FilterSelection::Type::ALL;
165 } else if (idx < _variablesEndIdx) {
166 s._type = FilterSelection::Type::VARIABLE;
167 s._variable = GetWeakVariableByQString(name);
168 } else if (idx < _filterEndIdx) {
169 s._type = FilterSelection::Type::SOURCE;
170 s._filter = GetWeakSourceByQString(name);
171 s._filterName = name.toStdString();
172 }
173 return s;
174}
175
176void FilterSelectionWidget::Reset()
177{

Callers

nothing calls this directly

Calls 2

GetWeakVariableByQStringFunction · 0.85
GetWeakSourceByQStringFunction · 0.85

Tested by

no test coverage detected