MCPcopy Create free account
hub / github.com/ModOrganizer2/modorganizer / saveTreeExpandState

Method saveTreeExpandState

src/settings.cpp:1093–1102  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1091}
1092
1093void WidgetSettings::saveTreeExpandState(const QTreeView* tv, int role)
1094{
1095 QVariantList expanded;
1096 for (auto index : flatIndex(tv->model())) {
1097 if (tv->isExpanded(index)) {
1098 expanded.append(index.data(role));
1099 }
1100 }
1101 set(m_Settings, "Widgets", indexSettingName(tv), expanded);
1102}
1103
1104void WidgetSettings::restoreTreeExpandState(QTreeView* tv, int role) const
1105{

Callers 1

saveStateMethod · 0.80

Calls 5

flatIndexFunction · 0.85
indexSettingNameFunction · 0.85
modelMethod · 0.80
setFunction · 0.70
dataMethod · 0.45

Tested by

no test coverage detected