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

Method collectGroupWidgetIds

app/src/UI/Taskbar.cpp:998–1027  ·  view source on GitHub ↗

* @brief Collects (windowId, widgetType, relativeIndex) triples that belong to groupId. */

Source from the content-addressed store, hash-verified

996 * @brief Collects (windowId, widgetType, relativeIndex) triples that belong to groupId.
997 */
998void UI::Taskbar::collectGroupWidgetIds(int groupId,
999 QList<int>& windowIds,
1000 QList<int>& relativeIds,
1001 QList<SerialStudio::DashboardWidget>& widgetTypes) const
1002{
1003 auto* db = &UI::Dashboard::instance();
1004 const auto& widgetMap = db->widgetMap();
1005 for (auto it = widgetMap.begin(); it != widgetMap.end(); ++it) {
1006 const auto windowId = it.key();
1007 const auto widgetType = it.value().first;
1008 const auto relativeIndex = it.value().second;
1009
1010 int candidateGroup = -1;
1011 if (SerialStudio::isGroupWidget(widgetType))
1012 candidateGroup = db->getGroupWidget(widgetType, relativeIndex).groupId;
1013
1014 else if (SerialStudio::isDatasetWidget(widgetType))
1015 candidateGroup = db->getDatasetWidget(widgetType, relativeIndex).groupId;
1016
1017 else
1018 continue;
1019
1020 if (candidateGroup != groupId)
1021 continue;
1022
1023 windowIds.append(windowId);
1024 widgetTypes.append(widgetType);
1025 relativeIds.append(relativeIndex);
1026 }
1027}
1028
1029/**
1030 * @brief Builds and appends a single child QStandardItem under the given group item.

Callers

nothing calls this directly

Calls 4

beginMethod · 0.80
keyMethod · 0.80
valueMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected