summaryrefslogtreecommitdiffstats
path: root/src/gui/graphicsview/qgraphicsitem.h
diff options
context:
space:
mode:
authorOlivier Goffart <ogoffart@trolltech.com>2009-05-20 14:38:47 (GMT)
committerOlivier Goffart <ogoffart@trolltech.com>2009-05-22 09:09:27 (GMT)
commit8ad5020940f10d4ecc5c5e8b3b9656531cb84ef3 (patch)
tree08d6a137fb06db2c7e78de36d94f146ffd460d76 /src/gui/graphicsview/qgraphicsitem.h
parentab1b7f137350d6eeafec2a64e3c25a4b02be65a9 (diff)
downloadQt-8ad5020940f10d4ecc5c5e8b3b9656531cb84ef3.zip
Qt-8ad5020940f10d4ecc5c5e8b3b9656531cb84ef3.tar.gz
Qt-8ad5020940f10d4ecc5c5e8b3b9656531cb84ef3.tar.bz2
Add properties to QGraphicsItem to change the transformations component
With the new properties it is possible to easily animate. Setting a transform using setTransform is incompatible with thoses properties. Accessing thoses propeties if you set previously a transform will give you the default values. Acknowledged-by: Code made with Andreas. Documentation written with Thierry. This still need a more in depth code review and documentation review. But it is urgent to commit now because the Animation API integration depends on it.
Diffstat (limited to 'src/gui/graphicsview/qgraphicsitem.h')
-rw-r--r--src/gui/graphicsview/qgraphicsitem.h41
1 files changed, 35 insertions, 6 deletions
diff --git a/src/gui/graphicsview/qgraphicsitem.h b/src/gui/graphicsview/qgraphicsitem.h
index 0a0179e..f6ee197 100644
--- a/src/gui/graphicsview/qgraphicsitem.h
+++ b/src/gui/graphicsview/qgraphicsitem.h
@@ -241,11 +241,41 @@ public:
QTransform itemTransform(const QGraphicsItem *other, bool *ok = 0) const;
void setTransform(const QTransform &matrix, bool combine = false);
void resetTransform();
-
- void rotate(qreal angle);
- void scale(qreal sx, qreal sy);
- void shear(qreal sh, qreal sv);
- void translate(qreal dx, qreal dy);
+
+ void rotate(qreal angle); // ### obsolete
+ void scale(qreal sx, qreal sy); // ### obsolete
+ void shear(qreal sh, qreal sv); // ### obsolete
+ void translate(qreal dx, qreal dy); // ### obsolete
+
+ qreal xRotation() const;
+ void setXRotation(qreal angle);
+
+ qreal yRotation() const;
+ void setYRotation(qreal angle);
+
+ qreal zRotation() const;
+ void setZRotation(qreal angle);
+ void setRotation(qreal x, qreal y, qreal z);
+
+ qreal xScale() const;
+ void setXScale(qreal factor);
+
+ qreal yScale() const;
+ void setYScale(qreal factor);
+ void setScale(qreal sx, qreal sy);
+
+ qreal horizontalShear() const;
+ void setHorizontalShear(qreal shear);
+
+ qreal verticalShear() const;
+ void setVerticalShear(qreal shear);
+ void setShear(qreal sh, qreal sv);
+
+ QPointF transformOrigin() const;
+ void setTransformOrigin(const QPointF &origin);
+ inline void setTransformOrigin(qreal x, qreal y)
+ { setTransformOrigin(QPointF(x,y)); }
+
virtual void advance(int phase);
// Stacking order
@@ -1015,4 +1045,3 @@ QT_END_NAMESPACE
QT_END_HEADER
#endif // QGRAPHICSITEM_H
-