aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/qquickimagebase_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.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.h')
-rw-r--r--src/quick/items/qquickimagebase_p.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/quick/items/qquickimagebase_p.h b/src/quick/items/qquickimagebase_p.h
index 72258b4971..67f1e81cae 100644
--- a/src/quick/items/qquickimagebase_p.h
+++ b/src/quick/items/qquickimagebase_p.h
@@ -86,6 +86,8 @@ public:
virtual void setMirror(bool mirror);
bool mirror() const;
+ void resolve2xLocalFile(const QUrl &url, qreal targetDevicePixelRatio, QUrl *sourceUrl, qreal *sourceDevicePixelRatio);
+
Q_SIGNALS:
void sourceChanged(const QUrl &);
void sourceSizeChanged();
@@ -104,6 +106,8 @@ protected:
private Q_SLOTS:
virtual void requestFinished();
void requestProgress(qint64,qint64);
+ void handleWindowChanged(QQuickWindow *window);
+ void handleScreenChanged(QScreen *);
private:
Q_DISABLE_COPY(QQuickImageBase)