Projects: Create QIcons in the UI thread

Creating QIcons elsewhere is not safe because of image reader plugin
loading and the pixmap cache.

Fixes: QTCREATORBUG-25301
Change-Id: Ia22a0cd571f808d7f5c639353fdf2e548743f8ca
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
This commit is contained in:
Eike Ziller
2021-04-08 16:31:31 +02:00
parent f4ab1279fd
commit bce81fd992
9 changed files with 116 additions and 41 deletions

View File

@@ -40,8 +40,7 @@ QmlProjectNode::QmlProjectNode(Project *project)
{
setDisplayName(project->projectFilePath().toFileInfo().completeBaseName());
static QIcon qmlProjectIcon = Core::FileIconProvider::directoryIcon(":/projectexplorer/images/fileoverlay_qml.png");
setIcon(qmlProjectIcon);
setIcon(DirectoryIcon(":/projectexplorer/images/fileoverlay_qml.png"));
}
} // namespace Internal