Fix crash when collapse root item of macro element tree view

Add an icon to the macro type of FileElementCollectionItem.

The first time the model (ElementsCollectionModel) ask for decoration
role the FileElementCollectionItem check if icon is null, if true the
icon is set, if false the function return.

In the case of the macro type, befor this commit the macro have a null
icon, and so the setIcon is call each time (many) the mouse move hover
and cause a qet crash.
This commit fix that, only by setUp an icon
This commit is contained in:
joshua
2026-05-06 00:20:07 +02:00
parent 6f669e1074
commit 2d4f968348

View File

@@ -361,7 +361,7 @@ void FileElementCollectionItem::setUpIcon()
setIcon(QET::Icons::Folder);
} else {
if (m_path.endsWith(".qetmak")) {
setIcon(QIcon());
setIcon(QET::Icons::PartRectangle);
} else {
ElementsLocation loc(collectionPath());
setIcon(loc.icon());