diff options
author | Martin Jones <martin.jones@nokia.com> | 2011-07-11 13:47:51 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-07-12 06:38:09 +0200 |
commit | 4442dea01b9d4d45964228ac442166d89f091f9e (patch) | |
tree | 28ae20cb26967765a988b1ee522fc2d64d777671 /tests/auto/declarative/qdeclarativeanimations | |
parent | b119220da60453ecf31898f7a57eda9d3c4e9225 (diff) |
Extract all QtQuick 1 elements into a separate library/plugin.
Change-Id: I41a280de2739ee08202f4be2519e5012870090f2
Reviewed-on: http://codereview.qt.nokia.com/1391
Reviewed-by: Martin Jones <martin.jones@nokia.com>
Diffstat (limited to 'tests/auto/declarative/qdeclarativeanimations')
35 files changed, 123 insertions, 123 deletions
diff --git a/tests/auto/declarative/qdeclarativeanimations/data/Double.qml b/tests/auto/declarative/qdeclarativeanimations/data/Double.qml index b247fcee5f..99ffca1d62 100644 --- a/tests/auto/declarative/qdeclarativeanimations/data/Double.qml +++ b/tests/auto/declarative/qdeclarativeanimations/data/Double.qml @@ -1,4 +1,4 @@ -import QtQuick 1.0 +import QtQuick 2.0 Rectangle { id: container diff --git a/tests/auto/declarative/qdeclarativeanimations/data/attached.qml b/tests/auto/declarative/qdeclarativeanimations/data/attached.qml index c5d5535bb7..9dcfcd8752 100644 --- a/tests/auto/declarative/qdeclarativeanimations/data/attached.qml +++ b/tests/auto/declarative/qdeclarativeanimations/data/attached.qml @@ -1,4 +1,4 @@ -import QtQuick 1.0 +import QtQuick 2.0 Rectangle { width: 180; height: 200; diff --git a/tests/auto/declarative/qdeclarativeanimations/data/badproperty1.qml b/tests/auto/declarative/qdeclarativeanimations/data/badproperty1.qml index 3e7ebe7440..9634c2c169 100644 --- a/tests/auto/declarative/qdeclarativeanimations/data/badproperty1.qml +++ b/tests/auto/declarative/qdeclarativeanimations/data/badproperty1.qml @@ -1,4 +1,4 @@ -import QtQuick 1.0 +import QtQuick 2.0 Rectangle { id: wrapper diff --git a/tests/auto/declarative/qdeclarativeanimations/data/badproperty2.qml b/tests/auto/declarative/qdeclarativeanimations/data/badproperty2.qml index 40235eee15..c121172a99 100644 --- a/tests/auto/declarative/qdeclarativeanimations/data/badproperty2.qml +++ b/tests/auto/declarative/qdeclarativeanimations/data/badproperty2.qml @@ -1,4 +1,4 @@ -import QtQuick 1.0 +import QtQuick 2.0 Rectangle { id: wrapper diff --git a/tests/auto/declarative/qdeclarativeanimations/data/badtype1.qml b/tests/auto/declarative/qdeclarativeanimations/data/badtype1.qml index 0a8a7ea7f9..43e1ec8572 100644 --- a/tests/auto/declarative/qdeclarativeanimations/data/badtype1.qml +++ b/tests/auto/declarative/qdeclarativeanimations/data/badtype1.qml @@ -1,4 +1,4 @@ -import QtQuick 1.0 +import QtQuick 2.0 Rectangle { width: 240 diff --git a/tests/auto/declarative/qdeclarativeanimations/data/badtype2.qml b/tests/auto/declarative/qdeclarativeanimations/data/badtype2.qml index 118bbbc889..5341cb3d1c 100644 --- a/tests/auto/declarative/qdeclarativeanimations/data/badtype2.qml +++ b/tests/auto/declarative/qdeclarativeanimations/data/badtype2.qml @@ -1,4 +1,4 @@ -import QtQuick 1.0 +import QtQuick 2.0 Rectangle { width: 240 diff --git a/tests/auto/declarative/qdeclarativeanimations/data/badtype3.qml b/tests/auto/declarative/qdeclarativeanimations/data/badtype3.qml index 2599e70cc9..182efa0840 100644 --- a/tests/auto/declarative/qdeclarativeanimations/data/badtype3.qml +++ b/tests/auto/declarative/qdeclarativeanimations/data/badtype3.qml @@ -1,4 +1,4 @@ -import QtQuick 1.0 +import QtQuick 2.0 Rectangle { width: 240 diff --git a/tests/auto/declarative/qdeclarativeanimations/data/badtype4.qml b/tests/auto/declarative/qdeclarativeanimations/data/badtype4.qml index 5dafb0e344..f091e2430f 100644 --- a/tests/auto/declarative/qdeclarativeanimations/data/badtype4.qml +++ b/tests/auto/declarative/qdeclarativeanimations/data/badtype4.qml @@ -1,4 +1,4 @@ -import QtQuick 1.0 +import QtQuick 2.0 Rectangle { id: wrapper diff --git a/tests/auto/declarative/qdeclarativeanimations/data/dontAutoStart.qml b/tests/auto/declarative/qdeclarativeanimations/data/dontAutoStart.qml index e2ce07fbfc..c0c0c65e3f 100644 --- a/tests/auto/declarative/qdeclarativeanimations/data/dontAutoStart.qml +++ b/tests/auto/declarative/qdeclarativeanimations/data/dontAutoStart.qml @@ -1,4 +1,4 @@ -import QtQuick 1.0 +import QtQuick 2.0 Rectangle { id: wrapper diff --git a/tests/auto/declarative/qdeclarativeanimations/data/dontStart.qml b/tests/auto/declarative/qdeclarativeanimations/data/dontStart.qml index 6b8031769f..3eee0cfd35 100644 --- a/tests/auto/declarative/qdeclarativeanimations/data/dontStart.qml +++ b/tests/auto/declarative/qdeclarativeanimations/data/dontStart.qml @@ -1,4 +1,4 @@ -import QtQuick 1.0 +import QtQuick 2.0 Rectangle { id: wrapper diff --git a/tests/auto/declarative/qdeclarativeanimations/data/dontStart2.qml b/tests/auto/declarative/qdeclarativeanimations/data/dontStart2.qml index 2563c01d4f..e7b4164e4e 100644 --- a/tests/auto/declarative/qdeclarativeanimations/data/dontStart2.qml +++ b/tests/auto/declarative/qdeclarativeanimations/data/dontStart2.qml @@ -1,4 +1,4 @@ -import QtQuick 1.0 +import QtQuick 2.0 Rectangle { id: wrapper diff --git a/tests/auto/declarative/qdeclarativeanimations/data/dotproperty.qml b/tests/auto/declarative/qdeclarativeanimations/data/dotproperty.qml index aff69e5c12..e0e46dcef5 100644 --- a/tests/auto/declarative/qdeclarativeanimations/data/dotproperty.qml +++ b/tests/auto/declarative/qdeclarativeanimations/data/dotproperty.qml @@ -1,4 +1,4 @@ -import QtQuick 1.0 +import QtQuick 2.0 Rectangle { id: wrapper diff --git a/tests/auto/declarative/qdeclarativeanimations/data/doubleRegistrationBug.qml b/tests/auto/declarative/qdeclarativeanimations/data/doubleRegistrationBug.qml index f0fdf9cfb5..9ef3da20c0 100644 --- a/tests/auto/declarative/qdeclarativeanimations/data/doubleRegistrationBug.qml +++ b/tests/auto/declarative/qdeclarativeanimations/data/doubleRegistrationBug.qml @@ -1,4 +1,4 @@ -import QtQuick 1.0 +import QtQuick 2.0 Rectangle { width: 400; height: 400 diff --git a/tests/auto/declarative/qdeclarativeanimations/data/mixedtype1.qml b/tests/auto/declarative/qdeclarativeanimations/data/mixedtype1.qml index a97b3fd5bf..76129dd15e 100644 --- a/tests/auto/declarative/qdeclarativeanimations/data/mixedtype1.qml +++ b/tests/auto/declarative/qdeclarativeanimations/data/mixedtype1.qml @@ -1,4 +1,4 @@ -import QtQuick 1.0 +import QtQuick 2.0 Rectangle { id: wrapper diff --git a/tests/auto/declarative/qdeclarativeanimations/data/mixedtype2.qml b/tests/auto/declarative/qdeclarativeanimations/data/mixedtype2.qml index 9a77467820..1a7166e3f3 100644 --- a/tests/auto/declarative/qdeclarativeanimations/data/mixedtype2.qml +++ b/tests/auto/declarative/qdeclarativeanimations/data/mixedtype2.qml @@ -1,4 +1,4 @@ -import QtQuick 1.0 +import QtQuick 2.0 Rectangle { id: wrapper diff --git a/tests/auto/declarative/qdeclarativeanimations/data/nonTransitionBug.qml b/tests/auto/declarative/qdeclarativeanimations/data/nonTransitionBug.qml index 04741ff348..909c533e7b 100644 --- a/tests/auto/declarative/qdeclarativeanimations/data/nonTransitionBug.qml +++ b/tests/auto/declarative/qdeclarativeanimations/data/nonTransitionBug.qml @@ -1,4 +1,4 @@ -import QtQuick 1.0 +import QtQuick 2.0 Rectangle { id: root diff --git a/tests/auto/declarative/qdeclarativeanimations/data/properties.qml b/tests/auto/declarative/qdeclarativeanimations/data/properties.qml index e6af9acc93..f0f730967c 100644 --- a/tests/auto/declarative/qdeclarativeanimations/data/properties.qml +++ b/tests/auto/declarative/qdeclarativeanimations/data/properties.qml @@ -1,4 +1,4 @@ -import QtQuick 1.0 +import QtQuick 2.0 Rectangle { width: 400 diff --git a/tests/auto/declarative/qdeclarativeanimations/data/properties2.qml b/tests/auto/declarative/qdeclarativeanimations/data/properties2.qml index 60ec456c71..6b7f026e0b 100644 --- a/tests/auto/declarative/qdeclarativeanimations/data/properties2.qml +++ b/tests/auto/declarative/qdeclarativeanimations/data/properties2.qml @@ -1,4 +1,4 @@ -import QtQuick 1.0 +import QtQuick 2.0 Rectangle { width: 400 diff --git a/tests/auto/declarative/qdeclarativeanimations/data/properties3.qml b/tests/auto/declarative/qdeclarativeanimations/data/properties3.qml index e86eca1316..5eb65496d4 100644 --- a/tests/auto/declarative/qdeclarativeanimations/data/properties3.qml +++ b/tests/auto/declarative/qdeclarativeanimations/data/properties3.qml @@ -1,4 +1,4 @@ -import QtQuick 1.0 +import QtQuick 2.0 Rectangle { width: 400 diff --git a/tests/auto/declarative/qdeclarativeanimations/data/properties4.qml b/tests/auto/declarative/qdeclarativeanimations/data/properties4.qml index 04d41c64c1..dfe8ad17e7 100644 --- a/tests/auto/declarative/qdeclarativeanimations/data/properties4.qml +++ b/tests/auto/declarative/qdeclarativeanimations/data/properties4.qml @@ -1,4 +1,4 @@ -import QtQuick 1.0 +import QtQuick 2.0 Rectangle { width: 400 diff --git a/tests/auto/declarative/qdeclarativeanimations/data/properties5.qml b/tests/auto/declarative/qdeclarativeanimations/data/properties5.qml index e139f8c6c0..075fc9bc5a 100644 --- a/tests/auto/declarative/qdeclarativeanimations/data/properties5.qml +++ b/tests/auto/declarative/qdeclarativeanimations/data/properties5.qml @@ -1,4 +1,4 @@ -import QtQuick 1.0 +import QtQuick 2.0 Rectangle { width: 400 diff --git a/tests/auto/declarative/qdeclarativeanimations/data/propertiesTransition.qml b/tests/auto/declarative/qdeclarativeanimations/data/propertiesTransition.qml index 8e2b41db6c..968c5f6285 100644 --- a/tests/auto/declarative/qdeclarativeanimations/data/propertiesTransition.qml +++ b/tests/auto/declarative/qdeclarativeanimations/data/propertiesTransition.qml @@ -1,4 +1,4 @@ -import QtQuick 1.0 +import QtQuick 2.0 Rectangle { width: 400 diff --git a/tests/auto/declarative/qdeclarativeanimations/data/propertiesTransition2.qml b/tests/auto/declarative/qdeclarativeanimations/data/propertiesTransition2.qml index 6b846852ff..f06165604a 100644 --- a/tests/auto/declarative/qdeclarativeanimations/data/propertiesTransition2.qml +++ b/tests/auto/declarative/qdeclarativeanimations/data/propertiesTransition2.qml @@ -1,4 +1,4 @@ -import QtQuick 1.0 +import QtQuick 2.0 Rectangle { width: 400 diff --git a/tests/auto/declarative/qdeclarativeanimations/data/propertiesTransition3.qml b/tests/auto/declarative/qdeclarativeanimations/data/propertiesTransition3.qml index c9d8e95bd3..7d3b3b9c6d 100644 --- a/tests/auto/declarative/qdeclarativeanimations/data/propertiesTransition3.qml +++ b/tests/auto/declarative/qdeclarativeanimations/data/propertiesTransition3.qml @@ -1,4 +1,4 @@ -import QtQuick 1.0 +import QtQuick 2.0 Rectangle { width: 400 diff --git a/tests/auto/declarative/qdeclarativeanimations/data/propertiesTransition4.qml b/tests/auto/declarative/qdeclarativeanimations/data/propertiesTransition4.qml index 61e8a96788..1c31a79634 100644 --- a/tests/auto/declarative/qdeclarativeanimations/data/propertiesTransition4.qml +++ b/tests/auto/declarative/qdeclarativeanimations/data/propertiesTransition4.qml @@ -1,4 +1,4 @@ -import QtQuick 1.0 +import QtQuick 2.0 Rectangle { width: 400 diff --git a/tests/auto/declarative/qdeclarativeanimations/data/propertiesTransition5.qml b/tests/auto/declarative/qdeclarativeanimations/data/propertiesTransition5.qml index b023943007..a2ff746900 100644 --- a/tests/auto/declarative/qdeclarativeanimations/data/propertiesTransition5.qml +++ b/tests/auto/declarative/qdeclarativeanimations/data/propertiesTransition5.qml @@ -1,4 +1,4 @@ -import QtQuick 1.0 +import QtQuick 2.0 Rectangle { width: 400 diff --git a/tests/auto/declarative/qdeclarativeanimations/data/propertiesTransition6.qml b/tests/auto/declarative/qdeclarativeanimations/data/propertiesTransition6.qml index 7c88a7f038..d3db01efb0 100644 --- a/tests/auto/declarative/qdeclarativeanimations/data/propertiesTransition6.qml +++ b/tests/auto/declarative/qdeclarativeanimations/data/propertiesTransition6.qml @@ -1,4 +1,4 @@ -import QtQuick 1.0 +import QtQuick 2.0 Rectangle { width: 400 diff --git a/tests/auto/declarative/qdeclarativeanimations/data/propertiesTransition7.qml b/tests/auto/declarative/qdeclarativeanimations/data/propertiesTransition7.qml index fbef95e572..98898de8ef 100644 --- a/tests/auto/declarative/qdeclarativeanimations/data/propertiesTransition7.qml +++ b/tests/auto/declarative/qdeclarativeanimations/data/propertiesTransition7.qml @@ -1,4 +1,4 @@ -import QtQuick 1.0 +import QtQuick 2.0 Rectangle { width: 400 diff --git a/tests/auto/declarative/qdeclarativeanimations/data/registrationBug.qml b/tests/auto/declarative/qdeclarativeanimations/data/registrationBug.qml index 7dc29f9315..633da4e17f 100644 --- a/tests/auto/declarative/qdeclarativeanimations/data/registrationBug.qml +++ b/tests/auto/declarative/qdeclarativeanimations/data/registrationBug.qml @@ -1,4 +1,4 @@ -import QtQuick 1.0 +import QtQuick 2.0 Rectangle { id: rect diff --git a/tests/auto/declarative/qdeclarativeanimations/data/rotation.qml b/tests/auto/declarative/qdeclarativeanimations/data/rotation.qml index ac158df719..4dc42a1bd2 100644 --- a/tests/auto/declarative/qdeclarativeanimations/data/rotation.qml +++ b/tests/auto/declarative/qdeclarativeanimations/data/rotation.qml @@ -1,4 +1,4 @@ -import QtQuick 1.0 +import QtQuick 2.0 Rectangle { width: 600; height: 200 diff --git a/tests/auto/declarative/qdeclarativeanimations/data/runningTrueBug.qml b/tests/auto/declarative/qdeclarativeanimations/data/runningTrueBug.qml index 7d33ed7175..bec6fab368 100644 --- a/tests/auto/declarative/qdeclarativeanimations/data/runningTrueBug.qml +++ b/tests/auto/declarative/qdeclarativeanimations/data/runningTrueBug.qml @@ -1,4 +1,4 @@ -import QtQuick 1.0 +import QtQuick 2.0 Rectangle { color: "skyblue" width: 500 diff --git a/tests/auto/declarative/qdeclarativeanimations/data/valuesource.qml b/tests/auto/declarative/qdeclarativeanimations/data/valuesource.qml index fa9cd400ac..7a636b4003 100644 --- a/tests/auto/declarative/qdeclarativeanimations/data/valuesource.qml +++ b/tests/auto/declarative/qdeclarativeanimations/data/valuesource.qml @@ -1,4 +1,4 @@ -import QtQuick 1.0 +import QtQuick 2.0 Rectangle { width: 400 diff --git a/tests/auto/declarative/qdeclarativeanimations/data/valuesource2.qml b/tests/auto/declarative/qdeclarativeanimations/data/valuesource2.qml index f6343a1bff..9788761ee8 100644 --- a/tests/auto/declarative/qdeclarativeanimations/data/valuesource2.qml +++ b/tests/auto/declarative/qdeclarativeanimations/data/valuesource2.qml @@ -1,4 +1,4 @@ -import QtQuick 1.0 +import QtQuick 2.0 Rectangle { width: 400 diff --git a/tests/auto/declarative/qdeclarativeanimations/qdeclarativeanimations.pro b/tests/auto/declarative/qdeclarativeanimations/qdeclarativeanimations.pro index b37714165c..2669e5a8e3 100644 --- a/tests/auto/declarative/qdeclarativeanimations/qdeclarativeanimations.pro +++ b/tests/auto/declarative/qdeclarativeanimations/qdeclarativeanimations.pro @@ -1,5 +1,5 @@ load(qttest_p4) -contains(QT_CONFIG,declarative): QT += declarative +contains(QT_CONFIG,declarative): QT += declarative opengl SOURCES += tst_qdeclarativeanimations.cpp macx:CONFIG -= app_bundle @@ -13,4 +13,4 @@ symbian: { CONFIG += parallel_test -QT += core-private gui-private declarative-private +QT += core-private gui-private declarative-private opengl-private diff --git a/tests/auto/declarative/qdeclarativeanimations/tst_qdeclarativeanimations.cpp b/tests/auto/declarative/qdeclarativeanimations/tst_qdeclarativeanimations.cpp index 00db2d43ae..cf911c6bef 100644 --- a/tests/auto/declarative/qdeclarativeanimations/tst_qdeclarativeanimations.cpp +++ b/tests/auto/declarative/qdeclarativeanimations/tst_qdeclarativeanimations.cpp @@ -41,10 +41,10 @@ #include <qtest.h> #include <QtDeclarative/qdeclarativeengine.h> #include <QtDeclarative/qdeclarativecomponent.h> -#include <QtDeclarative/qdeclarativeview.h> -#include <private/qdeclarativerectangle_p.h> -#include <private/qdeclarativeanimation_p.h> -#include <private/qdeclarativeitem_p.h> +#include <QtDeclarative/qsgview.h> +#include <QtDeclarative/private/qsgrectangle_p.h> +#include <QtDeclarative/private/qdeclarativeanimation_p.h> +#include <QtDeclarative/private/qsgitem_p.h> #include <QVariantAnimation> #include <QEasingCurve> @@ -101,32 +101,32 @@ private slots: void tst_qdeclarativeanimations::simpleProperty() { - QDeclarativeRectangle rect; + QSGRectangle rect; QDeclarativePropertyAnimation animation; animation.setTarget(&rect); - animation.setProperty("pos"); - animation.setTo(QPointF(200,200)); + animation.setProperty("x"); + animation.setTo(200); QVERIFY(animation.target() == &rect); - QVERIFY(animation.property() == "pos"); - QVERIFY(animation.to().toPointF() == QPointF(200,200)); + QVERIFY(animation.property() == "x"); + QVERIFY(animation.to().toReal() == 200.0); animation.start(); QVERIFY(animation.isRunning()); QTest::qWait(animation.duration()); - QTIMED_COMPARE(rect.pos(), QPointF(200,200)); + QTIMED_COMPARE(rect.x(), 200.0); - rect.setPos(0,0); + rect.setPos(QPointF(0,0)); animation.start(); animation.pause(); QVERIFY(animation.isRunning()); QVERIFY(animation.isPaused()); animation.setCurrentTime(125); QVERIFY(animation.currentTime() == 125); - QCOMPARE(rect.pos(), QPointF(100,100)); + QCOMPARE(rect.x(),100.0); } void tst_qdeclarativeanimations::simpleNumber() { - QDeclarativeRectangle rect; + QSGRectangle rect; QDeclarativeNumberAnimation animation; animation.setTarget(&rect); animation.setProperty("x"); @@ -151,7 +151,7 @@ void tst_qdeclarativeanimations::simpleNumber() void tst_qdeclarativeanimations::simpleColor() { - QDeclarativeRectangle rect; + QSGRectangle rect; QDeclarativeColorAnimation animation; animation.setTarget(&rect); animation.setProperty("color"); @@ -185,7 +185,7 @@ void tst_qdeclarativeanimations::simpleColor() void tst_qdeclarativeanimations::simpleRotation() { - QDeclarativeRectangle rect; + QSGRectangle rect; QDeclarativeRotationAnimation animation; animation.setTarget(&rect); animation.setProperty("rotation"); @@ -211,7 +211,7 @@ void tst_qdeclarativeanimations::simpleRotation() void tst_qdeclarativeanimations::alwaysRunToEnd() { - QDeclarativeRectangle rect; + QSGRectangle rect; QDeclarativePropertyAnimation animation; animation.setTarget(&rect); animation.setProperty("x"); @@ -231,7 +231,7 @@ void tst_qdeclarativeanimations::alwaysRunToEnd() void tst_qdeclarativeanimations::complete() { - QDeclarativeRectangle rect; + QSGRectangle rect; QDeclarativePropertyAnimation animation; animation.setTarget(&rect); animation.setProperty("x"); @@ -252,7 +252,7 @@ void tst_qdeclarativeanimations::complete() void tst_qdeclarativeanimations::resume() { - QDeclarativeRectangle rect; + QSGRectangle rect; QDeclarativePropertyAnimation animation; animation.setTarget(&rect); animation.setProperty("x"); @@ -279,28 +279,28 @@ void tst_qdeclarativeanimations::resume() void tst_qdeclarativeanimations::dotProperty() { - QDeclarativeRectangle rect; + QSGRectangle rect; QDeclarativeNumberAnimation animation; animation.setTarget(&rect); animation.setProperty("border.width"); animation.setTo(10); animation.start(); QTest::qWait(animation.duration()+50); - QTIMED_COMPARE(rect.border()->width(), 10); + QTIMED_COMPARE(rect.border()->width(), 10.0); rect.border()->setWidth(0); animation.start(); animation.pause(); animation.setCurrentTime(125); QVERIFY(animation.currentTime() == 125); - QCOMPARE(rect.border()->width(), 5); + QCOMPARE(rect.border()->width(), 5.0); } void tst_qdeclarativeanimations::badTypes() { //don't crash { - QDeclarativeView *view = new QDeclarativeView; + QSGView *view = new QSGView; view->setSource(QUrl::fromLocalFile(SRCDIR "/data/badtype1.qml")); qApp->processEvents(); @@ -334,12 +334,12 @@ void tst_qdeclarativeanimations::badTypes() { QDeclarativeEngine engine; QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/badtype4.qml")); - QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create()); + QSGRectangle *rect = qobject_cast<QSGRectangle*>(c.create()); QVERIFY(rect); - QDeclarativeItemPrivate::get(rect)->setState("state1"); + QSGItemPrivate::get(rect)->setState("state1"); QTest::qWait(1000 + 50); - QDeclarativeRectangle *myRect = rect->findChild<QDeclarativeRectangle*>("MyRect"); + QSGRectangle *myRect = rect->findChild<QSGRectangle*>("MyRect"); QVERIFY(myRect); QCOMPARE(myRect->x(),qreal(200)); } @@ -354,13 +354,13 @@ void tst_qdeclarativeanimations::badProperties() QDeclarativeComponent c1(&engine, QUrl::fromLocalFile(SRCDIR "/data/badproperty1.qml")); QByteArray message = QUrl::fromLocalFile(SRCDIR "/data/badproperty1.qml").toString().toUtf8() + ":18:9: QML ColorAnimation: Cannot animate non-existent property \"border.colr\""; QTest::ignoreMessage(QtWarningMsg, message); - QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c1.create()); + QSGRectangle *rect = qobject_cast<QSGRectangle*>(c1.create()); QVERIFY(rect); QDeclarativeComponent c2(&engine, QUrl::fromLocalFile(SRCDIR "/data/badproperty2.qml")); message = QUrl::fromLocalFile(SRCDIR "/data/badproperty2.qml").toString().toUtf8() + ":18:9: QML ColorAnimation: Cannot animate read-only property \"border\""; QTest::ignoreMessage(QtWarningMsg, message); - rect = qobject_cast<QDeclarativeRectangle*>(c2.create()); + rect = qobject_cast<QSGRectangle*>(c2.create()); QVERIFY(rect); //### should we warn here are well? @@ -376,12 +376,12 @@ void tst_qdeclarativeanimations::mixedTypes() { QDeclarativeEngine engine; QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/mixedtype1.qml")); - QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create()); + QSGRectangle *rect = qobject_cast<QSGRectangle*>(c.create()); QVERIFY(rect); - QDeclarativeItemPrivate::get(rect)->setState("state1"); + QSGItemPrivate::get(rect)->setState("state1"); QTest::qWait(500); - QDeclarativeRectangle *myRect = rect->findChild<QDeclarativeRectangle*>("MyRect"); + QSGRectangle *myRect = rect->findChild<QSGRectangle*>("MyRect"); QVERIFY(myRect); //rather inexact -- is there a better way? @@ -392,12 +392,12 @@ void tst_qdeclarativeanimations::mixedTypes() { QDeclarativeEngine engine; QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/mixedtype2.qml")); - QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create()); + QSGRectangle *rect = qobject_cast<QSGRectangle*>(c.create()); QVERIFY(rect); - QDeclarativeItemPrivate::get(rect)->setState("state1"); + QSGItemPrivate::get(rect)->setState("state1"); QTest::qWait(500); - QDeclarativeRectangle *myRect = rect->findChild<QDeclarativeRectangle*>("MyRect"); + QSGRectangle *myRect = rect->findChild<QSGRectangle*>("MyRect"); QVERIFY(myRect); //rather inexact -- is there a better way? @@ -412,10 +412,10 @@ void tst_qdeclarativeanimations::properties() { QDeclarativeEngine engine; QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/properties.qml")); - QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create()); + QSGRectangle *rect = qobject_cast<QSGRectangle*>(c.create()); QVERIFY(rect); - QDeclarativeRectangle *myRect = rect->findChild<QDeclarativeRectangle*>("TheRect"); + QSGRectangle *myRect = rect->findChild<QSGRectangle*>("TheRect"); QVERIFY(myRect); QTest::qWait(waitDuration); QTIMED_COMPARE(myRect->x(),qreal(200)); @@ -424,10 +424,10 @@ void tst_qdeclarativeanimations::properties() { QDeclarativeEngine engine; QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/properties2.qml")); - QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create()); + QSGRectangle *rect = qobject_cast<QSGRectangle*>(c.create()); QVERIFY(rect); - QDeclarativeRectangle *myRect = rect->findChild<QDeclarativeRectangle*>("TheRect"); + QSGRectangle *myRect = rect->findChild<QSGRectangle*>("TheRect"); QVERIFY(myRect); QTest::qWait(waitDuration); QTIMED_COMPARE(myRect->x(),qreal(200)); @@ -436,10 +436,10 @@ void tst_qdeclarativeanimations::properties() { QDeclarativeEngine engine; QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/properties3.qml")); - QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create()); + QSGRectangle *rect = qobject_cast<QSGRectangle*>(c.create()); QVERIFY(rect); - QDeclarativeRectangle *myRect = rect->findChild<QDeclarativeRectangle*>("TheRect"); + QSGRectangle *myRect = rect->findChild<QSGRectangle*>("TheRect"); QVERIFY(myRect); QTest::qWait(waitDuration); QTIMED_COMPARE(myRect->x(),qreal(300)); @@ -448,10 +448,10 @@ void tst_qdeclarativeanimations::properties() { QDeclarativeEngine engine; QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/properties4.qml")); - QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create()); + QSGRectangle *rect = qobject_cast<QSGRectangle*>(c.create()); QVERIFY(rect); - QDeclarativeRectangle *myRect = rect->findChild<QDeclarativeRectangle*>("TheRect"); + QSGRectangle *myRect = rect->findChild<QSGRectangle*>("TheRect"); QVERIFY(myRect); QTest::qWait(waitDuration); QTIMED_COMPARE(myRect->y(),qreal(200)); @@ -461,10 +461,10 @@ void tst_qdeclarativeanimations::properties() { QDeclarativeEngine engine; QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/properties5.qml")); - QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create()); + QSGRectangle *rect = qobject_cast<QSGRectangle*>(c.create()); QVERIFY(rect); - QDeclarativeRectangle *myRect = rect->findChild<QDeclarativeRectangle*>("TheRect"); + QSGRectangle *myRect = rect->findChild<QSGRectangle*>("TheRect"); QVERIFY(myRect); QTest::qWait(waitDuration); QTIMED_COMPARE(myRect->x(),qreal(100)); @@ -478,11 +478,11 @@ void tst_qdeclarativeanimations::propertiesTransition() { QDeclarativeEngine engine; QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/propertiesTransition.qml")); - QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create()); + QSGRectangle *rect = qobject_cast<QSGRectangle*>(c.create()); QVERIFY(rect); - QDeclarativeItemPrivate::get(rect)->setState("moved"); - QDeclarativeRectangle *myRect = rect->findChild<QDeclarativeRectangle*>("TheRect"); + QSGItemPrivate::get(rect)->setState("moved"); + QSGRectangle *myRect = rect->findChild<QSGRectangle*>("TheRect"); QVERIFY(myRect); QTest::qWait(waitDuration); QTIMED_COMPARE(myRect->x(),qreal(200)); @@ -491,12 +491,12 @@ void tst_qdeclarativeanimations::propertiesTransition() { QDeclarativeEngine engine; QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/propertiesTransition2.qml")); - QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create()); + QSGRectangle *rect = qobject_cast<QSGRectangle*>(c.create()); QVERIFY(rect); - QDeclarativeRectangle *myRect = rect->findChild<QDeclarativeRectangle*>("TheRect"); + QSGRectangle *myRect = rect->findChild<QSGRectangle*>("TheRect"); QVERIFY(myRect); - QDeclarativeItemPrivate::get(rect)->setState("moved"); + QSGItemPrivate::get(rect)->setState("moved"); QCOMPARE(myRect->x(),qreal(200)); QCOMPARE(myRect->y(),qreal(100)); QTest::qWait(waitDuration); @@ -506,12 +506,12 @@ void tst_qdeclarativeanimations::propertiesTransition() { QDeclarativeEngine engine; QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/propertiesTransition3.qml")); - QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create()); + QSGRectangle *rect = qobject_cast<QSGRectangle*>(c.create()); QVERIFY(rect); - QDeclarativeRectangle *myRect = rect->findChild<QDeclarativeRectangle*>("TheRect"); + QSGRectangle *myRect = rect->findChild<QSGRectangle*>("TheRect"); QVERIFY(myRect); - QDeclarativeItemPrivate::get(rect)->setState("moved"); + QSGItemPrivate::get(rect)->setState("moved"); QCOMPARE(myRect->x(),qreal(200)); QCOMPARE(myRect->y(),qreal(100)); } @@ -519,12 +519,12 @@ void tst_qdeclarativeanimations::propertiesTransition() { QDeclarativeEngine engine; QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/propertiesTransition4.qml")); - QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create()); + QSGRectangle *rect = qobject_cast<QSGRectangle*>(c.create()); QVERIFY(rect); - QDeclarativeRectangle *myRect = rect->findChild<QDeclarativeRectangle*>("TheRect"); + QSGRectangle *myRect = rect->findChild<QSGRectangle*>("TheRect"); QVERIFY(myRect); - QDeclarativeItemPrivate::get(rect)->setState("moved"); + QSGItemPrivate::get(rect)->setState("moved"); QCOMPARE(myRect->x(),qreal(100)); QTest::qWait(waitDuration); QTIMED_COMPARE(myRect->x(),qreal(200)); @@ -533,12 +533,12 @@ void tst_qdeclarativeanimations::propertiesTransition() { QDeclarativeEngine engine; QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/propertiesTransition5.qml")); - QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create()); + QSGRectangle *rect = qobject_cast<QSGRectangle*>(c.create()); QVERIFY(rect); - QDeclarativeRectangle *myRect = rect->findChild<QDeclarativeRectangle*>("TheRect"); + QSGRectangle *myRect = rect->findChild<QSGRectangle*>("TheRect"); QVERIFY(myRect); - QDeclarativeItemPrivate::get(rect)->setState("moved"); + QSGItemPrivate::get(rect)->setState("moved"); QCOMPARE(myRect->x(),qreal(100)); QTest::qWait(waitDuration); QTIMED_COMPARE(myRect->x(),qreal(200)); @@ -547,12 +547,12 @@ void tst_qdeclarativeanimations::propertiesTransition() /*{ QDeclarativeEngine engine; QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/propertiesTransition6.qml")); - QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create()); + QSGRectangle *rect = qobject_cast<QSGRectangle*>(c.create()); QVERIFY(rect); - QDeclarativeRectangle *myRect = rect->findChild<QDeclarativeRectangle*>("TheRect"); + QSGRectangle *myRect = rect->findChild<QSGRectangle*>("TheRect"); QVERIFY(myRect); - QDeclarativeItemPrivate::get(rect)->setState("moved"); + QSGItemPrivate::get(rect)->setState("moved"); QCOMPARE(myRect->x(),qreal(100)); QTest::qWait(waitDuration); QTIMED_COMPARE(myRect->x(),qreal(100)); @@ -561,11 +561,11 @@ void tst_qdeclarativeanimations::propertiesTransition() { QDeclarativeEngine engine; QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/propertiesTransition7.qml")); - QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create()); + QSGRectangle *rect = qobject_cast<QSGRectangle*>(c.create()); QVERIFY(rect); - QDeclarativeItemPrivate::get(rect)->setState("moved"); - QDeclarativeRectangle *myRect = rect->findChild<QDeclarativeRectangle*>("TheRect"); + QSGItemPrivate::get(rect)->setState("moved"); + QSGRectangle *myRect = rect->findChild<QSGRectangle*>("TheRect"); QVERIFY(myRect); QTest::qWait(waitDuration); QTIMED_COMPARE(myRect->x(),qreal(200)); @@ -593,7 +593,7 @@ void tst_qdeclarativeanimations::attached() QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/attached.qml")); QTest::ignoreMessage(QtDebugMsg, "off"); QTest::ignoreMessage(QtDebugMsg, "on"); - QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create()); + QSGRectangle *rect = qobject_cast<QSGRectangle*>(c.create()); QVERIFY(rect); } @@ -604,7 +604,7 @@ void tst_qdeclarativeanimations::propertyValueSourceDefaultStart() QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/valuesource.qml")); - QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create()); + QSGRectangle *rect = qobject_cast<QSGRectangle*>(c.create()); QVERIFY(rect); QDeclarativeAbstractAnimation *myAnim = rect->findChild<QDeclarativeAbstractAnimation*>("MyAnim"); @@ -617,7 +617,7 @@ void tst_qdeclarativeanimations::propertyValueSourceDefaultStart() QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/valuesource2.qml")); - QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create()); + QSGRectangle *rect = qobject_cast<QSGRectangle*>(c.create()); QVERIFY(rect); QDeclarativeAbstractAnimation *myAnim = rect->findChild<QDeclarativeAbstractAnimation*>("MyAnim"); @@ -630,7 +630,7 @@ void tst_qdeclarativeanimations::propertyValueSourceDefaultStart() QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/dontAutoStart.qml")); - QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create()); + QSGRectangle *rect = qobject_cast<QSGRectangle*>(c.create()); QVERIFY(rect); QDeclarativeAbstractAnimation *myAnim = rect->findChild<QDeclarativeAbstractAnimation*>("MyAnim"); @@ -649,7 +649,7 @@ void tst_qdeclarativeanimations::dontStart() QString warning = c.url().toString() + ":14:13: QML NumberAnimation: setRunning() cannot be used on non-root animation nodes."; QTest::ignoreMessage(QtWarningMsg, qPrintable(warning)); - QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create()); + QSGRectangle *rect = qobject_cast<QSGRectangle*>(c.create()); QVERIFY(rect); QDeclarativeAbstractAnimation *myAnim = rect->findChild<QDeclarativeAbstractAnimation*>("MyAnim"); @@ -664,7 +664,7 @@ void tst_qdeclarativeanimations::dontStart() QString warning = c.url().toString() + ":15:17: QML NumberAnimation: setRunning() cannot be used on non-root animation nodes."; QTest::ignoreMessage(QtWarningMsg, qPrintable(warning)); - QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create()); + QSGRectangle *rect = qobject_cast<QSGRectangle*>(c.create()); QVERIFY(rect); QDeclarativeAbstractAnimation *myAnim = rect->findChild<QDeclarativeAbstractAnimation*>("MyAnim"); @@ -677,7 +677,7 @@ void tst_qdeclarativeanimations::easingProperties() { { QDeclarativeEngine engine; - QString componentStr = "import QtQuick 1.0\nNumberAnimation { easing.type: \"InOutQuad\" }"; + QString componentStr = "import QtQuick 2.0\nNumberAnimation { easing.type: \"InOutQuad\" }"; QDeclarativeComponent animationComponent(&engine); animationComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile("")); QDeclarativePropertyAnimation *animObject = qobject_cast<QDeclarativePropertyAnimation*>(animationComponent.create()); @@ -688,7 +688,7 @@ void tst_qdeclarativeanimations::easingProperties() { QDeclarativeEngine engine; - QString componentStr = "import QtQuick 1.0\nPropertyAnimation { easing.type: \"OutBounce\"; easing.amplitude: 5.0 }"; + QString componentStr = "import QtQuick 2.0\nPropertyAnimation { easing.type: \"OutBounce\"; easing.amplitude: 5.0 }"; QDeclarativeComponent animationComponent(&engine); animationComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile("")); QDeclarativePropertyAnimation *animObject = qobject_cast<QDeclarativePropertyAnimation*>(animationComponent.create()); @@ -700,7 +700,7 @@ void tst_qdeclarativeanimations::easingProperties() { QDeclarativeEngine engine; - QString componentStr = "import QtQuick 1.0\nPropertyAnimation { easing.type: \"OutElastic\"; easing.amplitude: 5.0; easing.period: 3.0}"; + QString componentStr = "import QtQuick 2.0\nPropertyAnimation { easing.type: \"OutElastic\"; easing.amplitude: 5.0; easing.period: 3.0}"; QDeclarativeComponent animationComponent(&engine); animationComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile("")); QDeclarativePropertyAnimation *animObject = qobject_cast<QDeclarativePropertyAnimation*>(animationComponent.create()); @@ -713,7 +713,7 @@ void tst_qdeclarativeanimations::easingProperties() { QDeclarativeEngine engine; - QString componentStr = "import QtQuick 1.0\nPropertyAnimation { easing.type: \"InOutBack\"; easing.overshoot: 2 }"; + QString componentStr = "import QtQuick 2.0\nPropertyAnimation { easing.type: \"InOutBack\"; easing.overshoot: 2 }"; QDeclarativeComponent animationComponent(&engine); animationComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile("")); QDeclarativePropertyAnimation *animObject = qobject_cast<QDeclarativePropertyAnimation*>(animationComponent.create()); @@ -728,15 +728,15 @@ void tst_qdeclarativeanimations::rotation() { QDeclarativeEngine engine; QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/rotation.qml")); - QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create()); + QSGRectangle *rect = qobject_cast<QSGRectangle*>(c.create()); QVERIFY(rect); - QDeclarativeRectangle *rr = rect->findChild<QDeclarativeRectangle*>("rr"); - QDeclarativeRectangle *rr2 = rect->findChild<QDeclarativeRectangle*>("rr2"); - QDeclarativeRectangle *rr3 = rect->findChild<QDeclarativeRectangle*>("rr3"); - QDeclarativeRectangle *rr4 = rect->findChild<QDeclarativeRectangle*>("rr4"); + QSGRectangle *rr = rect->findChild<QSGRectangle*>("rr"); + QSGRectangle *rr2 = rect->findChild<QSGRectangle*>("rr2"); + QSGRectangle *rr3 = rect->findChild<QSGRectangle*>("rr3"); + QSGRectangle *rr4 = rect->findChild<QSGRectangle*>("rr4"); - QDeclarativeItemPrivate::get(rect)->setState("state1"); + QSGItemPrivate::get(rect)->setState("state1"); QTest::qWait(800); qreal r1 = rr->rotation(); qreal r2 = rr2->rotation(); @@ -759,10 +759,10 @@ void tst_qdeclarativeanimations::runningTrueBug() //ensure we start correctly when "running: true" is explicitly set QDeclarativeEngine engine; QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/runningTrueBug.qml")); - QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create()); + QSGRectangle *rect = qobject_cast<QSGRectangle*>(c.create()); QVERIFY(rect); - QDeclarativeRectangle *cloud = rect->findChild<QDeclarativeRectangle*>("cloud"); + QSGRectangle *cloud = rect->findChild<QSGRectangle*>("cloud"); QVERIFY(cloud); QTest::qWait(1000); QVERIFY(cloud->x() > qreal(0)); @@ -776,10 +776,10 @@ void tst_qdeclarativeanimations::nonTransitionBug() QDeclarativeEngine engine; QDeclarativeComponent c(&engine, SRCDIR "/data/nonTransitionBug.qml"); - QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create()); + QSGRectangle *rect = qobject_cast<QSGRectangle*>(c.create()); QVERIFY(rect != 0); - QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect); - QDeclarativeRectangle *mover = rect->findChild<QDeclarativeRectangle*>("mover"); + QSGItemPrivate *rectPrivate = QSGItemPrivate::get(rect); + QSGRectangle *mover = rect->findChild<QSGRectangle*>("mover"); mover->setX(100); QCOMPARE(mover->x(), qreal(100)); @@ -802,7 +802,7 @@ void tst_qdeclarativeanimations::registrationBug() QDeclarativeEngine engine; QDeclarativeComponent c(&engine, SRCDIR "/data/registrationBug.qml"); - QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create()); + QSGRectangle *rect = qobject_cast<QSGRectangle*>(c.create()); QVERIFY(rect != 0); QTRY_COMPARE(rect->property("value"), QVariant(int(100))); } @@ -812,7 +812,7 @@ void tst_qdeclarativeanimations::doubleRegistrationBug() QDeclarativeEngine engine; QDeclarativeComponent c(&engine, SRCDIR "/data/doubleRegistrationBug.qml"); - QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create()); + QSGRectangle *rect = qobject_cast<QSGRectangle*>(c.create()); QVERIFY(rect != 0); QDeclarativeAbstractAnimation *anim = rect->findChild<QDeclarativeAbstractAnimation*>("animation"); @@ -823,7 +823,7 @@ void tst_qdeclarativeanimations::doubleRegistrationBug() //QTBUG-16736 void tst_qdeclarativeanimations::alwaysRunToEndRestartBug() { - QDeclarativeRectangle rect; + QSGRectangle rect; QDeclarativePropertyAnimation animation; animation.setTarget(&rect); animation.setProperty("x"); |