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

@@ -474,7 +474,8 @@ FolderNode *createSourceGroupNode(const QString &sourceGroupName,
if (!existingNode) {
auto node = createCMakeVFolder(sourceDirectory, Node::DefaultFolderPriority + 5, p);
node->setListInProject(false);
node->setIcon(QIcon::fromTheme("edit-copy", ::Utils::Icons::COPY.icon()));
node->setIcon(
[] { return QIcon::fromTheme("edit-copy", ::Utils::Icons::COPY.icon()); });
existingNode = node.get();