diff options
author | Lars Knoll <lars.knoll@nokia.com> | 2009-08-14 19:30:28 (GMT) |
---|---|---|
committer | Lars Knoll <lars.knoll@nokia.com> | 2009-08-14 19:32:15 (GMT) |
commit | 02e5239002786a55d68f04a512baa7d4c5f40e66 (patch) | |
tree | 63c4a54b3120b17acdc49d3dbe300ee30e73bcac | |
parent | 36a87c0a6cbc858dc5ae443cb16ded0f92c7725a (diff) | |
download | Qt-02e5239002786a55d68f04a512baa7d4c5f40e66.zip Qt-02e5239002786a55d68f04a512baa7d4c5f40e66.tar.gz Qt-02e5239002786a55d68f04a512baa7d4c5f40e66.tar.bz2 |
readd and fix the qml documentation for Rotation and Scale
This got forgotten during the move to QGraphicsTransform.
The docs also required a few adjustments as Rotation3D is
now gone and some properties in Scale and Rotation have
changed.
-rw-r--r-- | doc/src/declarative/effects.qdoc | 2 | ||||
-rw-r--r-- | doc/src/declarative/elements.qdoc | 2 | ||||
-rw-r--r-- | doc/src/snippets/declarative/rotation.qml | 8 | ||||
-rw-r--r-- | src/declarative/fx/qfxitem.cpp | 86 |
4 files changed, 91 insertions, 7 deletions
diff --git a/doc/src/declarative/effects.qdoc b/doc/src/declarative/effects.qdoc index 8350dc4..7879260 100644 --- a/doc/src/declarative/effects.qdoc +++ b/doc/src/declarative/effects.qdoc @@ -8,7 +8,7 @@ \list \o Scaling (\l Item \bold scale property) \o Opacity (\l Item \bold opacity property) -\o Rotation (\l Item \bold rotation property, and Rotation3D) +\o Rotation (\l Item \bold rotation property) \o Affine Transforms (\l Squish) \endlist diff --git a/doc/src/declarative/elements.qdoc b/doc/src/declarative/elements.qdoc index b5dd2bb..3f74ff5 100644 --- a/doc/src/declarative/elements.qdoc +++ b/doc/src/declarative/elements.qdoc @@ -137,8 +137,6 @@ The following table lists the Qml elements provided by the Qt Declarative module \list \o \l Scale \o \l Rotation -\o \l Squish -\o \l Rotation3D \endlist \o diff --git a/doc/src/snippets/declarative/rotation.qml b/doc/src/snippets/declarative/rotation.qml index c7e184f..ab7d4ca 100644 --- a/doc/src/snippets/declarative/rotation.qml +++ b/doc/src/snippets/declarative/rotation.qml @@ -10,19 +10,19 @@ Rect { Image { source: "pics/qt.png" } Image { source: "pics/qt.png" - transform: Rotation3D { axis.startX: 30; axis.endX: 30; axis.endY: 60; angle: 18 } + transform: Rotation { origin.x: 30; axis.y: 60; axis.z: 0 angle: 18 } } Image { source: "pics/qt.png" - transform: Rotation3D { axis.startX: 30; axis.endX: 30; axis.endY: 60; angle: 36 } + transform: Rotation { origin.x: 30; axis.y: 60; axis.z: 0 angle: 36 } } Image { source: "pics/qt.png" - transform: Rotation3D { axis.startX: 30; axis.endX: 30; axis.endY: 60; angle: 54 } + transform: Rotation { origin.x: 30; axis.y: 60; axis.z: 0; angle: 54 } } Image { source: "pics/qt.png" - transform: Rotation3D { axis.startX: 30; axis.endX: 30; axis.endY: 60; angle: 72 } + transform: Rotation { origin.x: 30; axis.y: 60; axis.z: 0; angle: 72 } } } //! [0] diff --git a/src/declarative/fx/qfxitem.cpp b/src/declarative/fx/qfxitem.cpp index f10977f..0b86a54 100644 --- a/src/declarative/fx/qfxitem.cpp +++ b/src/declarative/fx/qfxitem.cpp @@ -77,6 +77,92 @@ QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,Scale,QGraphicsScale) QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,Rotation,QGraphicsRotation) /*! + \qmlclass Transform + \brief A transformation. +*/ + +/*! + \qmlclass Scale + \brief A Scale object provides a way to scale an Item. + + The scale object gives more control over scaling than using Item's scale property. Specifically, + it allows a different scale for the x and y axes, and allows the scale to be relative to an + arbitrary point. + + The following example scales the X axis of the Rect, relative to its interior point 25, 25: + \qml + Rect { + width: 100; height: 100 + color: "blue" + transform: Scale { origin.x: 25; origin.y: 25; xScale: 3} + } + \endqml +*/ + +/*! + \qmlproperty real Scale::origin.x + \qmlproperty real Scale::origin.y + + The origin point for the scale. The scale will be relative to this point. +*/ + +/*! + \qmlproperty real Scale::xScale + + The scaling factor for the X axis. +*/ + +/*! + \qmlproperty real Scale::yScale + + The scaling factor for the Y axis. +*/ + +/*! + \qmlclass Rotation + \brief A Rotation object provides a way to rotate an Item around a point using an axis in 3D space. + + The following example rotates a Rect around its interior point 25, 25: + \qml + Rect { + width: 100; height: 100 + color: "blue" + transform: Rotation { origin.x: 25; origin.y: 25; angle: 45} + } + \endqml + + Here is an example of various rotations applied to an \l Image. + \snippet doc/src/snippets/declarative/rotation.qml 0 + + \image axisrotation.png +*/ + +/*! + \qmlproperty real Rotation::origin.x + \qmlproperty real Rotation::origin.y + + The point to rotate around. +*/ + +/*! + \qmlproperty real Rotation::axis.x + \qmlproperty real Rotation::axis.y + \qmlproperty real Rotation::axis.z + + A rotation axis is specified by a vector in 3D space By default the vector defines a rotation around the z-Axis. + + \image 3d-rotation-axis.png + +*/ + +/*! + \qmlproperty real Rotation::angle + + The angle, in degrees, to rotate. +*/ + + +/*! \group group_animation \title Animation */ |