diff options
author | Alan Alpert <alan.alpert@nokia.com> | 2009-05-19 06:13:17 (GMT) |
---|---|---|
committer | Alan Alpert <alan.alpert@nokia.com> | 2009-05-19 06:13:17 (GMT) |
commit | 38a978121bef0efd1f6fd573c4289e40352b63a6 (patch) | |
tree | 8323766cda9f181689098e62f36b9cb4ad089bae /src | |
parent | 2057092a86b049075e50eb3bc934982cec991f9b (diff) | |
parent | da5cb2883e2b0e4a52a0aecba2c82808e64668f8 (diff) | |
download | Qt-38a978121bef0efd1f6fd573c4289e40352b63a6.zip Qt-38a978121bef0efd1f6fd573c4289e40352b63a6.tar.gz Qt-38a978121bef0efd1f6fd573c4289e40352b63a6.tar.bz2 |
Merge branch 'kinetic-declarativeui' of git@scm.dev.nokia.troll.no:qt/kinetic into kinetic-declarativeui
Diffstat (limited to 'src')
-rw-r--r-- | src/declarative/fx/qfxanchors.cpp | 4 | ||||
-rw-r--r-- | src/declarative/fx/qfxtransform.cpp | 28 | ||||
-rw-r--r-- | src/declarative/fx/qfxtransform.h | 5 |
3 files changed, 35 insertions, 2 deletions
diff --git a/src/declarative/fx/qfxanchors.cpp b/src/declarative/fx/qfxanchors.cpp index 826d6c1..3eaf47a 100644 --- a/src/declarative/fx/qfxanchors.cpp +++ b/src/declarative/fx/qfxanchors.cpp @@ -186,8 +186,10 @@ void QFxAnchorsPrivate::clearItem(QFxItem *item) fill = 0; if (centeredIn == item) centeredIn = 0; - if (left.item == item) + if (left.item == item) { left.item = 0; + usedAnchors &= ~QFxAnchors::HasLeftAnchor; + } if (right.item == item) { right.item = 0; usedAnchors &= ~QFxAnchors::HasRightAnchor; diff --git a/src/declarative/fx/qfxtransform.cpp b/src/declarative/fx/qfxtransform.cpp index 7b76367..bc59e0a 100644 --- a/src/declarative/fx/qfxtransform.cpp +++ b/src/declarative/fx/qfxtransform.cpp @@ -179,6 +179,20 @@ void QFxAxis::setEndZ(qreal z) emit updated(); } +/*! + \qmlclass Rotation + \brief A Rotation object provides a way to rotate an Item around a point. + + The following example rotates a Rect around its interior point 25, 25: + \qml + Rect { + width: 100; height: 100 + color: "blue" + transform: Rotation { originX: 25; originY: 25; angle: 45} + } + \endqml +*/ + QFxRotation::QFxRotation(QObject *parent) : QFxTransform(parent), _originX(0), _originY(0), _angle(0), _dirty(true) { @@ -188,6 +202,12 @@ QFxRotation::~QFxRotation() { } +/*! + \qmlproperty real Rotation::originX + \qmlproperty real Rotation::originY + + The point to rotate around. +*/ qreal QFxRotation::originX() const { return _originX; @@ -210,6 +230,11 @@ void QFxRotation::setOriginY(qreal oy) update(); } +/*! + \qmlproperty real Rotation::angle + + The angle, in degrees, to rotate. +*/ qreal QFxRotation::angle() const { return _angle; @@ -217,8 +242,11 @@ qreal QFxRotation::angle() const void QFxRotation::setAngle(qreal angle) { + if (_angle == angle) + return; _angle = angle; update(); + emit angleChanged(); } bool QFxRotation::isIdentity() const diff --git a/src/declarative/fx/qfxtransform.h b/src/declarative/fx/qfxtransform.h index a3a1a83..2e17ed5 100644 --- a/src/declarative/fx/qfxtransform.h +++ b/src/declarative/fx/qfxtransform.h @@ -115,7 +115,7 @@ class Q_DECLARATIVE_EXPORT QFxRotation : public QFxTransform Q_PROPERTY(qreal originX READ originX WRITE setOriginX) Q_PROPERTY(qreal originY READ originY WRITE setOriginY) - Q_PROPERTY(qreal angle READ angle WRITE setAngle) + Q_PROPERTY(qreal angle READ angle WRITE setAngle NOTIFY angleChanged()) public: QFxRotation(QObject *parent=0); ~QFxRotation(); @@ -132,6 +132,9 @@ public: virtual bool isIdentity() const; virtual QSimpleCanvas::Matrix transform() const; +Q_SIGNALS: + void angleChanged(); + private Q_SLOTS: void update(); private: |