summaryrefslogtreecommitdiffstats
path: root/tests/auto/declarative/qdeclarativeitem
diff options
context:
space:
mode:
authorWarwick Allison <warwick.allison@nokia.com>2010-03-26 07:02:53 (GMT)
committerWarwick Allison <warwick.allison@nokia.com>2010-03-26 07:02:53 (GMT)
commitb8952aef84c78949959728674db39eafb19efee7 (patch)
treea258b882059cf7e749e447e230a56e7a8e17c55d /tests/auto/declarative/qdeclarativeitem
parent56309fe1461c4ea3ca654e535a525165c28a0f12 (diff)
downloadQt-b8952aef84c78949959728674db39eafb19efee7.zip
Qt-b8952aef84c78949959728674db39eafb19efee7.tar.gz
Qt-b8952aef84c78949959728674db39eafb19efee7.tar.bz2
Test and fix order of transform application.
Remove Translate.z since Qt cannot sensibly support it yet.
Diffstat (limited to 'tests/auto/declarative/qdeclarativeitem')
-rw-r--r--tests/auto/declarative/qdeclarativeitem/tst_qdeclarativeitem.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/tests/auto/declarative/qdeclarativeitem/tst_qdeclarativeitem.cpp b/tests/auto/declarative/qdeclarativeitem/tst_qdeclarativeitem.cpp
index d800411..46f3517 100644
--- a/tests/auto/declarative/qdeclarativeitem/tst_qdeclarativeitem.cpp
+++ b/tests/auto/declarative/qdeclarativeitem/tst_qdeclarativeitem.cpp
@@ -408,9 +408,14 @@ void tst_QDeclarativeItem::transforms_data()
{
QTest::addColumn<QByteArray>("qml");
QTest::addColumn<QMatrix>("matrix");
- QTest::newRow("translate") << QByteArray("import Qt 4.6\nItem { transform: Translate { x: 10; y: 20 } }") << QMatrix(1,0,0,1,10,20);
- QTest::newRow("rotation") << QByteArray("import Qt 4.6\nItem { transform: Rotation { angle: 90 } }") << QMatrix(0,1,-1,0,0,0);
- QTest::newRow("scale") << QByteArray("import Qt 4.6\nItem { transform: Scale { xScale: 1.5; yScale: -2 } }") << QMatrix(1.5,0,0,-2,0,0);
+ QTest::newRow("translate") << QByteArray("Translate { x: 10; y: 20 }")
+ << QMatrix(1,0,0,1,10,20);
+ QTest::newRow("rotation") << QByteArray("Rotation { angle: 90 }")
+ << QMatrix(0,1,-1,0,0,0);
+ QTest::newRow("scale") << QByteArray("Scale { xScale: 1.5; yScale: -2 }")
+ << QMatrix(1.5,0,0,-2,0,0);
+ QTest::newRow("sequence") << QByteArray("[ Translate { x: 10; y: 20 }, Scale { xScale: 1.5; yScale: -2 } ]")
+ << QMatrix(1,0,0,1,10,20) * QMatrix(1.5,0,0,-2,0,0);
}
void tst_QDeclarativeItem::transforms()
@@ -418,8 +423,9 @@ void tst_QDeclarativeItem::transforms()
QFETCH(QByteArray, qml);
QFETCH(QMatrix, matrix);
QDeclarativeComponent component(&engine);
- component.setData(qml, QUrl::fromLocalFile(""));
+ component.setData("import Qt 4.6\nItem { transform: "+qml+"}", QUrl::fromLocalFile(""));
QDeclarativeItem *item = qobject_cast<QDeclarativeItem*>(component.create());
+ QVERIFY(item);
QCOMPARE(item->sceneMatrix(), matrix);
}