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 --- src/quick/items/qquicktranslate_p.h | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'src/quick/items/qquicktranslate_p.h') diff --git a/src/quick/items/qquicktranslate_p.h b/src/quick/items/qquicktranslate_p.h index d7843fe103..dd93275a28 100644 --- a/src/quick/items/qquicktranslate_p.h +++ b/src/quick/items/qquicktranslate_p.h @@ -148,6 +148,29 @@ private: Q_DECLARE_PRIVATE(QQuickRotation) }; +class QQuickMatrix4x4Private; +class Q_AUTOTEST_EXPORT QQuickMatrix4x4 : public QQuickTransform +{ + Q_OBJECT + + Q_PROPERTY(QMatrix4x4 matrix READ matrix WRITE setMatrix NOTIFY matrixChanged) +public: + QQuickMatrix4x4(QObject *parent = 0); + ~QQuickMatrix4x4(); + + QMatrix4x4 matrix() const; + void setMatrix(const QMatrix4x4& matrix); + + void applyTo(QMatrix4x4 *matrix) const; + +Q_SIGNALS: + void matrixChanged(); + +private: + Q_DECLARE_PRIVATE(QQuickMatrix4x4) +}; + + QT_END_NAMESPACE QML_DECLARE_TYPE(QQuickTranslate) -- cgit v1.2.3