mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-09-29 22:24:13 +02:00
34a2ceff70
Saving an element from the element editor calls ElementsCollectionWidget::locationWasSaved(), which runs clearData() on the panel item: the icon is set to a null QIcon. The icon only comes back through FileElementCollectionItem::setUpIcon(), but since the #633 recursion guard that returns for good once m_icon_initialized is set, and nothing ever reset it. The row stayed without an icon until the whole collection was reloaded. #1008 refreshed the picture caches on save, but no one asked them for the new picture, so it could not fix this. Resetting the flag in clearData() lets the next paint rebuild the icon, which then comes from those refreshed caches, so the panel shows the new drawing. The flag is reset after the base clearData(): its setIcon() emits dataChanged(), which re-enters setUpIcon() and must still return early. setUpIcon() sets the flag before its own setIcon(), so the #633 guard is unchanged. The same reset should also bring back a folder's icon after editing its properties (editDirectory() calls clearData() too); read, not tested. Project collection items were never affected: their setUpIcon() guards on icon().isNull(). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>