summaryrefslogtreecommitdiffstats
path: root/src/gui/image/qiconloader.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/image/qiconloader.cpp')
-rw-r--r--src/gui/image/qiconloader.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/gui/image/qiconloader.cpp b/src/gui/image/qiconloader.cpp
index 228de3adc3..1d0c93f26f 100644
--- a/src/gui/image/qiconloader.cpp
+++ b/src/gui/image/qiconloader.cpp
@@ -50,7 +50,9 @@
#include <QtCore/qmath.h>
#include <QtCore/QList>
#include <QtCore/QDir>
+#if QT_CONFIG(settings)
#include <QtCore/QSettings>
+#endif
#include <QtGui/QPainter>
#include <private/qhexstring_p.h>
@@ -348,7 +350,7 @@ QIconTheme::QIconTheme(const QString &themeName)
m_valid = true;
}
}
-#ifndef QT_NO_SETTINGS
+#if QT_CONFIG(settings)
if (themeIndex.exists()) {
const QSettings indexReader(themeIndex.fileName(), QSettings::IniFormat);
const QStringList keys = indexReader.allKeys();
@@ -407,7 +409,7 @@ QIconTheme::QIconTheme(const QString &themeName)
if (!m_parents.contains(QLatin1String("hicolor")))
m_parents.append(QLatin1String("hicolor"));
}
-#endif //QT_NO_SETTINGS
+#endif // settings
}
QThemeIconInfo QIconLoader::findIconHelper(const QString &themeName,
@@ -627,7 +629,10 @@ void QIconLoaderEngine::ensureLoaded()
void QIconLoaderEngine::paint(QPainter *painter, const QRect &rect,
QIcon::Mode mode, QIcon::State state)
{
- QSize pixmapSize = rect.size();
+ const qreal dpr = !qApp->testAttribute(Qt::AA_UseHighDpiPixmaps) ?
+ qreal(1.0) : painter->device()->devicePixelRatioF();
+
+ QSize pixmapSize = rect.size() * dpr;
painter->drawPixmap(rect, pixmap(pixmapSize, mode, state));
}