summaryrefslogtreecommitdiffstats
path: root/tests/auto/declarative/qdeclarativeitem/tst_qdeclarativeitem.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/declarative/qdeclarativeitem/tst_qdeclarativeitem.cpp')
-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);
}