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

Method ResetWidgets

lib/macro/macro-tree.cpp:935–952  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

933}
934
935void MacroTree::ResetWidgets()
936{
937 MacroTreeModel *mtm = GetModel();
938 int modelIdx = 0;
939 for (int i = 0; i < (int)mtm->_macros.size(); i++) {
940 QModelIndex index = mtm->createIndex(modelIdx, 0, nullptr);
941 const auto &macro = mtm->_macros[i];
942 setIndexWidget(index,
943 new MacroTreeItem(this, macro, _highlight));
944
945 // Skip items of collapsed groups
946 if (macro->IsGroup() && macro->IsCollapsed()) {
947 i += macro->GroupSize();
948 }
949 modelIdx++;
950 }
951 assert(GetModel()->IsInValidState());
952}
953
954void MacroTree::UpdateWidget(const QModelIndex &idx,
955 std::shared_ptr<Macro> item)

Callers 1

ResetMethod · 0.80

Calls 5

sizeMethod · 0.80
IsGroupMethod · 0.80
IsCollapsedMethod · 0.80
GroupSizeMethod · 0.80
IsInValidStateMethod · 0.80

Tested by

no test coverage detected