aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/qquickimagebase_p_p.h
diff options
context:
space:
mode:
authorMorten Johan Sørvig <morten.sorvig@digia.com>2013-08-19 13:29:43 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-03-20 22:12:24 +0100
commit63fb30eb29c26cd7ba0d9133610acb85cad83775 (patch)
treefb0d4870c3f2c22d14a90ad26956b8b6f45d3886 /src/quick/items/qquickimagebase_p_p.h
parent5277a60f56c83376c1f2e9d9d502f1793d8c4857 (diff)
Implement high-dpi "@2x" image handling.
Make QQuickBaseImage::load() load "@2x" image files on high-dpi displays. Reload images on screen change in order to load the correct version depending on screen dpi. Modify QQuickImageBase::updatePaintNode() to work with @2x images. QQuickBaseImage::load() now looks at the target window's devicePixelRatio and checks for the presence of a "@2x" file on disk. If found the @2x version will be used. Unlike QPixmap, QQuickPixmap has no special knowledge of "@2x" files. They pixmap system will be asked to load "@2x" files and will cache them and report the (device) pixel size, like any other pixmap. Add auto-test and manual test. Task-number: QTBUG-32862, QTBUG-33069 Change-Id: I1f57a10075e499f6eee61df5421e1986521c6ab0 Reviewed-by: Andy Nichols <andy.nichols@digia.com>
Diffstat (limited to 'src/quick/items/qquickimagebase_p_p.h')
-rw-r--r--src/quick/items/qquickimagebase_p_p.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/quick/items/qquickimagebase_p_p.h b/src/quick/items/qquickimagebase_p_p.h
index 395abf01fa..bb8778d789 100644
--- a/src/quick/items/qquickimagebase_p_p.h
+++ b/src/quick/items/qquickimagebase_p_p.h
@@ -69,6 +69,7 @@ public:
QQuickImageBasePrivate()
: status(QQuickImageBase::Null),
progress(0.0),
+ devicePixelRatio(1.0),
async(false),
cache(true),
mirror(false)
@@ -81,6 +82,7 @@ public:
qreal progress;
QSize sourcesize;
QSize oldSourceSize;
+ qreal devicePixelRatio;
bool async : 1;
bool cache : 1;
bool mirror: 1;