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

Method Add

lib/macro/macro-tree.cpp:522–533  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

520}
521
522void MacroTreeModel::Add(std::shared_ptr<Macro> item)
523{
524 auto lock = LockContext();
525 auto idx = CountItemsVisibleInModel(_macros);
526 beginInsertRows(QModelIndex(), idx, idx);
527 _macros.emplace_back(item);
528 endInsertRows();
529 _mt->UpdateWidget(createIndex(idx, 0, nullptr), item);
530 _mt->selectionModel()->clear();
531 _mt->selectionModel()->select(createIndex(idx, 0, nullptr),
532 QItemSelectionModel::Select);
533}
534
535void MacroTreeModel::MoveToBeginningOfGroup(std::shared_ptr<Macro> item,
536 std::shared_ptr<Macro> group)

Callers 1

AddToGroupMethod · 0.45

Calls 4

LockContextFunction · 0.85
CountItemsVisibleInModelFunction · 0.85
UpdateWidgetMethod · 0.80
IsInValidStateMethod · 0.80

Tested by

no test coverage detected