MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / selectGroupItem

Method selectGroupItem

app/src/DataModel/ProjectEditor.cpp:5123–5139  ·  view source on GitHub ↗

* @brief Switches the form to the GroupView for the clicked group item. */

Source from the content-addressed store, hash-verified

5121 * @brief Switches the form to the GroupView for the clicked group item.
5122 */
5123bool DataModel::ProjectEditor::selectGroupItem(QStandardItem* item)
5124{
5125 if (!m_groupItems.contains(item))
5126 return false;
5127
5128 auto& pm = DataModel::ProjectModel::instance();
5129 const auto cached = m_groupItems.value(item);
5130 const auto& groups = pm.groups();
5131 DataModel::Group live = cached;
5132 if (cached.groupId >= 0 && static_cast<size_t>(cached.groupId) < groups.size())
5133 live = groups[cached.groupId];
5134
5135 pm.setSelectedGroup(live);
5136 setCurrentView(GroupView);
5137 buildGroupModel(live);
5138 return true;
5139}
5140
5141/**
5142 * @brief Routes the Groups root and group folder items to their navigable views.

Callers

nothing calls this directly

Calls 4

setSelectedGroupMethod · 0.80
containsMethod · 0.45
valueMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected