diff options
Diffstat (limited to 'src/declarative/fx/qfxtransform.h')
-rw-r--r-- | src/declarative/fx/qfxtransform.h | 58 |
1 files changed, 51 insertions, 7 deletions
diff --git a/src/declarative/fx/qfxtransform.h b/src/declarative/fx/qfxtransform.h index a549b30..fb49294 100644 --- a/src/declarative/fx/qfxtransform.h +++ b/src/declarative/fx/qfxtransform.h @@ -64,7 +64,48 @@ public: virtual bool isIdentity() const; virtual QTransform transform() const; }; -QML_DECLARE_TYPE(QFxTransform) + +class Q_DECLARATIVE_EXPORT QFxScale : public QFxTransform +{ + Q_OBJECT + + Q_PROPERTY(qreal originX READ originX WRITE setOriginX) + Q_PROPERTY(qreal originY READ originY WRITE setOriginY) + Q_PROPERTY(qreal xScale READ xScale WRITE setXScale NOTIFY scaleChanged()) + Q_PROPERTY(qreal yScale READ yScale WRITE setYScale NOTIFY scaleChanged()) +public: + QFxScale(QObject *parent=0); + ~QFxScale(); + + qreal originX() const; + void setOriginX(qreal); + + qreal originY() const; + void setOriginY(qreal); + + qreal xScale() const; + void setXScale(qreal); + + qreal yScale() const; + void setYScale(qreal); + + virtual bool isIdentity() const; + virtual QTransform transform() const; + +Q_SIGNALS: + void scaleChanged(); + +private Q_SLOTS: + void update(); +private: + qreal _originX; + qreal _originY; + qreal _xScale; + qreal _yScale; + + mutable bool _dirty; + mutable QTransform _transform; +}; class Q_DECLARATIVE_EXPORT QFxAxis : public QObject { @@ -104,7 +145,6 @@ private: qreal _endY; qreal _endZ; }; -QML_DECLARE_TYPE(QFxAxis) class Q_DECLARATIVE_EXPORT QFxRotation : public QFxTransform { @@ -142,7 +182,6 @@ private: mutable bool _dirty; mutable QTransform _transform; }; -QML_DECLARE_TYPE(QFxRotation) class Q_DECLARATIVE_EXPORT QFxRotation3D : public QFxTransform { @@ -171,7 +210,6 @@ private: mutable bool _dirty; mutable QTransform _transform; }; -QML_DECLARE_TYPE(QFxRotation3D) class Q_DECLARATIVE_EXPORT QFxTranslation3D : public QFxTransform { @@ -200,7 +238,6 @@ private: mutable bool _dirty; mutable QTransform _transform; }; -QML_DECLARE_TYPE(QFxTranslation3D) class Q_DECLARATIVE_EXPORT QFxPerspective : public QFxTransform { @@ -237,7 +274,6 @@ private: qreal _angle; qreal _aspect; }; -QML_DECLARE_TYPE(QFxPerspective) class Q_DECLARATIVE_EXPORT QFxSquish : public QFxTransform { @@ -303,10 +339,18 @@ private: QSizeF s; QPointF p1, p2, p3, p4; }; -QML_DECLARE_TYPE(QFxSquish) QT_END_NAMESPACE +QML_DECLARE_TYPE(QFxTransform) +QML_DECLARE_TYPE(QFxScale) +QML_DECLARE_TYPE(QFxAxis) +QML_DECLARE_TYPE(QFxRotation) +QML_DECLARE_TYPE(QFxRotation3D) +QML_DECLARE_TYPE(QFxTranslation3D) +QML_DECLARE_TYPE(QFxPerspective) +QML_DECLARE_TYPE(QFxSquish) + QT_END_HEADER #endif // QFXTRANSFORM_H |