aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qtquick2/qdeclarativeanimations/tst_qdeclarativeanimations.cpp
diff options
context:
space:
mode:
authorMartin Jones <martin.jones@nokia.com>2011-12-08 10:36:44 +1000
committerQt by Nokia <qt-info@nokia.com>2011-12-13 02:40:04 +0100
commit2a3990fc4125eeb0c73eaae05450789717dfd045 (patch)
tree9f352b6f7b674cfe7ee55f2480c46354e9dcd413 /tests/auto/qtquick2/qdeclarativeanimations/tst_qdeclarativeanimations.cpp
parentde33a805de96681f98998179acd4bea61eae5d5a (diff)
Add basic custom easing curve docs and test
Change-Id: Id38434cb71417276635b501d13d0145759de9864 Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
Diffstat (limited to 'tests/auto/qtquick2/qdeclarativeanimations/tst_qdeclarativeanimations.cpp')
-rw-r--r--tests/auto/qtquick2/qdeclarativeanimations/tst_qdeclarativeanimations.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/auto/qtquick2/qdeclarativeanimations/tst_qdeclarativeanimations.cpp b/tests/auto/qtquick2/qdeclarativeanimations/tst_qdeclarativeanimations.cpp
index ca329263e9..2a2055ebbf 100644
--- a/tests/auto/qtquick2/qdeclarativeanimations/tst_qdeclarativeanimations.cpp
+++ b/tests/auto/qtquick2/qdeclarativeanimations/tst_qdeclarativeanimations.cpp
@@ -938,6 +938,22 @@ void tst_qdeclarativeanimations::easingProperties()
QCOMPARE(animObject->easing().type(), QEasingCurve::InOutBack);
QCOMPARE(animObject->easing().overshoot(), 2.0);
}
+
+ {
+ QDeclarativeEngine engine;
+ QString componentStr = "import QtQuick 2.0\nPropertyAnimation { easing.type: \"Bezier\"; easing.bezierCurve: [0.5, 0.2, 0.13, 0.65, 1.0, 1.0] }";
+ QDeclarativeComponent animationComponent(&engine);
+ animationComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
+ QDeclarativePropertyAnimation *animObject = qobject_cast<QDeclarativePropertyAnimation*>(animationComponent.create());
+
+ QVERIFY(animObject != 0);
+ QCOMPARE(animObject->easing().type(), QEasingCurve::BezierSpline);
+ QList<QPointF> points = animObject->easing().cubicBezierSpline();
+ QCOMPARE(points.count(), 3);
+ QCOMPARE(points.at(0), QPointF(0.5, 0.2));
+ QCOMPARE(points.at(1), QPointF(0.13, 0.65));
+ QCOMPARE(points.at(2), QPointF(1.0, 1.0));
+ }
}
void tst_qdeclarativeanimations::rotation()