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

Method restoreTreeCheckState

src/settings.cpp:1077–1091  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1075}
1076
1077void WidgetSettings::restoreTreeCheckState(QTreeView* tv, int role) const
1078{
1079 if (auto states =
1080 getOptional<QVariantList>(m_Settings, "Widgets", indexSettingName(tv))) {
1081 auto allIndex = flatIndex(tv->model());
1082 MOBase::log::debug("restoreTreeCheckState: {}, {}", states->size(),
1083 allIndex.size());
1084 if (states->size() != allIndex.size()) {
1085 return;
1086 }
1087 for (int i = 0; i < states->size(); ++i) {
1088 tv->model()->setData(allIndex[i], states->at(i), role);
1089 }
1090 }
1091}
1092
1093void WidgetSettings::saveTreeExpandState(const QTreeView* tv, int role)
1094{

Callers 1

restoreStateMethod · 0.80

Calls 5

indexSettingNameFunction · 0.85
flatIndexFunction · 0.85
modelMethod · 0.80
sizeMethod · 0.45
setDataMethod · 0.45

Tested by

no test coverage detected