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

Method updateWidget

app/src/UI/WidgetRegistry.cpp:219–249  ·  view source on GitHub ↗

* @brief Updates widget metadata. */

Source from the content-addressed store, hash-verified

217 * @brief Updates widget metadata.
218 */
219void UI::WidgetRegistry::updateWidget(UI::WidgetID id,
220 const QString& title,
221 const QString& icon,
222 const QVariant& userData)
223{
224 if (!m_widgets.contains(id))
225 return;
226
227 WidgetInfo& info = m_widgets[id];
228 bool changed = false;
229
230 if (!title.isEmpty() && info.title != title) {
231 info.title = title;
232 changed = true;
233 }
234
235 if (!icon.isEmpty() && info.icon != icon) {
236 info.icon = icon;
237 changed = true;
238 }
239
240 if (userData.isValid()) {
241 info.userData = userData;
242 changed = true;
243 }
244
245 if (changed)
246 Q_EMIT widgetUpdated(id, info);
247
248 return;
249}

Callers

nothing calls this directly

Calls 3

isEmptyMethod · 0.80
containsMethod · 0.45
isValidMethod · 0.45

Tested by

no test coverage detected