* @brief Updates widget metadata. */
| 217 | * @brief Updates widget metadata. |
| 218 | */ |
| 219 | void 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 | } |