diff options
Diffstat (limited to 'tests/benchmarks/declarative')
52 files changed, 288 insertions, 190 deletions
diff --git a/tests/benchmarks/declarative/binding/binding.pro b/tests/benchmarks/declarative/binding/binding.pro index e25f186..aa4cc41 100644 --- a/tests/benchmarks/declarative/binding/binding.pro +++ b/tests/benchmarks/declarative/binding/binding.pro @@ -7,3 +7,9 @@ macx:CONFIG -= app_bundle SOURCES += tst_binding.cpp testtypes.cpp HEADERS += testtypes.h +symbian* { + data.sources = data/* + data.path = data + DEPLOYMENT = data +} + diff --git a/tests/benchmarks/declarative/binding/testtypes.cpp b/tests/benchmarks/declarative/binding/testtypes.cpp index 3a9f59b..043c8ab 100644 --- a/tests/benchmarks/declarative/binding/testtypes.cpp +++ b/tests/benchmarks/declarative/binding/testtypes.cpp @@ -40,4 +40,7 @@ ****************************************************************************/ #include "testtypes.h" -QML_DEFINE_TYPE(Test, 1, 0, MyQmlObject, MyQmlObject); +void registerTypes() +{ + QML_REGISTER_TYPE(Test, 1, 0, MyQmlObject, MyQmlObject); +} diff --git a/tests/benchmarks/declarative/binding/testtypes.h b/tests/benchmarks/declarative/binding/testtypes.h index d4e0a1a..4b103ce 100644 --- a/tests/benchmarks/declarative/binding/testtypes.h +++ b/tests/benchmarks/declarative/binding/testtypes.h @@ -42,7 +42,7 @@ #define TESTTYPES_H #include <QtCore/qobject.h> -#include <QtDeclarative/qml.h> +#include <QtDeclarative/qdeclarative.h> class MyQmlObject : public QObject { @@ -50,7 +50,7 @@ class MyQmlObject : public QObject Q_PROPERTY(int result READ result WRITE setResult); Q_PROPERTY(int value READ value WRITE setValue NOTIFY valueChanged); Q_PROPERTY(MyQmlObject *object READ object WRITE setObject NOTIFY objectChanged); - Q_PROPERTY(QmlList<QObject *> *data READ data); + Q_PROPERTY(QDeclarativeList<QObject *> *data READ data); Q_CLASSINFO("DefaultProperty", "data"); public: MyQmlObject() : m_result(0), m_value(0), m_object(0) {} @@ -61,7 +61,7 @@ public: int value() const { return m_value; } void setValue(int v) { m_value = v; emit valueChanged(); } - QmlList<QObject *> *data() { return &m_data; } + QDeclarativeList<QObject *> *data() { return &m_data; } MyQmlObject *object() const { return m_object; } void setObject(MyQmlObject *o) { m_object = o; emit objectChanged(); } @@ -71,11 +71,13 @@ signals: void objectChanged(); private: - QmlConcreteList<QObject *> m_data; + QDeclarativeConcreteList<QObject *> m_data; int m_result; int m_value; MyQmlObject *m_object; }; QML_DECLARE_TYPE(MyQmlObject); +void registerTypes(); + #endif // TESTTYPES_H diff --git a/tests/benchmarks/declarative/binding/tst_binding.cpp b/tests/benchmarks/declarative/binding/tst_binding.cpp index 74a3407..ee529a7 100644 --- a/tests/benchmarks/declarative/binding/tst_binding.cpp +++ b/tests/benchmarks/declarative/binding/tst_binding.cpp @@ -40,8 +40,8 @@ ****************************************************************************/ #include <qtest.h> -#include <QmlEngine> -#include <QmlComponent> +#include <QDeclarativeEngine> +#include <QDeclarativeComponent> #include <QFile> #include <QDebug> #include "testtypes.h" @@ -57,8 +57,8 @@ public: virtual ~tst_binding(); public slots: - void init(); - void cleanup(); + void initTestCase(); + void cleanupTestCase(); private slots: void objectproperty_data(); @@ -67,7 +67,7 @@ private slots: void basicproperty(); private: - QmlEngine engine; + QDeclarativeEngine engine; }; tst_binding::tst_binding() @@ -78,16 +78,17 @@ tst_binding::~tst_binding() { } -void tst_binding::init() +void tst_binding::initTestCase() { + registerTypes(); } -void tst_binding::cleanup() +void tst_binding::cleanupTestCase() { } #define COMPONENT(filename, binding) \ - QmlComponent c(&engine); \ + QDeclarativeComponent c(&engine); \ { \ QFile f(filename); \ QVERIFY(f.open(QIODevice::ReadOnly)); \ diff --git a/tests/benchmarks/declarative/creation/creation.pro b/tests/benchmarks/declarative/creation/creation.pro index fcc2987..3e0caf6 100644 --- a/tests/benchmarks/declarative/creation/creation.pro +++ b/tests/benchmarks/declarative/creation/creation.pro @@ -6,5 +6,10 @@ macx:CONFIG -= app_bundle SOURCES += tst_creation.cpp -DEFINES += SRCDIR=\\\"$$PWD\\\" - +symbian* { + data.sources = data/* + data.path = data + DEPLOYMENT += addFiles +} else { + DEFINES += SRCDIR=\\\"$$PWD\\\" +}
\ No newline at end of file diff --git a/tests/benchmarks/declarative/creation/tst_creation.cpp b/tests/benchmarks/declarative/creation/tst_creation.cpp index 23c820c..9c0fd27 100644 --- a/tests/benchmarks/declarative/creation/tst_creation.cpp +++ b/tests/benchmarks/declarative/creation/tst_creation.cpp @@ -40,15 +40,21 @@ ****************************************************************************/ #include <qtest.h> -#include <QmlEngine> -#include <QmlComponent> -#include <QmlMetaType> +#include <QDeclarativeEngine> +#include <QDeclarativeComponent> +#include <QDeclarativeMetaType> #include <QDebug> #include <QGraphicsScene> #include <QGraphicsItem> -#include <QmlGraphicsItem> +#include <QDeclarativeItem> #include <private/qobject_p.h> +#ifdef Q_OS_SYMBIAN +// In Symbian OS test data is located in applications private dir +// Application private dir is default serach path for files, so SRCDIR can be set to empty +#define SRCDIR "" +#endif + class tst_creation : public QObject { Q_OBJECT @@ -77,7 +83,7 @@ private slots: void itemtree_scene_cpp(); private: - QmlEngine engine; + QDeclarativeEngine engine; }; inline QUrl TEST_FILE(const QString &filename) @@ -95,7 +101,7 @@ void tst_creation::qobject_cpp() void tst_creation::qobject_qml() { - QmlComponent component(&engine, TEST_FILE("qobject.qml")); + QDeclarativeComponent component(&engine, TEST_FILE("qobject.qml")); QObject *obj = component.create(); delete obj; @@ -107,7 +113,7 @@ void tst_creation::qobject_qml() void tst_creation::qobject_qmltype() { - QmlType *t = QmlMetaType::qmlType("Qt/QtObject", 4, 6); + QDeclarativeType *t = QDeclarativeMetaType::qmlType("Qt/QtObject", 4, 6); QBENCHMARK { QObject *obj = t->create(); @@ -148,7 +154,7 @@ void tst_creation::objects_qmltype_data() { QTest::addColumn<QByteArray>("type"); - QList<QByteArray> types = QmlMetaType::qmlTypeNames(); + QList<QByteArray> types = QDeclarativeMetaType::qmlTypeNames(); foreach (QByteArray type, types) QTest::newRow(type.constData()) << type; } @@ -156,7 +162,7 @@ void tst_creation::objects_qmltype_data() void tst_creation::objects_qmltype() { QFETCH(QByteArray, type); - QmlType *t = QmlMetaType::qmlType(type, 4, 6); + QDeclarativeType *t = QDeclarativeMetaType::qmlType(type, 4, 6); QBENCHMARK { QObject *obj = t->create(); @@ -275,7 +281,7 @@ void tst_creation::qgraphicsitem_tree14() } } -struct QmlGraphics_DerivedObject : public QObject +struct QDeclarativeGraphics_DerivedObject : public QObject { void setParent_noEvent(QObject *parent) { bool sce = d_ptr->sendChildEvents; @@ -285,17 +291,17 @@ struct QmlGraphics_DerivedObject : public QObject } }; -inline void QmlGraphics_setParent_noEvent(QObject *object, QObject *parent) +inline void QDeclarativeGraphics_setParent_noEvent(QObject *object, QObject *parent) { - static_cast<QmlGraphics_DerivedObject *>(object)->setParent_noEvent(parent); + static_cast<QDeclarativeGraphics_DerivedObject *>(object)->setParent_noEvent(parent); } void tst_creation::itemtree_notree_cpp() { QBENCHMARK { - QmlGraphicsItem *item = new QmlGraphicsItem; + QDeclarativeItem *item = new QDeclarativeItem; for (int i = 0; i < 30; ++i) { - QmlGraphicsItem *child = new QmlGraphicsItem; + QDeclarativeItem *child = new QDeclarativeItem; } delete item; } @@ -304,10 +310,10 @@ void tst_creation::itemtree_notree_cpp() void tst_creation::itemtree_objtree_cpp() { QBENCHMARK { - QmlGraphicsItem *item = new QmlGraphicsItem; + QDeclarativeItem *item = new QDeclarativeItem; for (int i = 0; i < 30; ++i) { - QmlGraphicsItem *child = new QmlGraphicsItem; - QmlGraphics_setParent_noEvent(child,item); + QDeclarativeItem *child = new QDeclarativeItem; + QDeclarativeGraphics_setParent_noEvent(child,item); } delete item; } @@ -316,10 +322,10 @@ void tst_creation::itemtree_objtree_cpp() void tst_creation::itemtree_cpp() { QBENCHMARK { - QmlGraphicsItem *item = new QmlGraphicsItem; + QDeclarativeItem *item = new QDeclarativeItem; for (int i = 0; i < 30; ++i) { - QmlGraphicsItem *child = new QmlGraphicsItem; - QmlGraphics_setParent_noEvent(child,item); + QDeclarativeItem *child = new QDeclarativeItem; + QDeclarativeGraphics_setParent_noEvent(child,item); child->setParentItem(item); } delete item; @@ -329,10 +335,10 @@ void tst_creation::itemtree_cpp() void tst_creation::itemtree_data_cpp() { QBENCHMARK { - QmlGraphicsItem *item = new QmlGraphicsItem; + QDeclarativeItem *item = new QDeclarativeItem; for (int i = 0; i < 30; ++i) { - QmlGraphicsItem *child = new QmlGraphicsItem; - QmlGraphics_setParent_noEvent(child,item); + QDeclarativeItem *child = new QDeclarativeItem; + QDeclarativeGraphics_setParent_noEvent(child,item); item->data()->append(child); } delete item; @@ -341,7 +347,7 @@ void tst_creation::itemtree_data_cpp() void tst_creation::itemtree_qml() { - QmlComponent component(&engine, TEST_FILE("item.qml")); + QDeclarativeComponent component(&engine, TEST_FILE("item.qml")); QObject *obj = component.create(); delete obj; @@ -354,13 +360,13 @@ void tst_creation::itemtree_qml() void tst_creation::itemtree_scene_cpp() { QGraphicsScene scene; - QmlGraphicsItem *root = new QmlGraphicsItem; + QDeclarativeItem *root = new QDeclarativeItem; scene.addItem(root); QBENCHMARK { - QmlGraphicsItem *item = new QmlGraphicsItem; + QDeclarativeItem *item = new QDeclarativeItem; for (int i = 0; i < 30; ++i) { - QmlGraphicsItem *child = new QmlGraphicsItem; - QmlGraphics_setParent_noEvent(child,item); + QDeclarativeItem *child = new QDeclarativeItem; + QDeclarativeGraphics_setParent_noEvent(child,item); child->setParentItem(item); } item->setParentItem(root); diff --git a/tests/benchmarks/declarative/declarative.pro b/tests/benchmarks/declarative/declarative.pro index 8433de5..8c0ed42 100644 --- a/tests/benchmarks/declarative/declarative.pro +++ b/tests/benchmarks/declarative/declarative.pro @@ -3,8 +3,8 @@ SUBDIRS += \ binding \ creation \ pointers \ - qmlcomponent \ - qmlgraphicsimage \ - qmlmetaproperty \ + qdeclarativecomponent \ + qdeclarativeimage \ + qdeclarativemetaproperty \ script \ -# qmltime +# qdeclarativetime diff --git a/tests/benchmarks/declarative/pointers/tst_pointers.cpp b/tests/benchmarks/declarative/pointers/tst_pointers.cpp index 4fead9a..7257bee 100644 --- a/tests/benchmarks/declarative/pointers/tst_pointers.cpp +++ b/tests/benchmarks/declarative/pointers/tst_pointers.cpp @@ -40,7 +40,7 @@ ****************************************************************************/ #include <qtest.h> -#include "private/qmlguard_p.h" +#include "private/qdeclarativeguard_p.h" #include <QWeakPointer> class tst_pointers : public QObject @@ -59,7 +59,7 @@ void tst_pointers::qmlguard() { QObject *obj = new QObject; QBENCHMARK { - QmlGuard<QObject> guardedObject; + QDeclarativeGuard<QObject> guardedObject; guardedObject = obj; } } diff --git a/tests/benchmarks/declarative/qmlcomponent/data/myqmlobject.qml b/tests/benchmarks/declarative/qdeclarativecomponent/data/myqmlobject.qml index 9c3f7f8..9c3f7f8 100644 --- a/tests/benchmarks/declarative/qmlcomponent/data/myqmlobject.qml +++ b/tests/benchmarks/declarative/qdeclarativecomponent/data/myqmlobject.qml diff --git a/tests/benchmarks/declarative/qmlcomponent/data/myqmlobject_binding.qml b/tests/benchmarks/declarative/qdeclarativecomponent/data/myqmlobject_binding.qml index e6cc4cf..e6cc4cf 100644 --- a/tests/benchmarks/declarative/qmlcomponent/data/myqmlobject_binding.qml +++ b/tests/benchmarks/declarative/qdeclarativecomponent/data/myqmlobject_binding.qml diff --git a/tests/benchmarks/declarative/qmlcomponent/data/object.qml b/tests/benchmarks/declarative/qdeclarativecomponent/data/object.qml index 0d2d49b..0d2d49b 100644 --- a/tests/benchmarks/declarative/qmlcomponent/data/object.qml +++ b/tests/benchmarks/declarative/qdeclarativecomponent/data/object.qml diff --git a/tests/benchmarks/declarative/qmlcomponent/data/object_id.qml b/tests/benchmarks/declarative/qdeclarativecomponent/data/object_id.qml index 69114af..69114af 100644 --- a/tests/benchmarks/declarative/qmlcomponent/data/object_id.qml +++ b/tests/benchmarks/declarative/qdeclarativecomponent/data/object_id.qml diff --git a/tests/benchmarks/declarative/qmlcomponent/data/samegame/BoomBlock.qml b/tests/benchmarks/declarative/qdeclarativecomponent/data/samegame/BoomBlock.qml index 723e62a..723e62a 100644 --- a/tests/benchmarks/declarative/qmlcomponent/data/samegame/BoomBlock.qml +++ b/tests/benchmarks/declarative/qdeclarativecomponent/data/samegame/BoomBlock.qml diff --git a/tests/benchmarks/declarative/qmlcomponent/data/samegame/pics/blueStar.png b/tests/benchmarks/declarative/qdeclarativecomponent/data/samegame/pics/blueStar.png Binary files differindex ff9588f..ff9588f 100644 --- a/tests/benchmarks/declarative/qmlcomponent/data/samegame/pics/blueStar.png +++ b/tests/benchmarks/declarative/qdeclarativecomponent/data/samegame/pics/blueStar.png diff --git a/tests/benchmarks/declarative/qmlcomponent/data/samegame/pics/blueStone.png b/tests/benchmarks/declarative/qdeclarativecomponent/data/samegame/pics/blueStone.png Binary files differindex bf342e0..bf342e0 100644 --- a/tests/benchmarks/declarative/qmlcomponent/data/samegame/pics/blueStone.png +++ b/tests/benchmarks/declarative/qdeclarativecomponent/data/samegame/pics/blueStone.png diff --git a/tests/benchmarks/declarative/qmlcomponent/data/samegame/pics/greenStar.png b/tests/benchmarks/declarative/qdeclarativecomponent/data/samegame/pics/greenStar.png Binary files differindex cd06854..cd06854 100644 --- a/tests/benchmarks/declarative/qmlcomponent/data/samegame/pics/greenStar.png +++ b/tests/benchmarks/declarative/qdeclarativecomponent/data/samegame/pics/greenStar.png diff --git a/tests/benchmarks/declarative/qmlcomponent/data/samegame/pics/greenStone.png b/tests/benchmarks/declarative/qdeclarativecomponent/data/samegame/pics/greenStone.png Binary files differindex 5ac14a5..5ac14a5 100644 --- a/tests/benchmarks/declarative/qmlcomponent/data/samegame/pics/greenStone.png +++ b/tests/benchmarks/declarative/qdeclarativecomponent/data/samegame/pics/greenStone.png diff --git a/tests/benchmarks/declarative/qmlcomponent/data/samegame/pics/redStar.png b/tests/benchmarks/declarative/qdeclarativecomponent/data/samegame/pics/redStar.png Binary files differindex 0a4dffe..0a4dffe 100644 --- a/tests/benchmarks/declarative/qmlcomponent/data/samegame/pics/redStar.png +++ b/tests/benchmarks/declarative/qdeclarativecomponent/data/samegame/pics/redStar.png diff --git a/tests/benchmarks/declarative/qmlcomponent/data/samegame/pics/redStone.png b/tests/benchmarks/declarative/qdeclarativecomponent/data/samegame/pics/redStone.png Binary files differindex b099f60..b099f60 100644 --- a/tests/benchmarks/declarative/qmlcomponent/data/samegame/pics/redStone.png +++ b/tests/benchmarks/declarative/qdeclarativecomponent/data/samegame/pics/redStone.png diff --git a/tests/benchmarks/declarative/qmlcomponent/data/samegame/pics/yellowStone.png b/tests/benchmarks/declarative/qdeclarativecomponent/data/samegame/pics/yellowStone.png Binary files differindex c56124a..c56124a 100644 --- a/tests/benchmarks/declarative/qmlcomponent/data/samegame/pics/yellowStone.png +++ b/tests/benchmarks/declarative/qdeclarativecomponent/data/samegame/pics/yellowStone.png diff --git a/tests/benchmarks/declarative/qmlcomponent/data/synthesized_properties.2.qml b/tests/benchmarks/declarative/qdeclarativecomponent/data/synthesized_properties.2.qml index 27c5646..27c5646 100644 --- a/tests/benchmarks/declarative/qmlcomponent/data/synthesized_properties.2.qml +++ b/tests/benchmarks/declarative/qdeclarativecomponent/data/synthesized_properties.2.qml diff --git a/tests/benchmarks/declarative/qmlcomponent/data/synthesized_properties.qml b/tests/benchmarks/declarative/qdeclarativecomponent/data/synthesized_properties.qml index d08f35b..d08f35b 100644 --- a/tests/benchmarks/declarative/qmlcomponent/data/synthesized_properties.qml +++ b/tests/benchmarks/declarative/qdeclarativecomponent/data/synthesized_properties.qml diff --git a/tests/benchmarks/declarative/qdeclarativecomponent/qdeclarativecomponent.pro b/tests/benchmarks/declarative/qdeclarativecomponent/qdeclarativecomponent.pro new file mode 100644 index 0000000..12fa9f4 --- /dev/null +++ b/tests/benchmarks/declarative/qdeclarativecomponent/qdeclarativecomponent.pro @@ -0,0 +1,19 @@ +load(qttest_p4) +TEMPLATE = app +TARGET = tst_qdeclarativecomponent +QT += declarative +macx:CONFIG -= app_bundle + +SOURCES += tst_qdeclarativecomponent.cpp testtypes.cpp +HEADERS += testtypes.h + +symbian* { + data.sources = data/* + data.path = data + samegame.sources = data/samegame/* + samegame.path = data/samegame + samegame_pics.sources = data/samegame/pics/* + samegame_pics.path = data/samegame/pics + DEPLOYMENT += data samegame samegame_pics +} + diff --git a/tests/benchmarks/declarative/qmlcomponent/testtypes.cpp b/tests/benchmarks/declarative/qdeclarativecomponent/testtypes.cpp index f0bc1f9..acdc395 100644 --- a/tests/benchmarks/declarative/qmlcomponent/testtypes.cpp +++ b/tests/benchmarks/declarative/qdeclarativecomponent/testtypes.cpp @@ -40,4 +40,7 @@ ****************************************************************************/ #include "testtypes.h" -QML_DEFINE_TYPE(Qt.test, 4, 6, MyQmlObject, MyQmlObject); +void registerTypes() +{ + QML_REGISTER_TYPE(Qt.test, 4, 6, MyQmlObject, MyQmlObject); +} diff --git a/tests/benchmarks/declarative/qmlcomponent/testtypes.h b/tests/benchmarks/declarative/qdeclarativecomponent/testtypes.h index d4e0a1a..4b103ce 100644 --- a/tests/benchmarks/declarative/qmlcomponent/testtypes.h +++ b/tests/benchmarks/declarative/qdeclarativecomponent/testtypes.h @@ -42,7 +42,7 @@ #define TESTTYPES_H #include <QtCore/qobject.h> -#include <QtDeclarative/qml.h> +#include <QtDeclarative/qdeclarative.h> class MyQmlObject : public QObject { @@ -50,7 +50,7 @@ class MyQmlObject : public QObject Q_PROPERTY(int result READ result WRITE setResult); Q_PROPERTY(int value READ value WRITE setValue NOTIFY valueChanged); Q_PROPERTY(MyQmlObject *object READ object WRITE setObject NOTIFY objectChanged); - Q_PROPERTY(QmlList<QObject *> *data READ data); + Q_PROPERTY(QDeclarativeList<QObject *> *data READ data); Q_CLASSINFO("DefaultProperty", "data"); public: MyQmlObject() : m_result(0), m_value(0), m_object(0) {} @@ -61,7 +61,7 @@ public: int value() const { return m_value; } void setValue(int v) { m_value = v; emit valueChanged(); } - QmlList<QObject *> *data() { return &m_data; } + QDeclarativeList<QObject *> *data() { return &m_data; } MyQmlObject *object() const { return m_object; } void setObject(MyQmlObject *o) { m_object = o; emit objectChanged(); } @@ -71,11 +71,13 @@ signals: void objectChanged(); private: - QmlConcreteList<QObject *> m_data; + QDeclarativeConcreteList<QObject *> m_data; int m_result; int m_value; MyQmlObject *m_object; }; QML_DECLARE_TYPE(MyQmlObject); +void registerTypes(); + #endif // TESTTYPES_H diff --git a/tests/benchmarks/declarative/qmlcomponent/tst_qmlcomponent.cpp b/tests/benchmarks/declarative/qdeclarativecomponent/tst_qdeclarativecomponent.cpp index 647edbf..7065303 100644 --- a/tests/benchmarks/declarative/qmlcomponent/tst_qmlcomponent.cpp +++ b/tests/benchmarks/declarative/qdeclarativecomponent/tst_qdeclarativecomponent.cpp @@ -40,8 +40,8 @@ ****************************************************************************/ #include <qtest.h> -#include <QmlEngine> -#include <QmlComponent> +#include <QDeclarativeEngine> +#include <QDeclarativeComponent> #include <QFile> #include <QDebug> #include "testtypes.h" @@ -58,15 +58,15 @@ public: virtual ~tst_qmlcomponent(); public slots: - void init(); - void cleanup(); + void initTestCase(); + void cleanupTestCase(); private slots: void creation_data(); void creation(); private: - QmlEngine engine; + QDeclarativeEngine engine; }; tst_qmlcomponent::tst_qmlcomponent() @@ -77,11 +77,12 @@ tst_qmlcomponent::~tst_qmlcomponent() { } -void tst_qmlcomponent::init() +void tst_qmlcomponent::initTestCase() { + registerTypes(); } -void tst_qmlcomponent::cleanup() +void tst_qmlcomponent::cleanupTestCase() { } @@ -102,7 +103,7 @@ void tst_qmlcomponent::creation() { QFETCH(QString, file); - QmlComponent c(&engine, file); + QDeclarativeComponent c(&engine, file); QVERIFY(c.isReady()); QObject *obj = c.create(); @@ -115,4 +116,4 @@ void tst_qmlcomponent::creation() } QTEST_MAIN(tst_qmlcomponent) -#include "tst_qmlcomponent.moc" +#include "tst_qdeclarativecomponent.moc" diff --git a/tests/benchmarks/declarative/qmlgraphicsimage/image.png b/tests/benchmarks/declarative/qdeclarativeimage/image.png Binary files differindex 623d362..623d362 100644 --- a/tests/benchmarks/declarative/qmlgraphicsimage/image.png +++ b/tests/benchmarks/declarative/qdeclarativeimage/image.png diff --git a/tests/benchmarks/declarative/qdeclarativeimage/qdeclarativeimage.pro b/tests/benchmarks/declarative/qdeclarativeimage/qdeclarativeimage.pro new file mode 100644 index 0000000..bbe4e8d --- /dev/null +++ b/tests/benchmarks/declarative/qdeclarativeimage/qdeclarativeimage.pro @@ -0,0 +1,16 @@ +load(qttest_p4) +TEMPLATE = app +TARGET = tst_qdeclarativeimage +QT += declarative +macx:CONFIG -= app_bundle +CONFIG += release + +SOURCES += tst_qdeclarativeimage.cpp + +symbian* { + data.sources = image.png + data.path = . + DEPLOYMENT += data +} else { + DEFINES += SRCDIR=\\\"$$PWD\\\" +} diff --git a/tests/benchmarks/declarative/qmlgraphicsimage/tst_qmlgraphicsimage.cpp b/tests/benchmarks/declarative/qdeclarativeimage/tst_qdeclarativeimage.cpp index 7d7d24e..4bba022 100644 --- a/tests/benchmarks/declarative/qmlgraphicsimage/tst_qmlgraphicsimage.cpp +++ b/tests/benchmarks/declarative/qdeclarativeimage/tst_qdeclarativeimage.cpp @@ -40,9 +40,15 @@ ****************************************************************************/ #include <qtest.h> -#include <QmlEngine> -#include <QmlComponent> -#include <private/qmlgraphicsimage_p.h> +#include <QDeclarativeEngine> +#include <QDeclarativeComponent> +#include <private/qdeclarativeimage_p.h> + +#ifdef Q_OS_SYMBIAN +// In Symbian OS test data is located in applications private dir +// Application private dir is default serach path for files, so SRCDIR can be set to empty +#define SRCDIR "" +#endif class tst_qmlgraphicsimage : public QObject { @@ -56,7 +62,7 @@ private slots: void qmlgraphicsimage_url(); private: - QmlEngine engine; + QDeclarativeEngine engine; }; void tst_qmlgraphicsimage::qmlgraphicsimage() @@ -65,8 +71,8 @@ void tst_qmlgraphicsimage::qmlgraphicsimage() QUrl url("image.png"); QBENCHMARK { QUrl url2("http://localhost/image" + QString::number(x++) + ".png"); - QmlGraphicsImage *image = new QmlGraphicsImage; - QmlEngine::setContextForObject(image, engine.rootContext()); + QDeclarativeImage *image = new QDeclarativeImage; + QDeclarativeEngine::setContextForObject(image, engine.rootContext()); delete image; } } @@ -77,8 +83,8 @@ void tst_qmlgraphicsimage::qmlgraphicsimage_file() QUrl url("image.png"); QBENCHMARK { QUrl url2("http://localhost/image" + QString::number(x++) + ".png"); - QmlGraphicsImage *image = new QmlGraphicsImage; - QmlEngine::setContextForObject(image, engine.rootContext()); + QDeclarativeImage *image = new QDeclarativeImage; + QDeclarativeEngine::setContextForObject(image, engine.rootContext()); image->setSource(url); delete image; } @@ -90,8 +96,8 @@ void tst_qmlgraphicsimage::qmlgraphicsimage_url() QUrl url("image.png"); QBENCHMARK { QUrl url2("http://localhost/image" + QString::number(x++) + ".png"); - QmlGraphicsImage *image = new QmlGraphicsImage; - QmlEngine::setContextForObject(image, engine.rootContext()); + QDeclarativeImage *image = new QDeclarativeImage; + QDeclarativeEngine::setContextForObject(image, engine.rootContext()); image->setSource(url2); delete image; } @@ -99,4 +105,4 @@ void tst_qmlgraphicsimage::qmlgraphicsimage_url() QTEST_MAIN(tst_qmlgraphicsimage) -#include "tst_qmlgraphicsimage.moc" +#include "tst_qdeclarativeimage.moc" diff --git a/tests/benchmarks/declarative/qmlmetaproperty/data/object.qml b/tests/benchmarks/declarative/qdeclarativemetaproperty/data/object.qml index 11b95e1..11b95e1 100644 --- a/tests/benchmarks/declarative/qmlmetaproperty/data/object.qml +++ b/tests/benchmarks/declarative/qdeclarativemetaproperty/data/object.qml diff --git a/tests/benchmarks/declarative/qmlmetaproperty/data/synthesized_object.qml b/tests/benchmarks/declarative/qdeclarativemetaproperty/data/synthesized_object.qml index a923a0a..a923a0a 100644 --- a/tests/benchmarks/declarative/qmlmetaproperty/data/synthesized_object.qml +++ b/tests/benchmarks/declarative/qdeclarativemetaproperty/data/synthesized_object.qml diff --git a/tests/benchmarks/declarative/qdeclarativemetaproperty/qdeclarativemetaproperty.pro b/tests/benchmarks/declarative/qdeclarativemetaproperty/qdeclarativemetaproperty.pro new file mode 100644 index 0000000..8070768 --- /dev/null +++ b/tests/benchmarks/declarative/qdeclarativemetaproperty/qdeclarativemetaproperty.pro @@ -0,0 +1,8 @@ +load(qttest_p4) +TEMPLATE = app +TARGET = tst_qdeclarativemetaproperty +QT += declarative +macx:CONFIG -= app_bundle + +SOURCES += tst_qdeclarativemetaproperty.cpp + diff --git a/tests/benchmarks/declarative/qmlmetaproperty/tst_qmlmetaproperty.cpp b/tests/benchmarks/declarative/qdeclarativemetaproperty/tst_qdeclarativemetaproperty.cpp index 4c002f8..dae1751 100644 --- a/tests/benchmarks/declarative/qmlmetaproperty/tst_qmlmetaproperty.cpp +++ b/tests/benchmarks/declarative/qdeclarativemetaproperty/tst_qdeclarativemetaproperty.cpp @@ -40,9 +40,9 @@ ****************************************************************************/ #include <qtest.h> -#include <QmlEngine> -#include <QmlComponent> -#include <QmlMetaProperty> +#include <QDeclarativeEngine> +#include <QDeclarativeComponent> +#include <QDeclarativeMetaProperty> #include <QFile> #include <QDebug> @@ -66,7 +66,7 @@ private slots: void lookup(); private: - QmlEngine engine; + QDeclarativeEngine engine; }; tst_qmlmetaproperty::tst_qmlmetaproperty() @@ -97,17 +97,17 @@ void tst_qmlmetaproperty::lookup() { QFETCH(QString, file); - QmlComponent c(&engine, file); + QDeclarativeComponent c(&engine, file); QVERIFY(c.isReady()); QObject *obj = c.create(); QBENCHMARK { - QmlMetaProperty p(obj, "x"); + QDeclarativeMetaProperty p(obj, "x"); } delete obj; } QTEST_MAIN(tst_qmlmetaproperty) -#include "tst_qmlmetaproperty.moc" +#include "tst_qdeclarativemetaproperty.moc" diff --git a/tests/benchmarks/declarative/qmltime/example.qml b/tests/benchmarks/declarative/qdeclarativetime/example.qml index 68889f0..dd6185d 100644 --- a/tests/benchmarks/declarative/qmltime/example.qml +++ b/tests/benchmarks/declarative/qdeclarativetime/example.qml @@ -1,11 +1,11 @@ import Qt 4.6 -import QmlTime 1.0 as QmlTime +import QDeclarativeTime 1.0 as QDeclarativeTime Item { property string name: "Bob Smith" - QmlTime.Timer { + QDeclarativeTime.Timer { component: Item { Text { text: name } } diff --git a/tests/benchmarks/declarative/qmltime/qmltime.cpp b/tests/benchmarks/declarative/qdeclarativetime/qdeclarativetime.cpp index 2cc5d0d..a924337 100644 --- a/tests/benchmarks/declarative/qmltime/qmltime.cpp +++ b/tests/benchmarks/declarative/qdeclarativetime/qdeclarativetime.cpp @@ -38,25 +38,25 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ -#include <QmlEngine> -#include <QmlComponent> +#include <QDeclarativeEngine> +#include <QDeclarativeComponent> #include <QDebug> #include <QApplication> #include <QTime> -#include <QmlContext> +#include <QDeclarativeContext> #include <QGraphicsScene> #include <QGraphicsRectItem> class Timer : public QObject { Q_OBJECT - Q_PROPERTY(QmlComponent *component READ component WRITE setComponent); + Q_PROPERTY(QDeclarativeComponent *component READ component WRITE setComponent); public: Timer(); - QmlComponent *component() const; - void setComponent(QmlComponent *); + QDeclarativeComponent *component() const; + void setComponent(QDeclarativeComponent *); static Timer *timerInstance(); @@ -66,9 +66,9 @@ public: void setWillParent(bool p); private: - void runTest(QmlContext *, uint); + void runTest(QDeclarativeContext *, uint); - QmlComponent *m_component; + QDeclarativeComponent *m_component; static Timer *m_timer; bool m_willparent; @@ -76,7 +76,6 @@ private: QGraphicsRectItem m_item; }; QML_DECLARE_TYPE(Timer); -QML_DEFINE_TYPE(QmlTime, 1, 0, Timer, Timer); Timer *Timer::m_timer = 0; @@ -91,12 +90,12 @@ Timer::Timer() m_scene.addItem(&m_item); } -QmlComponent *Timer::component() const +QDeclarativeComponent *Timer::component() const { return m_component; } -void Timer::setComponent(QmlComponent *c) +void Timer::setComponent(QDeclarativeComponent *c) { m_component = c; } @@ -108,7 +107,7 @@ Timer *Timer::timerInstance() void Timer::run(uint iterations) { - QmlContext context(qmlContext(this)); + QDeclarativeContext context(qmlContext(this)); QObject *o = m_component->create(&context); QGraphicsObject *go = qobject_cast<QGraphicsObject *>(o); @@ -129,7 +128,7 @@ void Timer::setWillParent(bool p) m_willparent = p; } -void Timer::runTest(QmlContext *context, uint iterations) +void Timer::runTest(QDeclarativeContext *context, uint iterations) { QTime t; t.start(); @@ -157,6 +156,8 @@ int main(int argc, char ** argv) { QApplication app(argc, argv); + QML_REGISTER_TYPE(QDeclarativeTime, 1, 0, Timer, Timer); + uint iterations = 1024; QString filename; bool willParent = false; @@ -183,10 +184,14 @@ int main(int argc, char ** argv) } if (filename.isEmpty()) +#ifdef Q_OS_SYMBIAN + filename = QLatin1String("./tests/item_creation/data.qml"); +#else usage(argv[0]); +#endif - QmlEngine engine; - QmlComponent component(&engine, filename); + QDeclarativeEngine engine; + QDeclarativeComponent component(&engine, filename); if (component.isError()) { qWarning() << component.errors(); return -1; @@ -204,6 +209,9 @@ int main(int argc, char ** argv) return -1; } +#ifdef Q_OS_SYMBIAN + willParent = true; +#endif timer->setWillParent(willParent); if (!timer->component()) { @@ -211,9 +219,13 @@ int main(int argc, char ** argv) return -1; } +#ifdef Q_OS_SYMBIAN + iterations = 1024; +#endif + timer->run(iterations); return 0; } -#include "qmltime.moc" +#include "qdeclarativetime.moc" diff --git a/tests/benchmarks/declarative/qdeclarativetime/qdeclarativetime.pro b/tests/benchmarks/declarative/qdeclarativetime/qdeclarativetime.pro new file mode 100644 index 0000000..7902ee1 --- /dev/null +++ b/tests/benchmarks/declarative/qdeclarativetime/qdeclarativetime.pro @@ -0,0 +1,23 @@ +load(qttest_p4) +TEMPLATE = app +TARGET = qdeclarativetime +QT += declarative +macx:CONFIG -= app_bundle + +SOURCES += qdeclarativetime.cpp + +symbian* { + TARGET.CAPABILITY = "All -TCB" + example.sources = example.qml + esample.path = . + tests.sources = tests/* + tests.path = tests + anshors.sources = tests/anchors/* + anchors.path = tests/anchors + item_creation.sources = tests/item_creation/* + item_creation.path = tests/item_creation + positioner_creation.sources = tests/positioner_creation/* + positioner_creation.path = tests/positioner_creation + DEPLOYMENT += example tests anchors item_creation positioner_creation +} + diff --git a/tests/benchmarks/declarative/qmltime/tests/anchors/empty.qml b/tests/benchmarks/declarative/qdeclarativetime/tests/anchors/empty.qml index 31c879b..8d93594 100644 --- a/tests/benchmarks/declarative/qmltime/tests/anchors/empty.qml +++ b/tests/benchmarks/declarative/qdeclarativetime/tests/anchors/empty.qml @@ -1,9 +1,9 @@ import Qt 4.6 -import QmlTime 1.0 as QmlTime +import QDeclarativeTime 1.0 as QDeclarativeTime Item { - QmlTime.Timer { + QDeclarativeTime.Timer { component: Component { Item { Item { diff --git a/tests/benchmarks/declarative/qmltime/tests/anchors/fill.qml b/tests/benchmarks/declarative/qdeclarativetime/tests/anchors/fill.qml index 23fe78e..918c48a 100644 --- a/tests/benchmarks/declarative/qmltime/tests/anchors/fill.qml +++ b/tests/benchmarks/declarative/qdeclarativetime/tests/anchors/fill.qml @@ -1,9 +1,9 @@ import Qt 4.6 -import QmlTime 1.0 as QmlTime +import QDeclarativeTime 1.0 as QDeclarativeTime Item { - QmlTime.Timer { + QDeclarativeTime.Timer { component: Component { Item { Item { diff --git a/tests/benchmarks/declarative/qmltime/tests/anchors/null.qml b/tests/benchmarks/declarative/qdeclarativetime/tests/anchors/null.qml index bc447ef..bb84538 100644 --- a/tests/benchmarks/declarative/qmltime/tests/anchors/null.qml +++ b/tests/benchmarks/declarative/qdeclarativetime/tests/anchors/null.qml @@ -1,9 +1,9 @@ import Qt 4.6 -import QmlTime 1.0 as QmlTime +import QDeclarativeTime 1.0 as QDeclarativeTime Item { - QmlTime.Timer { + QDeclarativeTime.Timer { component: Component { Item { Item { diff --git a/tests/benchmarks/declarative/qmltime/tests/item_creation/children.qml b/tests/benchmarks/declarative/qdeclarativetime/tests/item_creation/children.qml index 996602c..3387a32 100644 --- a/tests/benchmarks/declarative/qmltime/tests/item_creation/children.qml +++ b/tests/benchmarks/declarative/qdeclarativetime/tests/item_creation/children.qml @@ -1,9 +1,9 @@ import Qt 4.6 -import QmlTime 1.0 as QmlTime +import QDeclarativeTime 1.0 as QDeclarativeTime Item { - QmlTime.Timer { + QDeclarativeTime.Timer { component: Component { Item { children: [ diff --git a/tests/benchmarks/declarative/qmltime/tests/item_creation/data.qml b/tests/benchmarks/declarative/qdeclarativetime/tests/item_creation/data.qml index 9f79c34..a8b653c 100644 --- a/tests/benchmarks/declarative/qmltime/tests/item_creation/data.qml +++ b/tests/benchmarks/declarative/qdeclarativetime/tests/item_creation/data.qml @@ -1,9 +1,9 @@ import Qt 4.6 -import QmlTime 1.0 as QmlTime +import QDeclarativeTime 1.0 as QDeclarativeTime Item { - QmlTime.Timer { + QDeclarativeTime.Timer { component: Component { Item { data: [ diff --git a/tests/benchmarks/declarative/qmltime/tests/item_creation/no_creation.qml b/tests/benchmarks/declarative/qdeclarativetime/tests/item_creation/no_creation.qml index f228c2a..0a507d4 100644 --- a/tests/benchmarks/declarative/qmltime/tests/item_creation/no_creation.qml +++ b/tests/benchmarks/declarative/qdeclarativetime/tests/item_creation/no_creation.qml @@ -1,9 +1,9 @@ import Qt 4.6 -import QmlTime 1.0 as QmlTime +import QDeclarativeTime 1.0 as QDeclarativeTime Item { - QmlTime.Timer { + QDeclarativeTime.Timer { component: Component { Item { } diff --git a/tests/benchmarks/declarative/qmltime/tests/item_creation/resources.qml b/tests/benchmarks/declarative/qdeclarativetime/tests/item_creation/resources.qml index 335aeb8..227d8ad 100644 --- a/tests/benchmarks/declarative/qmltime/tests/item_creation/resources.qml +++ b/tests/benchmarks/declarative/qdeclarativetime/tests/item_creation/resources.qml @@ -1,9 +1,9 @@ import Qt 4.6 -import QmlTime 1.0 as QmlTime +import QDeclarativeTime 1.0 as QDeclarativeTime Item { - QmlTime.Timer { + QDeclarativeTime.Timer { component: Component { Item { resources: [ diff --git a/tests/benchmarks/declarative/qmltime/tests/positioner_creation/no_positioner.qml b/tests/benchmarks/declarative/qdeclarativetime/tests/positioner_creation/no_positioner.qml index 97bad47..c1f54a4 100644 --- a/tests/benchmarks/declarative/qmltime/tests/positioner_creation/no_positioner.qml +++ b/tests/benchmarks/declarative/qdeclarativetime/tests/positioner_creation/no_positioner.qml @@ -1,8 +1,8 @@ import Qt 4.6 -import QmlTime 1.0 as QmlTime +import QDeclarativeTime 1.0 as QDeclarativeTime Item { - QmlTime.Timer { + QDeclarativeTime.Timer { component: Component { Item { Rectangle { } diff --git a/tests/benchmarks/declarative/qmltime/tests/positioner_creation/null_positioner.qml b/tests/benchmarks/declarative/qdeclarativetime/tests/positioner_creation/null_positioner.qml index 36dda15..d49ff78 100644 --- a/tests/benchmarks/declarative/qmltime/tests/positioner_creation/null_positioner.qml +++ b/tests/benchmarks/declarative/qdeclarativetime/tests/positioner_creation/null_positioner.qml @@ -1,8 +1,8 @@ import Qt 4.6 -import QmlTime 1.0 as QmlTime +import QDeclarativeTime 1.0 as QDeclarativeTime Item { - QmlTime.Timer { + QDeclarativeTime.Timer { component: Component { Item { Rectangle { } diff --git a/tests/benchmarks/declarative/qmltime/tests/positioner_creation/positioner.qml b/tests/benchmarks/declarative/qdeclarativetime/tests/positioner_creation/positioner.qml index 396e27d..05ca804 100644 --- a/tests/benchmarks/declarative/qmltime/tests/positioner_creation/positioner.qml +++ b/tests/benchmarks/declarative/qdeclarativetime/tests/positioner_creation/positioner.qml @@ -1,8 +1,8 @@ import Qt 4.6 -import QmlTime 1.0 as QmlTime +import QDeclarativeTime 1.0 as QDeclarativeTime Item { - QmlTime.Timer { + QDeclarativeTime.Timer { component: Component { Item { Rectangle { } diff --git a/tests/benchmarks/declarative/qmlcomponent/qmlcomponent.pro b/tests/benchmarks/declarative/qmlcomponent/qmlcomponent.pro deleted file mode 100644 index 6a86f58..0000000 --- a/tests/benchmarks/declarative/qmlcomponent/qmlcomponent.pro +++ /dev/null @@ -1,9 +0,0 @@ -load(qttest_p4) -TEMPLATE = app -TARGET = tst_qmlcomponent -QT += declarative -macx:CONFIG -= app_bundle - -SOURCES += tst_qmlcomponent.cpp testtypes.cpp -HEADERS += testtypes.h - diff --git a/tests/benchmarks/declarative/qmlgraphicsimage/qmlgraphicsimage.pro b/tests/benchmarks/declarative/qmlgraphicsimage/qmlgraphicsimage.pro deleted file mode 100644 index 449d874..0000000 --- a/tests/benchmarks/declarative/qmlgraphicsimage/qmlgraphicsimage.pro +++ /dev/null @@ -1,11 +0,0 @@ -load(qttest_p4) -TEMPLATE = app -TARGET = tst_qmlgraphicsimage -QT += declarative -macx:CONFIG -= app_bundle -CONFIG += release - -SOURCES += tst_qmlgraphicsimage.cpp - -DEFINES += SRCDIR=\\\"$$PWD\\\" - diff --git a/tests/benchmarks/declarative/qmlmetaproperty/qmlmetaproperty.pro b/tests/benchmarks/declarative/qmlmetaproperty/qmlmetaproperty.pro deleted file mode 100644 index c18a56b..0000000 --- a/tests/benchmarks/declarative/qmlmetaproperty/qmlmetaproperty.pro +++ /dev/null @@ -1,8 +0,0 @@ -load(qttest_p4) -TEMPLATE = app -TARGET = tst_qmlmetaproperty -QT += declarative -macx:CONFIG -= app_bundle - -SOURCES += tst_qmlmetaproperty.cpp - diff --git a/tests/benchmarks/declarative/qmltime/qmltime.pro b/tests/benchmarks/declarative/qmltime/qmltime.pro deleted file mode 100644 index b077d1a..0000000 --- a/tests/benchmarks/declarative/qmltime/qmltime.pro +++ /dev/null @@ -1,8 +0,0 @@ -load(qttest_p4) -TEMPLATE = app -TARGET = qmltime -QT += declarative -macx:CONFIG -= app_bundle - -SOURCES += qmltime.cpp - diff --git a/tests/benchmarks/declarative/script/script.pro b/tests/benchmarks/declarative/script/script.pro index 48fea81..6255acc 100644 --- a/tests/benchmarks/declarative/script/script.pro +++ b/tests/benchmarks/declarative/script/script.pro @@ -7,5 +7,14 @@ CONFIG += release SOURCES += tst_script.cpp -DEFINES += SRCDIR=\\\"$$PWD\\\" +symbian* { + data.sources = data/* + data.path = data + DEPLOYMENT += data +} else { + DEFINES += SRCDIR=\\\"$$PWD\\\" +} + + + diff --git a/tests/benchmarks/declarative/script/tst_script.cpp b/tests/benchmarks/declarative/script/tst_script.cpp index dd21997..61f5fc8 100644 --- a/tests/benchmarks/declarative/script/tst_script.cpp +++ b/tests/benchmarks/declarative/script/tst_script.cpp @@ -40,14 +40,20 @@ ****************************************************************************/ #include <qtest.h> -#include <QmlEngine> -#include <QmlComponent> -#include <private/qmlengine_p.h> -#include <private/qmlobjectscriptclass_p.h> -#include <private/qmlgraphicsrectangle_p.h> +#include <QDeclarativeEngine> +#include <QDeclarativeComponent> +#include <private/qdeclarativeengine_p.h> +#include <private/qdeclarativeobjectscriptclass_p.h> +#include <private/qdeclarativerectangle_p.h> #include <QScriptEngine> #include <QScriptValue> +#ifdef Q_OS_SYMBIAN +// In Symbian OS test data is located in applications private dir +// Application private dir is default serach path for files, so SRCDIR can be set to empty +#define SRCDIR "." +#endif + class tst_script : public QObject { Q_OBJECT @@ -55,6 +61,8 @@ public: tst_script() {} private slots: + void initTestCase(); + void property_js(); void property_getter(); void property_getter_js(); @@ -88,6 +96,11 @@ private slots: private: }; +void tst_script::initTestCase() +{ + QML_REGISTER_TYPE(Qt.test, 1, 0, TestObject, TestObject); +} + inline QUrl TEST_FILE(const QString &filename) { return QUrl::fromLocalFile(QLatin1String(SRCDIR) + QLatin1String("/data/") + filename); @@ -123,7 +136,6 @@ private: int m_x; }; QML_DECLARE_TYPE(TestObject); -QML_DEFINE_TYPE(Qt.test, 1, 0, TestObject, TestObject); TestObject::TestObject(QObject *parent) : QObject(parent), m_x(0) @@ -289,12 +301,12 @@ void tst_script::property_qobject() void tst_script::property_qmlobject() { - QmlEngine qmlengine; + QDeclarativeEngine qmlengine; - QScriptEngine *engine = QmlEnginePrivate::getScriptEngine(&qmlengine); + QScriptEngine *engine = QDeclarativeEnginePrivate::getScriptEngine(&qmlengine); TestObject to; - QScriptValue v = QmlEnginePrivate::get(&qmlengine)->objectClass->newQObject(&to); + QScriptValue v = QDeclarativeEnginePrivate::get(&qmlengine)->objectClass->newQObject(&to); QScriptValueList args; args << v; @@ -373,12 +385,12 @@ void tst_script::function_qobject() void tst_script::function_qmlobject() { - QmlEngine qmlengine; + QDeclarativeEngine qmlengine; - QScriptEngine *engine = QmlEnginePrivate::getScriptEngine(&qmlengine); + QScriptEngine *engine = QDeclarativeEnginePrivate::getScriptEngine(&qmlengine); TestObject to; - QScriptValue v = QmlEnginePrivate::get(&qmlengine)->objectClass->newQObject(&to); + QScriptValue v = QDeclarativeEnginePrivate::get(&qmlengine)->objectClass->newQObject(&to); QScriptValueList args; args << v; @@ -457,12 +469,12 @@ void tst_script::function_args_qobject() void tst_script::function_args_qmlobject() { - QmlEngine qmlengine; + QDeclarativeEngine qmlengine; - QScriptEngine *engine = QmlEnginePrivate::getScriptEngine(&qmlengine); + QScriptEngine *engine = QDeclarativeEnginePrivate::getScriptEngine(&qmlengine); TestObject to; - QScriptValue v = QmlEnginePrivate::get(&qmlengine)->objectClass->newQObject(&to); + QScriptValue v = QDeclarativeEnginePrivate::get(&qmlengine)->objectClass->newQObject(&to); QScriptValueList args; args << v; @@ -476,8 +488,8 @@ void tst_script::function_args_qmlobject() void tst_script::signal_unconnected() { - QmlEngine engine; - QmlComponent component(&engine, TEST_FILE("signal_unconnected.qml")); + QDeclarativeEngine engine; + QDeclarativeComponent component(&engine, TEST_FILE("signal_unconnected.qml")); TestObject *object = qobject_cast<TestObject *>(component.create()); QVERIFY(object != 0); @@ -490,8 +502,8 @@ void tst_script::signal_unconnected() void tst_script::signal_qml() { - QmlEngine engine; - QmlComponent component(&engine, TEST_FILE("signal_qml.qml")); + QDeclarativeEngine engine; + QDeclarativeComponent component(&engine, TEST_FILE("signal_qml.qml")); TestObject *object = qobject_cast<TestObject *>(component.create()); QVERIFY(object != 0); @@ -504,8 +516,8 @@ void tst_script::signal_qml() void tst_script::signal_args() { - QmlEngine engine; - QmlComponent component(&engine, TEST_FILE("signal_args.qml")); + QDeclarativeEngine engine; + QDeclarativeComponent component(&engine, TEST_FILE("signal_args.qml")); TestObject *object = qobject_cast<TestObject *>(component.create()); QVERIFY(object != 0); @@ -518,8 +530,8 @@ void tst_script::signal_args() void tst_script::signal_unusedArgs() { - QmlEngine engine; - QmlComponent component(&engine, TEST_FILE("signal_unusedArgs.qml")); + QDeclarativeEngine engine; + QDeclarativeComponent component(&engine, TEST_FILE("signal_unusedArgs.qml")); TestObject *object = qobject_cast<TestObject *>(component.create()); QVERIFY(object != 0); @@ -532,8 +544,8 @@ void tst_script::signal_unusedArgs() void tst_script::slot_simple() { - QmlEngine engine; - QmlComponent component(&engine, TEST_FILE("slot_simple.qml")); + QDeclarativeEngine engine; + QDeclarativeComponent component(&engine, TEST_FILE("slot_simple.qml")); TestObject *object = qobject_cast<TestObject *>(component.create()); QVERIFY(object != 0); @@ -546,8 +558,8 @@ void tst_script::slot_simple() void tst_script::slot_simple_js() { - QmlEngine engine; - QmlComponent component(&engine, TEST_FILE("slot_simple_js.qml")); + QDeclarativeEngine engine; + QDeclarativeComponent component(&engine, TEST_FILE("slot_simple_js.qml")); TestObject *object = qobject_cast<TestObject *>(component.create()); QVERIFY(object != 0); @@ -560,8 +572,8 @@ void tst_script::slot_simple_js() void tst_script::slot_complex() { - QmlEngine engine; - QmlComponent component(&engine, TEST_FILE("slot_complex.qml")); + QDeclarativeEngine engine; + QDeclarativeComponent component(&engine, TEST_FILE("slot_complex.qml")); TestObject *object = qobject_cast<TestObject *>(component.create()); QVERIFY(object != 0); @@ -574,8 +586,8 @@ void tst_script::slot_complex() void tst_script::slot_complex_js() { - QmlEngine engine; - QmlComponent component(&engine, TEST_FILE("slot_complex_js.qml")); + QDeclarativeEngine engine; + QDeclarativeComponent component(&engine, TEST_FILE("slot_complex_js.qml")); TestObject *object = qobject_cast<TestObject *>(component.create()); QVERIFY(object != 0); @@ -597,9 +609,9 @@ void tst_script::block_data() void tst_script::block() { QFETCH(QString, methodName); - QmlEngine engine; - QmlComponent component(&engine, TEST_FILE("block.qml")); - QmlGraphicsRectangle *rect = qobject_cast<QmlGraphicsRectangle *>(component.create()); + QDeclarativeEngine engine; + QDeclarativeComponent component(&engine, TEST_FILE("block.qml")); + QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle *>(component.create()); QVERIFY(rect != 0); int index = rect->metaObject()->indexOfMethod(methodName.toUtf8()); |