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

Method createWidget

app/src/UI/WidgetRegistry.cpp:85–108  ·  view source on GitHub ↗

* @brief Creates a new widget and assigns a unique ID. */

Source from the content-addressed store, hash-verified

83 * @brief Creates a new widget and assigns a unique ID.
84 */
85UI::WidgetID UI::WidgetRegistry::createWidget(SerialStudio::DashboardWidget type,
86 const QString& title,
87 int groupId,
88 int datasetIndex,
89 bool isGroupWidget)
90{
91 WidgetInfo info;
92 info.id = m_nextId++;
93 info.type = type;
94 info.title = title;
95 info.groupId = groupId;
96 info.datasetIndex = datasetIndex;
97 info.isGroupWidget = isGroupWidget;
98
99 m_widgetOrder.append(info.id);
100 m_widgets.insert(info.id, info);
101
102 if (m_batchDepth > 0)
103 m_batchHadChanges = true;
104
105 Q_EMIT widgetCreated(info.id, info);
106
107 return info.id;
108}
109
110/**
111 * @brief Retrieves widget information by ID.

Callers 1

registerWidgetsMethod · 0.80

Calls 1

appendMethod · 0.45

Tested by

no test coverage detected