aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/quick
diff options
context:
space:
mode:
authorErik Larsson <erik@ortogonal.com>2013-12-11 07:22:49 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-01-07 14:44:50 +0100
commit4b9a44274563b8cc0a9d98f86893df3f31f01307 (patch)
tree953c40be8ec6025a801820041d8201729d797bb7 /tests/auto/quick
parent34793538fbbfce733da1d8495b7f2ed05c5e9a8b (diff)
Add QQuickMatrix4x4, a way to specify a matrix transform in QML.
Add QQuickMatrix4x4 which makes it possible to specify a 4x4 matrix tranformation directly in QML instead of decomposing the transformation into rotation, scale etc. It does NOT replace anything, just adds a new way of specifying a tranformation of an Item. Change-Id: I1b123778d1d458dfe4314cdb4f0fc99fd8a4c86a Reviewed-by: Alan Alpert <aalpert@blackberry.com> Reviewed-by: Robin Burchell <robin+qt@viroteck.net> Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
Diffstat (limited to 'tests/auto/quick')
-rw-r--r--tests/auto/quick/qquickitem2/tst_qquickitem.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/auto/quick/qquickitem2/tst_qquickitem.cpp b/tests/auto/quick/qquickitem2/tst_qquickitem.cpp
index 8a4ed5ae4c..64795f9ebe 100644
--- a/tests/auto/quick/qquickitem2/tst_qquickitem.cpp
+++ b/tests/auto/quick/qquickitem2/tst_qquickitem.cpp
@@ -1972,6 +1972,8 @@ void tst_QQuickItem::transforms_data()
QTest::addColumn<QTransform>("transform");
QTest::newRow("translate") << QByteArray("Translate { x: 10; y: 20 }")
<< QTransform(1,0,0,0,1,0,10,20,1);
+ QTest::newRow("matrix4x4") << QByteArray("Matrix4x4 { matrix: Qt.matrix4x4(1,0,0,10, 0,1,0,15, 0,0,1,0, 0,0,0,1) }")
+ << QTransform(1,0,0,0,1,0,10,15,1);
QTest::newRow("rotation") << QByteArray("Rotation { angle: 90 }")
<< QTransform(0,1,0,-1,0,0,0,0,1);
QTest::newRow("scale") << QByteArray("Scale { xScale: 1.5; yScale: -2 }")
@@ -1985,7 +1987,7 @@ void tst_QQuickItem::transforms()
QFETCH(QByteArray, qml);
QFETCH(QTransform, transform);
QQmlComponent component(&engine);
- component.setData("import QtQuick 2.0\nItem { transform: "+qml+"}", QUrl::fromLocalFile(""));
+ component.setData("import QtQuick 2.4\nItem { transform: "+qml+"}", QUrl::fromLocalFile(""));
QQuickItem *item = qobject_cast<QQuickItem*>(component.create());
QVERIFY(item);
QCOMPARE(item->itemTransform(0,0), transform);