QDeclarativeGuardedContextData
QDeclarativeGuardImpl
QDeclarativeHandlingSignalProfiler
- QDeclarativeImageProvider
- QDeclarativeImageProviderPrivate
QDeclarativeImportDatabase
QDeclarativeImportedNamespace
QDeclarativeImports
QDeclarativeGestureAreaParser
QDeclarativeGestureAreaPrivate
QDeclarativeGraphics
+ QDeclarativeImageProvider
+ QDeclarativeImageProviderPrivate
QDeclarativeItem
QDeclarativeItemAccessor
QDeclarativeItemChangeListener
$$PWD/qqmltypenamecache.cpp \
$$PWD/qqmlscriptstring.cpp \
$$PWD/qquickworkerscript.cpp \
- $$PWD/qqmlimageprovider.cpp \
$$PWD/qqmlnetworkaccessmanagerfactory.cpp \
$$PWD/qqmldirparser.cpp \
$$PWD/qqmlextensionplugin.cpp \
$$PWD/qqmlscriptstring.h \
$$PWD/qquickworkerscript_p.h \
$$PWD/qqmlguard_p.h \
- $$PWD/qqmlimageprovider.h \
$$PWD/qqmlnetworkaccessmanagerfactory.h \
$$PWD/qqmldirparser_p.h \
$$PWD/qqmlextensioninterface.h \
#include "qquickworkerscript_p.h"
#include "qqmlcomponent_p.h"
#include "qqmlnetworkaccessmanagerfactory.h"
-#include "qqmlimageprovider.h"
#include "qqmldirparser_p.h"
#include "qqmlextensioninterface.h"
#include "qqmllist_p.h"
qmlRegisterUncreatableType<QQmlLocale>("QtQuick",2,0,"Locale",QQmlEngine::tr("Locale cannot be instantiated. Use Qt.locale()"));
}
+
+QQmlImageProviderBase::~QQmlImageProviderBase()
+{
+}
+
+
/*!
\qmlclass Qt QQmlEnginePrivate
\ingroup qml-utility-elements
takes ownership of \a provider.
Image providers enable support for pixmap and threaded image
- requests. See the QQmlImageProvider documentation for details on
+ requests. See the QQuickImageProvider documentation for details on
implementing and using image providers.
All required image providers should be added to the engine before any
QML sources files are loaded.
- \sa removeImageProvider()
+ \sa removeImageProvider(), QQuickImageProvider
*/
-void QQmlEngine::addImageProvider(const QString &providerId, QQmlImageProvider *provider)
+void QQmlEngine::addImageProvider(const QString &providerId, QQmlImageProviderBase *provider)
{
Q_D(QQmlEngine);
QMutexLocker locker(&d->mutex);
- d->imageProviders.insert(providerId.toLower(), QSharedPointer<QQmlImageProvider>(provider));
+ d->imageProviders.insert(providerId.toLower(), QSharedPointer<QQmlImageProviderBase>(provider));
}
/*!
- Returns the QQmlImageProvider set for \a providerId.
+ Returns the image provider set for \a providerId.
Returns the provider if it was found; otherwise returns 0.
+
+ \sa QQuickImageProvider
*/
-QQmlImageProvider *QQmlEngine::imageProvider(const QString &providerId) const
+QQmlImageProviderBase *QQmlEngine::imageProvider(const QString &providerId) const
{
Q_D(const QQmlEngine);
QMutexLocker locker(&d->mutex);
}
/*!
- Removes the QQmlImageProvider for \a providerId.
+ Removes the image provider for \a providerId.
- \sa addImageProvider()
+ \sa addImageProvider(), QQuickImageProvider
*/
void QQmlEngine::removeImageProvider(const QString &providerId)
{
d->imageProviders.take(providerId);
}
-QQmlImageProvider::ImageType QQmlEnginePrivate::getImageProviderType(const QUrl &url)
-{
- QMutexLocker locker(&mutex);
- QSharedPointer<QQmlImageProvider> provider = imageProviders.value(url.host());
- locker.unlock();
- if (provider)
- return provider->imageType();
- return QQmlImageProvider::Invalid;
-}
-
-QQuickTextureFactory *QQmlEnginePrivate::getTextureFromProvider(const QUrl &url, QSize *size, const QSize& req_size)
-{
- QMutexLocker locker(&mutex);
- QSharedPointer<QQmlImageProvider> provider = imageProviders.value(url.host());
- locker.unlock();
- if (provider) {
- QString imageId = url.toString(QUrl::RemoveScheme | QUrl::RemoveAuthority).mid(1);
- return provider->requestTexture(imageId, size, req_size);
- }
- return 0;
-}
-
-QImage QQmlEnginePrivate::getImageFromProvider(const QUrl &url, QSize *size, const QSize& req_size)
-{
- QMutexLocker locker(&mutex);
- QImage image;
- QSharedPointer<QQmlImageProvider> provider = imageProviders.value(url.host());
- locker.unlock();
- if (provider) {
- QString imageId = url.toString(QUrl::RemoveScheme | QUrl::RemoveAuthority).mid(1);
- image = provider->requestImage(imageId, size, req_size);
- }
- return image;
-}
-
-QPixmap QQmlEnginePrivate::getPixmapFromProvider(const QUrl &url, QSize *size, const QSize& req_size)
-{
- QMutexLocker locker(&mutex);
- QPixmap pixmap;
- QSharedPointer<QQmlImageProvider> provider = imageProviders.value(url.host());
- locker.unlock();
- if (provider) {
- QString imageId = url.toString(QUrl::RemoveScheme | QUrl::RemoveAuthority).mid(1);
- pixmap = provider->requestPixmap(imageId, size, req_size);
- }
- return pixmap;
-}
-
/*!
Return the base URL for this engine. The base URL is only used to
resolve components when a relative URL is passed to the
QT_BEGIN_NAMESPACE
+class Q_QML_EXPORT QQmlImageProviderBase
+{
+public:
+ virtual ~QQmlImageProviderBase();
+};
+
class QQmlComponent;
class QQmlEnginePrivate;
class QQmlImportsPrivate;
class QQmlType;
class QUrl;
class QScriptContext;
-class QQmlImageProvider;
class QNetworkAccessManager;
class QQmlNetworkAccessManagerFactory;
class QQmlIncubationController;
QNetworkAccessManager *networkAccessManager() const;
- void addImageProvider(const QString &id, QQmlImageProvider *);
- QQmlImageProvider *imageProvider(const QString &id) const;
+ void addImageProvider(const QString &id, QQmlImageProviderBase *);
+ QQmlImageProviderBase *imageProvider(const QString &id) const;
void removeImageProvider(const QString &id);
void setIncubationController(QQmlIncubationController *);
#include "qqmlcontext.h"
#include "qqmlcontext_p.h"
#include "qqmlexpression.h"
-#include "qqmlimageprovider.h"
#include "qqmlproperty_p.h"
#include "qqmlpropertycache_p.h"
#include "qqmlmetatype_p.h"
mutable QNetworkAccessManager *networkAccessManager;
mutable QQmlNetworkAccessManagerFactory *networkAccessManagerFactory;
- QHash<QString,QSharedPointer<QQmlImageProvider> > imageProviders;
- QQmlImageProvider::ImageType getImageProviderType(const QUrl &url);
- QQuickTextureFactory *getTextureFromProvider(const QUrl &url, QSize *size, const QSize& req_size);
- QImage getImageFromProvider(const QUrl &url, QSize *size, const QSize& req_size);
- QPixmap getPixmapFromProvider(const QUrl &url, QSize *size, const QSize& req_size);
+ QHash<QString,QSharedPointer<QQmlImageProviderBase> > imageProviders;
// Scarce resources are "exceptionally high cost" QVariant types where allowing the
// normal JavaScript GC to clean them up is likely to lead to out-of-memory or other
#include <QGuiApplication>
#include <QOpenGLContext>
-#include <QQmlImageProvider>
#include <private/qqmlglobal_p.h>
#include <QtQuick/private/qsgtexture_p.h>
#define QSGCONTEXTPLUGIN_H
#include <QtQuick/qtquickglobal.h>
+#include <QtQuick/qquickimageprovider.h>
#include <QtCore/qplugin.h>
#include <QtCore/qfactoryinterface.h>
-#include <QQmlImageProvider>
-
QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
**
****************************************************************************/
-#include "qqmlimageprovider.h"
+#include "qquickimageprovider.h"
QT_BEGIN_NAMESPACE
-class QQmlImageProviderPrivate
+class QQuickImageProviderPrivate
{
public:
- QQmlImageProvider::ImageType type;
+ QQuickImageProvider::ImageType type;
};
/*!
/*!
- \class QQmlImageProvider
+ \class QQuickImageProvider
\since 4.7
- \brief The QQmlImageProvider class provides an interface for supporting pixmaps and threaded image requests in QML.
+ \brief The QQuickImageProvider class provides an interface for supporting pixmaps and threaded image requests in QML.
- QQmlImageProvider is used to provide advanced image loading features
+ QQuickImageProvider is used to provide advanced image loading features
in QML applications. It allows images in QML to be:
\list
\o Loaded using QPixmaps rather than actual image files
- \o Loaded asynchronously in a separate thread, if imageType() is \l{QQmlImageProvider::ImageType}{ImageType::Image}
+ \o Loaded asynchronously in a separate thread, if imageType() is \l{QQuickImageProvider::ImageType}{ImageType::Image}
\endlist
To specify that an image should be loaded by an image provider, use the
\section2 Image caching
- Images returned by a QQmlImageProvider are automatically cached,
+ Images returned by a QQuickImageProvider are automatically cached,
similar to any image loaded by the QML engine. When an image with a
"image://" prefix is loaded from cache, requestImage() and requestPixmap()
will not be called for the relevant image provider. If an image should always
*/
/*!
- \enum QQmlImageProvider::ImageType
+ \enum QQuickImageProvider::ImageType
Defines the type of image supported by this image provider.
/*!
Creates an image provider that will provide images of the given \a type.
*/
-QQmlImageProvider::QQmlImageProvider(ImageType type)
- : d(new QQmlImageProviderPrivate)
+QQuickImageProvider::QQuickImageProvider(ImageType type)
+ : d(new QQuickImageProviderPrivate)
{
d->type = type;
}
/*!
- Destroys the QQmlImageProvider
+ Destroys the QQuickImageProvider
\note The destructor of your derived class need to be thread safe.
*/
-QQmlImageProvider::~QQmlImageProvider()
+QQuickImageProvider::~QQuickImageProvider()
{
delete d;
}
/*!
Returns the image type supported by this provider.
*/
-QQmlImageProvider::ImageType QQmlImageProvider::imageType() const
+QQuickImageProvider::ImageType QQuickImageProvider::imageType() const
{
return d->type;
}
\note this method may be called by multiple threads, so ensure the
implementation of this method is reentrant.
*/
-QImage QQmlImageProvider::requestImage(const QString &id, QSize *size, const QSize& requestedSize)
+QImage QQuickImageProvider::requestImage(const QString &id, QSize *size, const QSize& requestedSize)
{
Q_UNUSED(id);
Q_UNUSED(size);
is used to set the \l {Item::}{width} and \l {Item::}{height} of the
relevant \l Image if these values have not been set explicitly.
*/
-QPixmap QQmlImageProvider::requestPixmap(const QString &id, QSize *size, const QSize& requestedSize)
+QPixmap QQuickImageProvider::requestPixmap(const QString &id, QSize *size, const QSize& requestedSize)
{
Q_UNUSED(id);
Q_UNUSED(size);
implementation of this method is reentrant.
*/
-QQuickTextureFactory *QQmlImageProvider::requestTexture(const QString &id, QSize *size, const QSize &requestedSize)
+QQuickTextureFactory *QQuickImageProvider::requestTexture(const QString &id, QSize *size, const QSize &requestedSize)
{
Q_UNUSED(id);
Q_UNUSED(size);
**
****************************************************************************/
-#ifndef QQMLIMAGEPROVIDER_H
-#define QQMLIMAGEPROVIDER_H
+#ifndef QQUICKIMAGEPROVIDER_H
+#define QQUICKIMAGEPROVIDER_H
-#include <QtQml/qtqmlglobal.h>
+#include <QtQuick/qtquickglobal.h>
#include <QtGui/qimage.h>
#include <QtGui/qpixmap.h>
+#include <QtQml/qqmlengine.h>
QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
-class QQmlImageProviderPrivate;
+class QQuickImageProviderPrivate;
class QSGTexture;
class QQuickCanvas;
-class Q_QML_EXPORT QQuickTextureFactory : public QObject
+class Q_QUICK_EXPORT QQuickTextureFactory : public QObject
{
public:
QQuickTextureFactory();
virtual int textureByteCount() const = 0;
};
-class Q_QML_EXPORT QQmlImageProvider
+class Q_QUICK_EXPORT QQuickImageProvider : public QQmlImageProviderBase
{
public:
enum ImageType {
Invalid
};
- QQmlImageProvider(ImageType type);
- virtual ~QQmlImageProvider();
+ QQuickImageProvider(ImageType type);
+ virtual ~QQuickImageProvider();
ImageType imageType() const;
virtual QQuickTextureFactory *requestTexture(const QString &id, QSize *size, const QSize &requestedSize);
private:
- QQmlImageProviderPrivate *d;
+ QQuickImageProviderPrivate *d;
};
QT_END_NAMESPACE
QT_END_HEADER
-#endif // QQMLIMAGEPROVIDER
+#endif // QQUICKIMAGEPROVIDER_H
#include "qquickpixmapcache_p.h"
#include <qqmlnetworkaccessmanagerfactory.h>
-#include <qqmlimageprovider.h>
+#include <qquickimageprovider.h>
#include <qqmlengine.h>
#include <private/qqmlglobal_p.h>
// The cache limit describes the maximum "junk" in the cache.
static int cache_limit = 2048 * 1024; // 2048 KB cache limit for embedded in qpixmapcache.cpp
+static inline QString imageProviderId(const QUrl &url)
+{
+ return url.host();
+}
+
+static inline QString imageId(const QUrl &url)
+{
+ return url.toString(QUrl::RemoveScheme | QUrl::RemoveAuthority).mid(1);
+}
+
QSGTexture *QQuickDefaultTextureFactory::createTexture(QQuickCanvas *) const
{
QSGPlainTexture *t = new QSGPlainTexture();
{
// fetch
if (url.scheme() == QLatin1String("image")) {
- // Use QmlImageProvider
+ // Use QQuickImageProvider
QSize readSize;
- QQmlEnginePrivate *ep = QQmlEnginePrivate::get(engine);
- QQmlImageProvider::ImageType imageType = ep->getImageProviderType(url);
- if (imageType == QQmlImageProvider::Invalid) {
+
+ QQuickImageProvider::ImageType imageType = QQuickImageProvider::Invalid;
+ QQuickImageProvider *provider = static_cast<QQuickImageProvider *>(engine->imageProvider(imageProviderId(url)));
+ if (provider)
+ imageType = provider->imageType();
+
+ if (imageType == QQuickImageProvider::Invalid) {
QQuickPixmapReply::ReadError errorCode = QQuickPixmapReply::Loading;
QString errorStr = QQuickPixmap::tr("Invalid image provider: %1").arg(url.toString());
QImage image;
if (!cancelled.contains(runningJob))
runningJob->postReply(errorCode, errorStr, readSize, image);
mutex.unlock();
- } else if (imageType == QQmlImageProvider::Image) {
- QImage image = ep->getImageFromProvider(url, &readSize, requestSize);
+ } else if (imageType == QQuickImageProvider::Image) {
+ QImage image = provider->requestImage(imageId(url), &readSize, requestSize);
QQuickPixmapReply::ReadError errorCode = QQuickPixmapReply::NoError;
QString errorStr;
if (image.isNull()) {
mutex.unlock();
} else {
- QQuickTextureFactory *t = ep->getTextureFromProvider(url, &readSize, requestSize);
+ QQuickTextureFactory *t = provider->requestTexture(imageId(url), &readSize, requestSize);
QQuickPixmapReply::ReadError errorCode = QQuickPixmapReply::NoError;
QString errorStr;
if (!t) {
{
if (url.scheme() == QLatin1String("image")) {
QSize readSize;
- QQmlEnginePrivate *ep = QQmlEnginePrivate::get(engine);
- QQmlImageProvider::ImageType imageType = ep->getImageProviderType(url);
+
+ QQuickImageProvider::ImageType imageType = QQuickImageProvider::Invalid;
+ QQuickImageProvider *provider = static_cast<QQuickImageProvider *>(engine->imageProvider(imageProviderId(url)));
+ if (provider)
+ imageType = provider->imageType();
switch (imageType) {
- case QQmlImageProvider::Invalid:
+ case QQuickImageProvider::Invalid:
return new QQuickPixmapData(declarativePixmap, url, requestSize,
QQuickPixmap::tr("Invalid image provider: %1").arg(url.toString()));
- case QQmlImageProvider::Texture:
+ case QQuickImageProvider::Texture:
{
- QQuickTextureFactory *texture = ep->getTextureFromProvider(url, &readSize, requestSize);
+ QQuickTextureFactory *texture = provider->requestTexture(imageId(url), &readSize, requestSize);
if (texture) {
*ok = true;
return new QQuickPixmapData(declarativePixmap, url, texture, QImage(), readSize, requestSize);
}
}
- case QQmlImageProvider::Image:
+ case QQuickImageProvider::Image:
{
- QImage image = ep->getImageFromProvider(url, &readSize, requestSize);
+ QImage image = provider->requestImage(imageId(url), &readSize, requestSize);
if (!image.isNull()) {
*ok = true;
return new QQuickPixmapData(declarativePixmap, url, image, readSize, requestSize);
}
}
- case QQmlImageProvider::Pixmap:
+ case QQuickImageProvider::Pixmap:
{
- QPixmap pixmap = ep->getPixmapFromProvider(url, &readSize, requestSize);
+ QPixmap pixmap = provider->requestPixmap(imageId(url), &readSize, requestSize);
if (!pixmap.isNull()) {
*ok = true;
return new QQuickPixmapData(declarativePixmap, url, pixmap.toImage(), readSize, requestSize);
if (iter == store->m_cache.end()) {
if (options & QQuickPixmap::Asynchronous) {
// pixmaps can only be loaded synchronously
- if (url.scheme() == QLatin1String("image")
- && QQmlEnginePrivate::get(engine)->getImageProviderType(url) == QQmlImageProvider::Pixmap) {
- options &= ~QQuickPixmap::Asynchronous;
+ if (url.scheme() == QLatin1String("image")) {
+ QQuickImageProvider *provider = static_cast<QQuickImageProvider *>(engine->imageProvider(imageProviderId(url)));
+ if (provider && provider->imageType() == QQuickImageProvider::Pixmap) {
+ options &= ~QQuickPixmap::Asynchronous;
+ }
}
}
#include <QtGui/qpixmap.h>
#include <QtCore/qurl.h>
#include <QtQuick/qtquickglobal.h>
+#include <QtQuick/qquickimageprovider.h>
#include <private/qintrusivelist_p.h>
-#include <qqmlimageprovider.h>
QT_BEGIN_HEADER
$$PWD/qquickchangeset.cpp \
$$PWD/qquicklistcompositor.cpp \
$$PWD/qquickpathinterpolator.cpp \
+ $$PWD/qquickimageprovider.cpp \
$$PWD/qquicksvgparser.cpp
HEADERS += \
$$PWD/qquickchangeset_p.h \
$$PWD/qquicklistcompositor_p.h \
$$PWD/qquickpathinterpolator_p.h \
+ $$PWD/qquickimageprovider.h \
$$PWD/qquicksvgparser_p.h
qqmlcpputils \
qqmlecmascript \
qqmlexpression \
- qqmlimageprovider \
qqmlinstruction \
qqmllanguage \
qqmlproperty \
CONFIG += testcase
-TARGET = tst_qqmlimageprovider
+TARGET = tst_qquickimageprovider
macx:CONFIG -= app_bundle
-SOURCES += tst_qqmlimageprovider.cpp
+SOURCES += tst_qquickimageprovider.cpp
CONFIG += parallel_test
#include <qtest.h>
#include <QtTest/QtTest>
#include <QtQml/qqmlengine.h>
-#include <QtQml/qqmlimageprovider.h>
+#include <QtQuick/qquickimageprovider.h>
#include <private/qquickimage_p.h>
#include <QImageReader>
#include <QWaitCondition>
-Q_DECLARE_METATYPE(QQmlImageProvider*);
+Q_DECLARE_METATYPE(QQuickImageProvider*);
-class tst_qqmlimageprovider : public QObject
+class tst_qquickimageprovider : public QObject
{
Q_OBJECT
public:
- tst_qqmlimageprovider()
+ tst_qquickimageprovider()
{
}
private:
QString newImageFileName() const;
void fillRequestTestsData(const QString &id);
- void runTest(bool async, QQmlImageProvider *provider);
+ void runTest(bool async, QQuickImageProvider *provider);
};
-class TestQImageProvider : public QQmlImageProvider
+class TestQImageProvider : public QQuickImageProvider
{
public:
TestQImageProvider(bool *deleteWatch = 0)
- : QQmlImageProvider(Image), deleteWatch(deleteWatch)
+ : QQuickImageProvider(Image), deleteWatch(deleteWatch)
{
}
Q_DECLARE_METATYPE(TestQImageProvider*);
-class TestQPixmapProvider : public QQmlImageProvider
+class TestQPixmapProvider : public QQuickImageProvider
{
public:
TestQPixmapProvider(bool *deleteWatch = 0)
- : QQmlImageProvider(Pixmap), deleteWatch(deleteWatch)
+ : QQuickImageProvider(Pixmap), deleteWatch(deleteWatch)
{
}
Q_DECLARE_METATYPE(TestQPixmapProvider*);
-QString tst_qqmlimageprovider::newImageFileName() const
+QString tst_qquickimageprovider::newImageFileName() const
{
// need to generate new filenames each time or else images are loaded
// from cache and we won't get loading status changes when testing
return QString("image://test/image-%1.png").arg(count++);
}
-void tst_qqmlimageprovider::fillRequestTestsData(const QString &id)
+void tst_qquickimageprovider::fillRequestTestsData(const QString &id)
{
QTest::addColumn<QString>("source");
QTest::addColumn<QString>("imageId");
<< "file::2:1: QML Image: Invalid image provider: image://bogus/exists.png";
}
-void tst_qqmlimageprovider::runTest(bool async, QQmlImageProvider *provider)
+void tst_qquickimageprovider::runTest(bool async, QQuickImageProvider *provider)
{
QFETCH(QString, source);
QFETCH(QString, imageId);
delete obj;
}
-void tst_qqmlimageprovider::requestImage_sync_data()
+void tst_qquickimageprovider::requestImage_sync_data()
{
fillRequestTestsData("qimage|sync");
}
-void tst_qqmlimageprovider::requestImage_sync()
+void tst_qquickimageprovider::requestImage_sync()
{
bool deleteWatch = false;
runTest(false, new TestQImageProvider(&deleteWatch));
QVERIFY(deleteWatch);
}
-void tst_qqmlimageprovider::requestImage_async_data()
+void tst_qquickimageprovider::requestImage_async_data()
{
fillRequestTestsData("qimage|async");
}
-void tst_qqmlimageprovider::requestImage_async()
+void tst_qquickimageprovider::requestImage_async()
{
bool deleteWatch = false;
runTest(true, new TestQImageProvider(&deleteWatch));
QVERIFY(deleteWatch);
}
-void tst_qqmlimageprovider::requestPixmap_sync_data()
+void tst_qquickimageprovider::requestPixmap_sync_data()
{
fillRequestTestsData("qpixmap");
}
-void tst_qqmlimageprovider::requestPixmap_sync()
+void tst_qquickimageprovider::requestPixmap_sync()
{
bool deleteWatch = false;
runTest(false, new TestQPixmapProvider(&deleteWatch));
QVERIFY(deleteWatch);
}
-void tst_qqmlimageprovider::requestPixmap_async()
+void tst_qquickimageprovider::requestPixmap_async()
{
QQmlEngine engine;
- QQmlImageProvider *provider = new TestQPixmapProvider();
+ QQuickImageProvider *provider = new TestQPixmapProvider();
engine.addImageProvider("test", provider);
QVERIFY(engine.imageProvider("test") != 0);
delete obj;
}
-void tst_qqmlimageprovider::removeProvider_data()
+void tst_qquickimageprovider::removeProvider_data()
{
- QTest::addColumn<QQmlImageProvider*>("provider");
+ QTest::addColumn<QQuickImageProvider*>("provider");
- QTest::newRow("qimage") << static_cast<QQmlImageProvider*>(new TestQImageProvider);
- QTest::newRow("qpixmap") << static_cast<QQmlImageProvider*>(new TestQPixmapProvider);
+ QTest::newRow("qimage") << static_cast<QQuickImageProvider*>(new TestQImageProvider);
+ QTest::newRow("qpixmap") << static_cast<QQuickImageProvider*>(new TestQPixmapProvider);
}
-void tst_qqmlimageprovider::removeProvider()
+void tst_qquickimageprovider::removeProvider()
{
- QFETCH(QQmlImageProvider*, provider);
+ QFETCH(QQuickImageProvider*, provider);
QQmlEngine engine;
delete obj;
}
-class TestThreadProvider : public QQmlImageProvider
+class TestThreadProvider : public QQuickImageProvider
{
public:
- TestThreadProvider() : QQmlImageProvider(Image), ok(false) {}
+ TestThreadProvider() : QQuickImageProvider(Image), ok(false) {}
~TestThreadProvider() {}
};
-void tst_qqmlimageprovider::threadTest()
+void tst_qquickimageprovider::threadTest()
{
QQmlEngine engine;
}
-QTEST_MAIN(tst_qqmlimageprovider)
+QTEST_MAIN(tst_qquickimageprovider)
-#include "tst_qqmlimageprovider.moc"
+#include "tst_qquickimageprovider.moc"
#include <QtTest/QtTest>
#include <QtQuick/private/qquickpixmapcache_p.h>
#include <QtQml/qqmlengine.h>
-#include <QtQml/qqmlimageprovider.h>
+#include <QtQuick/qquickimageprovider.h>
#include <QNetworkReply>
#include "../../shared/util.h"
#include "testhttpserver.h"
}
}
-class MyPixmapProvider : public QQmlImageProvider
+class MyPixmapProvider : public QQuickImageProvider
{
public:
MyPixmapProvider()
- : QQmlImageProvider(Pixmap) {}
+ : QQuickImageProvider(Pixmap) {}
virtual QPixmap requestPixmap(const QString &d, QSize *, const QSize &) {
Q_UNUSED(d)
qquickapplication \
qquickbehaviors \
qquickfontloader \
+ qquickimageprovider \
qquickpath \
qquicksmoothedanimation \
qquickspringanimation \