diff options
author | Warwick Allison <warwick.allison@nokia.com> | 2010-03-26 07:02:53 (GMT) |
---|---|---|
committer | Warwick Allison <warwick.allison@nokia.com> | 2010-03-26 07:02:53 (GMT) |
commit | b8952aef84c78949959728674db39eafb19efee7 (patch) | |
tree | a258b882059cf7e749e447e230a56e7a8e17c55d /tests/auto/declarative/qdeclarativeitem | |
parent | 56309fe1461c4ea3ca654e535a525165c28a0f12 (diff) | |
download | Qt-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.cpp | 14 |
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); } |