diff options
author | Bea Lam <bea.lam@nokia.com> | 2010-07-08 03:19:22 (GMT) |
---|---|---|
committer | Bea Lam <bea.lam@nokia.com> | 2010-07-08 04:07:39 (GMT) |
commit | a258456bcb35ec4211751a702ea94a1881d82a07 (patch) | |
tree | ca7dc7ded5b23aac34247694a06a9bf910e2384e /src/declarative/qml/qdeclarativeimageprovider.h | |
parent | 3d8db76427efd74e1668b2743381d724453da5d6 (diff) | |
download | Qt-a258456bcb35ec4211751a702ea94a1881d82a07.zip Qt-a258456bcb35ec4211751a702ea94a1881d82a07.tar.gz Qt-a258456bcb35ec4211751a702ea94a1881d82a07.tar.bz2 |
Extend QDeclarativeImageProvider to support QPixmap loading and
synchronous loading of QImages. (QPixmaps can only be created in the
main thread so they will always be loaded synchronously).
This changes request() to requestImage() and adds requestPixmap()
for pixmap support.
Task-number: QTBUG-11989
Diffstat (limited to 'src/declarative/qml/qdeclarativeimageprovider.h')
-rw-r--r-- | src/declarative/qml/qdeclarativeimageprovider.h | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/declarative/qml/qdeclarativeimageprovider.h b/src/declarative/qml/qdeclarativeimageprovider.h index cc9c9af..5a72943 100644 --- a/src/declarative/qml/qdeclarativeimageprovider.h +++ b/src/declarative/qml/qdeclarativeimageprovider.h @@ -43,6 +43,7 @@ #define QDECLARATIVEIMAGEPROVIDER_H #include <QtGui/qimage.h> +#include <QtGui/qpixmap.h> QT_BEGIN_HEADER @@ -50,11 +51,26 @@ QT_BEGIN_NAMESPACE QT_MODULE(Declarative) +class QDeclarativeImageProviderPrivate; + class Q_DECLARATIVE_EXPORT QDeclarativeImageProvider { public: + enum ImageType { + Image, + Pixmap + }; + + QDeclarativeImageProvider(ImageType type); virtual ~QDeclarativeImageProvider(); - virtual QImage request(const QString &id, QSize *size, const QSize& requestedSize) = 0; + + ImageType imageType() const; + + virtual QImage requestImage(const QString &id, QSize *size, const QSize& requestedSize); + virtual QPixmap requestPixmap(const QString &id, QSize *size, const QSize& requestedSize); + +private: + QDeclarativeImageProviderPrivate *d; }; QT_END_NAMESPACE |