aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/qquickimagebase_p_p.h
diff options
context:
space:
mode:
authorMitch Curtis <mitch.curtis@qt.io>2017-02-16 12:38:51 +0100
committerMitch Curtis <mitch.curtis@qt.io>2017-02-24 10:40:09 +0000
commitdca1f953264a373cbbe42adccb93fea84b96af51 (patch)
tree76f0f89428ee4fbe497ab3b4c7f8bb8c99f735cb /src/quick/items/qquickimagebase_p_p.h
parentfebb1f721f720bb9f32bb60c711f709faadb366a (diff)
QQuickImageBase: allow derived classes to affect devicePixelRatio usage
QQuickImageBase currently sets its d->devicePixelRatio member in three scenarios: - The URL uses the image: scheme (an image provider) - The URL is an svg/svgz - The URL contains the "@2x" syntax In all other cases, it sets d->devicePixelRatio to 1.0. QQuickIconImage derives from QQuickImageBase, and can display theme icons in addition to regular images. Theme icons have their own directory structure that determines what is and is not a high DPI image: https://standards.freedesktop.org/icon-theme-spec/icon-theme-spec-latest.html In particular, they use e.g. a 22x22@2 directory to indicate that the icons contained within it are high DPI images, as opposed to storing that information in the file name. To account for these images, QQuickIconImage must be able to affect the decision making progress that determines whether or not an image is loaded at a higher DPI. This patch adds a virtual function to QQuickImageBasePrivate that allows subclasses to have some control over this. Change-Id: Id45e0580c8e2ea9a96a41c54ef5fa765ce5922cf Reviewed-by: J-P Nurmi <jpnurmi@qt.io> Reviewed-by: Robin Burchell <robin.burchell@crimson.no>
Diffstat (limited to 'src/quick/items/qquickimagebase_p_p.h')
-rw-r--r--src/quick/items/qquickimagebase_p_p.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/quick/items/qquickimagebase_p_p.h b/src/quick/items/qquickimagebase_p_p.h
index d9b609c7fe..1b771166a2 100644
--- a/src/quick/items/qquickimagebase_p_p.h
+++ b/src/quick/items/qquickimagebase_p_p.h
@@ -59,7 +59,7 @@
QT_BEGIN_NAMESPACE
class QNetworkReply;
-class QQuickImageBasePrivate : public QQuickImplicitSizeItemPrivate
+class Q_QUICK_PRIVATE_EXPORT QQuickImageBasePrivate : public QQuickImplicitSizeItemPrivate
{
Q_DECLARE_PUBLIC(QQuickImageBase)
@@ -75,6 +75,8 @@ public:
{
}
+ virtual bool updateDevicePixelRatio(qreal targetDevicePixelRatio);
+
QQuickPixmap pix;
QQuickImageBase::Status status;
QUrl url;