diff options
author | Erik Larsson <[email protected]> | 2013-12-11 07:22:49 +0100 |
---|---|---|
committer | The Qt Project <[email protected]> | 2014-01-07 14:44:50 +0100 |
commit | 4b9a44274563b8cc0a9d98f86893df3f31f01307 (patch) | |
tree | 953c40be8ec6025a801820041d8201729d797bb7 /src/quick/items/qquicktranslate_p.h | |
parent | 34793538fbbfce733da1d8495b7f2ed05c5e9a8b (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 <[email protected]>
Reviewed-by: Robin Burchell <[email protected]>
Reviewed-by: Gunnar Sletta <[email protected]>
Diffstat (limited to 'src/quick/items/qquicktranslate_p.h')
-rw-r--r-- | src/quick/items/qquicktranslate_p.h | 23 |
1 files changed, 23 insertions, 0 deletions
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) |