From ce1d3e9118494e535fb3c1b4e34d8feced7afdd1 Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Fri, 24 Apr 2009 13:24:33 +1000 Subject: Documentation for Path, PathLine, etc. --- doc/src/declarative/elements.qdoc | 7 ++ doc/src/images/declarative-nopercent.png | Bin 0 -> 553 bytes doc/src/images/declarative-pathattribute.png | Bin 0 -> 481 bytes doc/src/images/declarative-pathcubic.png | Bin 0 -> 1261 bytes doc/src/images/declarative-pathquad.png | Bin 0 -> 1517 bytes doc/src/images/declarative-percent.png | Bin 0 -> 530 bytes src/declarative/fx/qfxpath.cpp | 123 ++++++++++++++++++++++++--- 7 files changed, 120 insertions(+), 10 deletions(-) create mode 100644 doc/src/images/declarative-nopercent.png create mode 100644 doc/src/images/declarative-pathattribute.png create mode 100644 doc/src/images/declarative-pathcubic.png create mode 100644 doc/src/images/declarative-pathquad.png create mode 100644 doc/src/images/declarative-percent.png diff --git a/doc/src/declarative/elements.qdoc b/doc/src/declarative/elements.qdoc index afc3726..1191970 100644 --- a/doc/src/declarative/elements.qdoc +++ b/doc/src/declarative/elements.qdoc @@ -101,6 +101,13 @@ The following table lists the Qml elements provided by the Qt Declarative module \o \l PathView \list \o \l Path + \list + \o \l PathLine + \o \l PathQuad + \o \l PathCubic + \o \l PathAttribute + \o \l PathPercent + \endlist \endlist \endlist diff --git a/doc/src/images/declarative-nopercent.png b/doc/src/images/declarative-nopercent.png new file mode 100644 index 0000000..28b00a9 Binary files /dev/null and b/doc/src/images/declarative-nopercent.png differ diff --git a/doc/src/images/declarative-pathattribute.png b/doc/src/images/declarative-pathattribute.png new file mode 100644 index 0000000..04215db Binary files /dev/null and b/doc/src/images/declarative-pathattribute.png differ diff --git a/doc/src/images/declarative-pathcubic.png b/doc/src/images/declarative-pathcubic.png new file mode 100644 index 0000000..ffbca5d Binary files /dev/null and b/doc/src/images/declarative-pathcubic.png differ diff --git a/doc/src/images/declarative-pathquad.png b/doc/src/images/declarative-pathquad.png new file mode 100644 index 0000000..65f1999 Binary files /dev/null and b/doc/src/images/declarative-pathquad.png differ diff --git a/doc/src/images/declarative-percent.png b/doc/src/images/declarative-percent.png new file mode 100644 index 0000000..c277055 Binary files /dev/null and b/doc/src/images/declarative-percent.png differ diff --git a/src/declarative/fx/qfxpath.cpp b/src/declarative/fx/qfxpath.cpp index 14c06bb..06c9f2b 100644 --- a/src/declarative/fx/qfxpath.cpp +++ b/src/declarative/fx/qfxpath.cpp @@ -462,8 +462,43 @@ void QFxCurve::setY(int y) /****************************************************************************/ /*! - \qmlclass PathAttribute - \brief The PathAttribute allows to set an attribute at a given position in the path. + \qmlclass PathAttribute + \brief The PathAttribute allows setting an attribute at a given position in a Path. + + The PathAttribute element allows attibutes consisting of a name and a + value to be specified for the endpoints of path segments. The attributes + are exposed to the delegate as \l {Attached Properties}. The value of + an attribute at any particular point is interpolated from the PathAttributes + bounding the point. + + The example below shows a path with the items scaled to 10% at the ends of + the path and scaled 100% along the PathLine in the middle. Note the use + of the PathView.scale attached property to set the scale of the delegate. + \table + \row + \o \image declarative-pathattribute.png + \o + \code + + + + + + + + + + + + + + + + + \endcode + \endtable + + \sa Path */ /*! @@ -519,8 +554,19 @@ void QFxPathAttribute::setValue(qreal value) /****************************************************************************/ /*! - \qmlclass PathLine - \brief The PathLine defines a straight line. + \qmlclass PathLine + \brief The PathLine defines a straight line. + + The example below creates a path consisting of a straight line from + 0,100 to 200,100: + + \code + + + + \endcode + + \sa Path, PathQuad, PathCubic */ @@ -541,9 +587,22 @@ void QFxPathLine::addToPath(QPainterPath &path) /****************************************************************************/ /*! - \qmlclass PathQuad - \brief The PathQuad defines a quadratic Bezier curve with a control point. + \qmlclass PathQuad + \brief The PathQuad defines a quadratic Bezier curve with a control point. + + The following QML produces the path shown below: + \table + \row + \o \image declarative-pathquad.png + \o + \code + + + + \endcode + \endtable + \sa Path, PathCubic, PathLine */ /*! @@ -557,7 +616,7 @@ void QFxPathLine::addToPath(QPainterPath &path) /*! \qmlproperty string PathQuad::controlX - the x position of the control point. + The x position of the control point. */ /*! @@ -578,7 +637,7 @@ void QFxPathQuad::setControlX(int x) /*! \qmlproperty string PathQuad::controlY - the y position of the control point. + The y position of the control point. */ /*! @@ -608,6 +667,20 @@ void QFxPathQuad::addToPath(QPainterPath &path) \qmlclass PathCubic \brief The PathCubic defines a cubic Bezier curve with two control points. + The following QML produces the path shown below: + \table + \row + \o \image declarative-pathcubic.png + \o + \code + + + + \endcode + \endtable + + \sa Path, PathQuad, PathLine */ /*! @@ -715,9 +788,39 @@ void QFxPathCubic::addToPath(QPainterPath &path) /****************************************************************************/ /*! - \qmlclass PathPercent - \brief The PathPercent manipulates the way a path is interpreted. + \qmlclass PathPercent + \brief The PathPercent manipulates the way a path is interpreted. + + The examples below show the normal distrubution of items along a path + compared to a distribution which places 50% of the items along the + PathLine section of the path. + \table + \row + \o \image declarative-nopercent.png + \o + \code + + + + + + \endcode + \row + \o \image declarative-percent.png + \o + \code + + + + + + + + + \endcode + \endtable + \sa Path */ /*! -- cgit v0.12