From 2bb83f6b16d08d2c30bc6fbb226ad8033f312e88 Mon Sep 17 00:00:00 2001 From: Christian Ehrlicher Date: Wed, 11 Dec 2024 19:22:09 +0100 Subject: [PATCH] QIcon: don't search for high-res svg icons There is no need to search for high-res svg icons - a svg scalable by design. Also the QSvgIconEngine does not support it. Pick-to: 6.8 Change-Id: Ib76c887900ce77268e9c0253cb697b8de9e7f10e Reviewed-by: Volker Hilsheimer (cherry picked from commit c64774eef72411029f7c2fb611328f25b83ff8ca) Reviewed-by: Qt Cherry-pick Bot --- src/gui/image/qicon.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/gui/image/qicon.cpp b/src/gui/image/qicon.cpp index c8cb455a4e7..acb059d7aba 100644 --- a/src/gui/image/qicon.cpp +++ b/src/gui/image/qicon.cpp @@ -1187,6 +1187,9 @@ void QIcon::addFile(const QString &fileName, const QSize &size, Mode mode, State if (!alreadyAdded) d->engine->addFile(fileName, size, mode, state); + if (d->engine->key() == "svg"_L1) // not needed and also not supported + return; + // Check if a "@Nx" file exists and add it. QString atNxFileName = qt_findAtNxFile(fileName, qApp->devicePixelRatio()); if (atNxFileName != fileName)