diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/image/qicon.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/gui/image/qicon.cpp b/src/gui/image/qicon.cpp index 683fe51d2b..d73cd0aa57 100644 --- a/src/gui/image/qicon.cpp +++ b/src/gui/image/qicon.cpp @@ -958,6 +958,17 @@ void QIcon::addFile(const QString &fileName, const QSize &size, Mode mode, State detach(); } d->engine->addFile(fileName, size, mode, state); + + // Check if a "@2x" file exists and add it. + if (qApp->devicePixelRatio() > 1.0) { + int dotIndex = fileName.lastIndexOf(QLatin1Char('.')); + if (dotIndex != -1) { + QString at2xfileName = fileName; + at2xfileName.insert(dotIndex, QStringLiteral("@2x")); + if (QFile::exists(at2xfileName)) + d->engine->addFile(at2xfileName, size, mode, state); + } + } } /*! |