* @brief Destroys a widget and removes it from the registry. */
| 200 | * @brief Destroys a widget and removes it from the registry. |
| 201 | */ |
| 202 | void UI::WidgetRegistry::destroyWidget(UI::WidgetID id) |
| 203 | { |
| 204 | if (!m_widgets.contains(id)) |
| 205 | return; |
| 206 | |
| 207 | Q_EMIT widgetDestroyed(id); |
| 208 | |
| 209 | m_widgets.remove(id); |
| 210 | m_widgetOrder.removeOne(id); |
| 211 | |
| 212 | if (m_batchDepth > 0) |
| 213 | m_batchHadChanges = true; |
| 214 | } |
| 215 | |
| 216 | /** |
| 217 | * @brief Updates widget metadata. |