From 4b9a44274563b8cc0a9d98f86893df3f31f01307 Mon Sep 17 00:00:00 2001 From: Erik Larsson Date: Wed, 11 Dec 2013 07:22:49 +0100 Subject: 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 Reviewed-by: Robin Burchell Reviewed-by: Gunnar Sletta --- tests/auto/quick/qquickitem2/tst_qquickitem.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'tests/auto/quick') 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("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(component.create()); QVERIFY(item); QCOMPARE(item->itemTransform(0,0), transform); -- cgit v1.2.3