diff options
author | Shawn Rutledge <shawn.rutledge@qt.io> | 2019-07-04 10:27:19 +0200 |
---|---|---|
committer | Shawn Rutledge <shawn.rutledge@qt.io> | 2019-08-23 19:08:08 +0200 |
commit | f6393ed0e4608bad4653f524c188bdc928e2d3b7 (patch) | |
tree | 45111b70199e89c421b40e3c42d23e5c5141a281 /src/quick/items/qquickimagebase.cpp | |
parent | c763c5bbe6d0d3cf033fdae48eae068962e95a5f (diff) |
QQuickImageBase: prepare for rescalable PDF as an image format
QQuickImageBasePrivate::updateDevicePixelRatio() assumes that only
SVG or an image provider can provide a scalable image. Now that PDF
will be supported, we can add it to the list.
Change-Id: I9a6df7c58cb9db0e8d4d159c138bedd481281d92
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Diffstat (limited to 'src/quick/items/qquickimagebase.cpp')
-rw-r--r-- | src/quick/items/qquickimagebase.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/quick/items/qquickimagebase.cpp b/src/quick/items/qquickimagebase.cpp index 729d326625..40857964a9 100644 --- a/src/quick/items/qquickimagebase.cpp +++ b/src/quick/items/qquickimagebase.cpp @@ -55,7 +55,7 @@ QT_BEGIN_NAMESPACE // if they're not happy with our implementation of it. bool QQuickImageBasePrivate::updateDevicePixelRatio(qreal targetDevicePixelRatio) { - // QQuickImageProvider and SVG can generate a high resolution image when + // QQuickImageProvider and SVG and PDF can generate a high resolution image when // sourceSize is set (this function is only called if it's set). // If sourceSize is not set then the provider default size will be used, as usual. bool setDevicePixelRatio = false; @@ -64,7 +64,8 @@ bool QQuickImageBasePrivate::updateDevicePixelRatio(qreal targetDevicePixelRatio } else { QString stringUrl = url.path(QUrl::PrettyDecoded); if (stringUrl.endsWith(QLatin1String("svg")) || - stringUrl.endsWith(QLatin1String("svgz"))) { + stringUrl.endsWith(QLatin1String("svgz")) || + stringUrl.endsWith(QLatin1String("pdf"))) { setDevicePixelRatio = true; } } |