| 1075 | } |
| 1076 | |
| 1077 | void 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 | |
| 1093 | void WidgetSettings::saveTreeExpandState(const QTreeView* tv, int role) |
| 1094 | { |
no test coverage detected