aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/util/qquickimageprovider.cpp
diff options
context:
space:
mode:
authorEirik Aavitsland <eirik.aavitsland@qt.io>2017-03-23 16:19:51 +0100
committerEirik Aavitsland <eirik.aavitsland@qt.io>2017-04-06 10:17:34 +0000
commita182a659b54dddb865dd573e5411c3fe710b32fe (patch)
tree889e2b889595bfd318eae9fb02c84738deaed9a5 /src/quick/util/qquickimageprovider.cpp
parentfcb9a740787084f1549df6d4d93d2c3886d39acd (diff)
Use new ImageProviderWithOptions also for sync image loading
When the new extended image provider api was added, only the async image loading function was changed to use it. This commit makes also the sync image loading function check for the new api, and use it if the provider implements it. Change-Id: I982e4de05b8119e1668e2b982d2d62b03a52b302 Reviewed-by: Albert Astals Cid <albert.astals@canonical.com> Reviewed-by: Robin Burchell <robin.burchell@crimson.no>
Diffstat (limited to 'src/quick/util/qquickimageprovider.cpp')
-rw-r--r--src/quick/util/qquickimageprovider.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/quick/util/qquickimageprovider.cpp b/src/quick/util/qquickimageprovider.cpp
index 56b2d7070d..457691ac61 100644
--- a/src/quick/util/qquickimageprovider.cpp
+++ b/src/quick/util/qquickimageprovider.cpp
@@ -695,5 +695,13 @@ QSize QQuickImageProviderWithOptions::loadSize(const QSize &originalSize, const
return res;
}
+QQuickImageProviderWithOptions *QQuickImageProviderWithOptions::checkedCast(QQuickImageProvider *provider)
+{
+ if (provider && provider->d && provider->d->isProviderWithOptions)
+ return static_cast<QQuickImageProviderWithOptions *>(provider);
+
+ return nullptr;
+}
+
QT_END_NAMESPACE