diff options
author | Morten Johan Sørvig <morten.sorvig@digia.com> | 2014-05-19 22:56:13 +0200 |
---|---|---|
committer | Morten Johan Sørvig <morten.sorvig@digia.com> | 2014-07-03 09:15:42 +0200 |
commit | 5f3ec26d90c239420d7865cba91e625283f08ba1 (patch) | |
tree | 33899ce5dfa98114ace1dac16665063825cf94cd /src/gui/image/qicon.cpp | |
parent | 19d289ab1b5bde3e136765e5432b5c7d004df3a4 (diff) |
Add opt-out environment variable for @2x images
There are cases where @2x images are in use but
where you don't want the associated behavior:
- You are implementing an image editor
- You are inheriting a resource set which has @2x
images, but don't want that behavior with Qt.
Add support for disabling @2x behavior with QT_HIGHDPI_DISABLE_2X_IMAGE_LOADING.
Change-Id: I206e050b6241f8935b4404c7a28b024a9e00d46c
Task-id: QTBUG-38485
Reviewed-by: Jake Petroules <jake.petroules@petroules.com>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
Diffstat (limited to 'src/gui/image/qicon.cpp')
-rw-r--r-- | src/gui/image/qicon.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/gui/image/qicon.cpp b/src/gui/image/qicon.cpp index 8172ecbb48..681e7e3f79 100644 --- a/src/gui/image/qicon.cpp +++ b/src/gui/image/qicon.cpp @@ -1026,7 +1026,8 @@ void QIcon::addFile(const QString &fileName, const QSize &size, Mode mode, State d->engine->addFile(fileName, size, mode, state); // Check if a "@2x" file exists and add it. - if (qApp->devicePixelRatio() > 1.0) { + static bool disable2xImageLoading = !qgetenv("QT_HIGHDPI_DISABLE_2X_IMAGE_LOADING").isEmpty(); + if (!disable2xImageLoading && qApp->devicePixelRatio() > 1.0) { int dotIndex = fileName.lastIndexOf(QLatin1Char('.')); if (dotIndex != -1) { QString at2xfileName = fileName; |