aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2019-07-05 16:45:34 +0200
committerSimon Hausmann <simon.hausmann@qt.io>2019-07-11 08:36:18 +0000
commitb5d18be5a03406d0aac83856dd41e1525fd14a28 (patch)
treedd6eff4209d315367e1c310378505f6378c2a26e
parent38bbe49815df7b4ef8a035a76db582c7b7948839 (diff)
Do minimal fixup of QQuickImageProvider
This change removes ifdefs around the methods in QQuickImageProvider, to allow building qtdeclarative both in Qt5 and Qt6. QQuickImageProvideWithOptions still needs to be fixed properly. Amends 9c50216c7bbbdb2bb51d4485286bf09e12fb5b62. Change-Id: Id1c64f05139f872c704d732d8fe081a70de6b201 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
-rw-r--r--src/quick/util/qquickimageprovider.h14
-rw-r--r--src/quick/util/qquickpixmapcache_p.h4
2 files changed, 5 insertions, 13 deletions
diff --git a/src/quick/util/qquickimageprovider.h b/src/quick/util/qquickimageprovider.h
index 82d0501697..f3dba81446 100644
--- a/src/quick/util/qquickimageprovider.h
+++ b/src/quick/util/qquickimageprovider.h
@@ -92,9 +92,11 @@ private:
Q_PRIVATE_SLOT(d_func(), void _q_finished())
};
+class QQuickImageProviderOptions;
+
class Q_QUICK_EXPORT QQuickImageProvider : public QQmlImageProviderBase
{
- friend class QQuickImageProviderWithOptions; // ### Qt 6 Remove
+ friend class QQuickImageProviderWithOptions;
public:
QQuickImageProvider(ImageType type, Flags flags = Flags());
~QQuickImageProvider() override;
@@ -102,15 +104,9 @@ public:
ImageType imageType() const override;
Flags flags() const override;
-#if QT_VERSION >= QT_VERSION_CHECK(6,0,0)
- virtual QImage requestImage(const QString &id, QSize *size, const QSize& requestedSize, const QQuickImageProviderOptions &options);
- virtual QPixmap requestPixmap(const QString &id, QSize *size, const QSize& requestedSize, const QQuickImageProviderOptions &options);
- virtual QQuickTextureFactory *requestTexture(const QString &id, QSize *size, const QSize &requestedSize, const QQuickImageProviderOptions &options);
-#else
virtual QImage requestImage(const QString &id, QSize *size, const QSize& requestedSize);
virtual QPixmap requestPixmap(const QString &id, QSize *size, const QSize& requestedSize);
virtual QQuickTextureFactory *requestTexture(const QString &id, QSize *size, const QSize &requestedSize);
-#endif
private:
QQuickImageProviderPrivate *d;
@@ -122,11 +118,7 @@ public:
QQuickAsyncImageProvider();
~QQuickAsyncImageProvider() override;
-#if QT_VERSION >= QT_VERSION_CHECK(6,0,0)
- virtual QQuickImageResponse *requestImageResponse(const QString &id, const QSize &requestedSize, const QQuickImageProviderOptions &options) = 0;
-#else
virtual QQuickImageResponse *requestImageResponse(const QString &id, const QSize &requestedSize) = 0;
-#endif
private:
QQuickAsyncImageProviderPrivate *d;
diff --git a/src/quick/util/qquickpixmapcache_p.h b/src/quick/util/qquickpixmapcache_p.h
index 91fb1ed3bb..f51b65dd76 100644
--- a/src/quick/util/qquickpixmapcache_p.h
+++ b/src/quick/util/qquickpixmapcache_p.h
@@ -188,8 +188,8 @@ private:
Q_DECLARE_OPERATORS_FOR_FLAGS(QQuickPixmap::Options)
-// This class will disappear with Qt6 and will just be the regular QQuickImageProvider
-// ### Qt 6: Remove this class and fold it with QQuickImageProvider
+// ### Qt 6: This should be made public in Qt 6. It's functionality can't be merged into
+// QQuickImageProvider without breaking source compatibility.
class Q_QUICK_PRIVATE_EXPORT QQuickImageProviderWithOptions : public QQuickAsyncImageProvider
{
public: