aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMatthew Vogt <matthew.vogt@nokia.com>2012-03-05 17:01:33 +1000
committerQt by Nokia <qt-info@nokia.com>2012-03-07 02:33:24 +0100
commit3bc907d155034fe64efc8cb6056b48f0c6401bfb (patch)
treea1fb0ddfa50f136e66a177e3147546690a0c429e /tests
parentcd0c9ae4ccc43503b6d8fb93bc87092cfa328adc (diff)
Remove uses of QtGui symbols in QQmlEngine.
Move the code dealing with QImage and QPixmap out of QQmlEngine and into the QtQuick library. QQmlEngine remains the owner of image provider resources, but does not use them directly. Change-Id: I52083581394d9c308db446372883eb7479ccf807 Reviewed-by: Martin Jones <martin.jones@nokia.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qml/qml.pro1
-rw-r--r--tests/auto/quick/qquickimageprovider/qquickimageprovider.pro (renamed from tests/auto/qml/qqmlimageprovider/qqmlimageprovider.pro)4
-rw-r--r--tests/auto/quick/qquickimageprovider/tst_qquickimageprovider.cpp (renamed from tests/auto/qml/qqmlimageprovider/tst_qqmlimageprovider.cpp)62
-rw-r--r--tests/auto/quick/qquickpixmapcache/tst_qquickpixmapcache.cpp6
-rw-r--r--tests/auto/quick/quick.pro1
5 files changed, 37 insertions, 37 deletions
diff --git a/tests/auto/qml/qml.pro b/tests/auto/qml/qml.pro
index bcfbcbdbf0..d58a29066d 100644
--- a/tests/auto/qml/qml.pro
+++ b/tests/auto/qml/qml.pro
@@ -32,7 +32,6 @@ PRIVATETESTS += \
qqmlcpputils \
qqmlecmascript \
qqmlexpression \
- qqmlimageprovider \
qqmlinstruction \
qqmllanguage \
qqmlproperty \
diff --git a/tests/auto/qml/qqmlimageprovider/qqmlimageprovider.pro b/tests/auto/quick/qquickimageprovider/qquickimageprovider.pro
index 9feeee15fd..269f06a046 100644
--- a/tests/auto/qml/qqmlimageprovider/qqmlimageprovider.pro
+++ b/tests/auto/quick/qquickimageprovider/qquickimageprovider.pro
@@ -1,8 +1,8 @@
CONFIG += testcase
-TARGET = tst_qqmlimageprovider
+TARGET = tst_qquickimageprovider
macx:CONFIG -= app_bundle
-SOURCES += tst_qqmlimageprovider.cpp
+SOURCES += tst_qquickimageprovider.cpp
CONFIG += parallel_test
diff --git a/tests/auto/qml/qqmlimageprovider/tst_qqmlimageprovider.cpp b/tests/auto/quick/qquickimageprovider/tst_qquickimageprovider.cpp
index bc53544566..7f9a0efb33 100644
--- a/tests/auto/qml/qqmlimageprovider/tst_qqmlimageprovider.cpp
+++ b/tests/auto/quick/qquickimageprovider/tst_qquickimageprovider.cpp
@@ -41,18 +41,18 @@
#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()
{
}
@@ -74,15 +74,15 @@ private slots:
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)
{
}
@@ -115,11 +115,11 @@ public:
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)
{
}
@@ -152,7 +152,7 @@ public:
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
@@ -161,7 +161,7 @@ QString tst_qqmlimageprovider::newImageFileName() const
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");
@@ -207,7 +207,7 @@ void tst_qqmlimageprovider::fillRequestTestsData(const QString &id)
<< "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);
@@ -260,46 +260,46 @@ void tst_qqmlimageprovider::runTest(bool async, QQmlImageProvider *provider)
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);
@@ -314,17 +314,17 @@ void tst_qqmlimageprovider::requestPixmap_async()
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;
@@ -353,10 +353,10 @@ void tst_qqmlimageprovider::removeProvider()
delete obj;
}
-class TestThreadProvider : public QQmlImageProvider
+class TestThreadProvider : public QQuickImageProvider
{
public:
- TestThreadProvider() : QQmlImageProvider(Image), ok(false) {}
+ TestThreadProvider() : QQuickImageProvider(Image), ok(false) {}
~TestThreadProvider() {}
@@ -384,7 +384,7 @@ class TestThreadProvider : public QQmlImageProvider
};
-void tst_qqmlimageprovider::threadTest()
+void tst_qquickimageprovider::threadTest()
{
QQmlEngine engine;
@@ -419,6 +419,6 @@ void tst_qqmlimageprovider::threadTest()
}
-QTEST_MAIN(tst_qqmlimageprovider)
+QTEST_MAIN(tst_qquickimageprovider)
-#include "tst_qqmlimageprovider.moc"
+#include "tst_qquickimageprovider.moc"
diff --git a/tests/auto/quick/qquickpixmapcache/tst_qquickpixmapcache.cpp b/tests/auto/quick/qquickpixmapcache/tst_qquickpixmapcache.cpp
index 855322e376..8d2eb66e08 100644
--- a/tests/auto/quick/qquickpixmapcache/tst_qquickpixmapcache.cpp
+++ b/tests/auto/quick/qquickpixmapcache/tst_qquickpixmapcache.cpp
@@ -42,7 +42,7 @@
#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"
@@ -335,11 +335,11 @@ void tst_qquickpixmapcache::cancelcrash()
}
}
-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)
diff --git a/tests/auto/quick/quick.pro b/tests/auto/quick/quick.pro
index 4065dbf508..45fa9763da 100644
--- a/tests/auto/quick/quick.pro
+++ b/tests/auto/quick/quick.pro
@@ -15,6 +15,7 @@ PRIVATETESTS += \
qquickapplication \
qquickbehaviors \
qquickfontloader \
+ qquickimageprovider \
qquickpath \
qquicksmoothedanimation \
qquickspringanimation \