diff options
author | Jan-Arve Sæther <jan-arve.saether@nokia.com> | 2009-07-21 09:09:23 (GMT) |
---|---|---|
committer | Jan-Arve Sæther <jan-arve.saether@nokia.com> | 2009-07-21 10:45:38 (GMT) |
commit | 2ee9e0ea326540ebb29ed5a60eb32ac686c45730 (patch) | |
tree | bb350f8ca5c5458f731529636c9b7010e411665a | |
parent | 573235120825c6d95c73adf374fde6ed4f38cafa (diff) | |
download | Qt-2ee9e0ea326540ebb29ed5a60eb32ac686c45730.zip Qt-2ee9e0ea326540ebb29ed5a60eb32ac686c45730.tar.gz Qt-2ee9e0ea326540ebb29ed5a60eb32ac686c45730.tar.bz2 |
Doc fixes to QEasingCurve.
* Remove some references to QAnimation. QAnimation does not exist.
* Clarify the documentation for QEasingCurve::Linear. (avoid "tweening"
and "no easing")
* In the diagrams, change "ease" to "value".
* Change the diagram generation code to use antialiased drawing
(just as we do in the easingcurve example)
Reviewed-by: leo
47 files changed, 25 insertions, 19 deletions
diff --git a/doc/src/diagrams/programs/easingcurve/main.cpp b/doc/src/diagrams/programs/easingcurve/main.cpp index 8a2d53b..f249dbc 100644 --- a/doc/src/diagrams/programs/easingcurve/main.cpp +++ b/doc/src/diagrams/programs/easingcurve/main.cpp @@ -85,32 +85,37 @@ void createCurveIcons() qreal curveScale = iconSize.height()/2; - painter.drawLine(yAxis - 2, xAxis - curveScale, yAxis + 2, xAxis - curveScale); // hor + painter.drawLine(yAxis - 2, xAxis - curveScale, yAxis + 2, xAxis - curveScale); // hor painter.drawLine(yAxis + curveScale, xAxis + 2, yAxis + curveScale, xAxis - 2); // ver painter.drawText(yAxis + curveScale - 8, xAxis - curveScale - 4, QLatin1String("(1,1)")); - + painter.drawText(yAxis + 42, xAxis + 10, QLatin1String("progress")); - painter.drawText(15, xAxis - curveScale - 10, QLatin1String("ease")); - - painter.setPen(QPen(Qt::red, 1, Qt::DotLine)); + painter.drawText(15, xAxis - curveScale - 10, QLatin1String("value")); + + painter.setPen(QPen(Qt::red, 1, Qt::DotLine)); painter.drawLine(yAxis, xAxis - curveScale, yAxis + curveScale, xAxis - curveScale); // hor painter.drawLine(yAxis + curveScale, xAxis, yAxis + curveScale, xAxis - curveScale); // ver - - QPoint currentPos(yAxis, xAxis); - + + QPoint start(yAxis, xAxis - curveScale * curve.valueForProgress(0)); + painter.setPen(Qt::black); QFont font = oldFont; font.setPixelSize(oldFont.pixelSize() + 15); painter.setFont(font); painter.drawText(0, iconSize.height() - 20, iconSize.width(), 20, Qt::AlignHCenter, name); - - for (qreal t = 0; t < 1.0; t+=1.0/curveScale) { + + QPainterPath curvePath; + curvePath.moveTo(start); + for (qreal t = 0; t <= 1.0; t+=1.0/curveScale) { QPoint to; to.setX(yAxis + curveScale * t); to.setY(xAxis - curveScale * curve.valueForProgress(t)); - painter.drawLine(currentPos, to); - currentPos = to; + curvePath.lineTo(to); } + painter.setRenderHint(QPainter::Antialiasing, true); + painter.strokePath(curvePath, QColor(32, 32, 32)); + painter.setRenderHint(QPainter::Antialiasing, false); + QString fileName(QString::fromAscii("qeasingcurve-%1.png").arg(name.toLower())); printf("%s\n", qPrintable(fileName)); pix.save(QString::fromAscii("%1/%2").arg(output).arg(fileName), "PNG"); diff --git a/doc/src/images/qeasingcurve-cosinecurve.png b/doc/src/images/qeasingcurve-cosinecurve.png Binary files differindex b27e763..8cee978 100644 --- a/doc/src/images/qeasingcurve-cosinecurve.png +++ b/doc/src/images/qeasingcurve-cosinecurve.png diff --git a/doc/src/images/qeasingcurve-inback.png b/doc/src/images/qeasingcurve-inback.png Binary files differindex 8506c0f..0064cb3 100644 --- a/doc/src/images/qeasingcurve-inback.png +++ b/doc/src/images/qeasingcurve-inback.png diff --git a/doc/src/images/qeasingcurve-inbounce.png b/doc/src/images/qeasingcurve-inbounce.png Binary files differindex 275b38c..eaa64f8 100644 --- a/doc/src/images/qeasingcurve-inbounce.png +++ b/doc/src/images/qeasingcurve-inbounce.png diff --git a/doc/src/images/qeasingcurve-incirc.png b/doc/src/images/qeasingcurve-incirc.png Binary files differindex b985e9c..7bd0f09 100644 --- a/doc/src/images/qeasingcurve-incirc.png +++ b/doc/src/images/qeasingcurve-incirc.png diff --git a/doc/src/images/qeasingcurve-incubic.png b/doc/src/images/qeasingcurve-incubic.png Binary files differindex e417ee1..1ac9eaf 100644 --- a/doc/src/images/qeasingcurve-incubic.png +++ b/doc/src/images/qeasingcurve-incubic.png diff --git a/doc/src/images/qeasingcurve-incurve.png b/doc/src/images/qeasingcurve-incurve.png Binary files differindex d9a9340..578259e 100644 --- a/doc/src/images/qeasingcurve-incurve.png +++ b/doc/src/images/qeasingcurve-incurve.png diff --git a/doc/src/images/qeasingcurve-inelastic.png b/doc/src/images/qeasingcurve-inelastic.png Binary files differindex b242fd3..f976b5a 100644 --- a/doc/src/images/qeasingcurve-inelastic.png +++ b/doc/src/images/qeasingcurve-inelastic.png diff --git a/doc/src/images/qeasingcurve-inexpo.png b/doc/src/images/qeasingcurve-inexpo.png Binary files differindex f06316c..1af3652 100644 --- a/doc/src/images/qeasingcurve-inexpo.png +++ b/doc/src/images/qeasingcurve-inexpo.png diff --git a/doc/src/images/qeasingcurve-inoutback.png b/doc/src/images/qeasingcurve-inoutback.png Binary files differindex 9fd1446..480bc05 100644 --- a/doc/src/images/qeasingcurve-inoutback.png +++ b/doc/src/images/qeasingcurve-inoutback.png diff --git a/doc/src/images/qeasingcurve-inoutbounce.png b/doc/src/images/qeasingcurve-inoutbounce.png Binary files differindex fb65f31..de62309 100644 --- a/doc/src/images/qeasingcurve-inoutbounce.png +++ b/doc/src/images/qeasingcurve-inoutbounce.png diff --git a/doc/src/images/qeasingcurve-inoutcirc.png b/doc/src/images/qeasingcurve-inoutcirc.png Binary files differindex 123cc54..b4be8ac 100644 --- a/doc/src/images/qeasingcurve-inoutcirc.png +++ b/doc/src/images/qeasingcurve-inoutcirc.png diff --git a/doc/src/images/qeasingcurve-inoutcubic.png b/doc/src/images/qeasingcurve-inoutcubic.png Binary files differindex b07695c..49dfbef 100644 --- a/doc/src/images/qeasingcurve-inoutcubic.png +++ b/doc/src/images/qeasingcurve-inoutcubic.png diff --git a/doc/src/images/qeasingcurve-inoutelastic.png b/doc/src/images/qeasingcurve-inoutelastic.png Binary files differindex 65851e1..5b0e54a 100644 --- a/doc/src/images/qeasingcurve-inoutelastic.png +++ b/doc/src/images/qeasingcurve-inoutelastic.png diff --git a/doc/src/images/qeasingcurve-inoutexpo.png b/doc/src/images/qeasingcurve-inoutexpo.png Binary files differindex 7cbfb13..776984a 100644 --- a/doc/src/images/qeasingcurve-inoutexpo.png +++ b/doc/src/images/qeasingcurve-inoutexpo.png diff --git a/doc/src/images/qeasingcurve-inoutquad.png b/doc/src/images/qeasingcurve-inoutquad.png Binary files differindex c5eed06..2643330 100644 --- a/doc/src/images/qeasingcurve-inoutquad.png +++ b/doc/src/images/qeasingcurve-inoutquad.png diff --git a/doc/src/images/qeasingcurve-inoutquart.png b/doc/src/images/qeasingcurve-inoutquart.png Binary files differindex 3b66c0d..31fc0c8 100644 --- a/doc/src/images/qeasingcurve-inoutquart.png +++ b/doc/src/images/qeasingcurve-inoutquart.png diff --git a/doc/src/images/qeasingcurve-inoutquint.png b/doc/src/images/qeasingcurve-inoutquint.png Binary files differindex c74efe9..4d7a745 100644 --- a/doc/src/images/qeasingcurve-inoutquint.png +++ b/doc/src/images/qeasingcurve-inoutquint.png diff --git a/doc/src/images/qeasingcurve-inoutsine.png b/doc/src/images/qeasingcurve-inoutsine.png Binary files differindex 5964f31..012ff75 100644 --- a/doc/src/images/qeasingcurve-inoutsine.png +++ b/doc/src/images/qeasingcurve-inoutsine.png diff --git a/doc/src/images/qeasingcurve-inquad.png b/doc/src/images/qeasingcurve-inquad.png Binary files differindex 3373310..e697c20 100644 --- a/doc/src/images/qeasingcurve-inquad.png +++ b/doc/src/images/qeasingcurve-inquad.png diff --git a/doc/src/images/qeasingcurve-inquart.png b/doc/src/images/qeasingcurve-inquart.png Binary files differindex 28086d8..6d65175 100644 --- a/doc/src/images/qeasingcurve-inquart.png +++ b/doc/src/images/qeasingcurve-inquart.png diff --git a/doc/src/images/qeasingcurve-inquint.png b/doc/src/images/qeasingcurve-inquint.png Binary files differindex 330aa85..faaaea7 100644 --- a/doc/src/images/qeasingcurve-inquint.png +++ b/doc/src/images/qeasingcurve-inquint.png diff --git a/doc/src/images/qeasingcurve-insine.png b/doc/src/images/qeasingcurve-insine.png Binary files differindex 63d9238..0944903 100644 --- a/doc/src/images/qeasingcurve-insine.png +++ b/doc/src/images/qeasingcurve-insine.png diff --git a/doc/src/images/qeasingcurve-linear.png b/doc/src/images/qeasingcurve-linear.png Binary files differindex 2a05885..fb3aaf3 100644 --- a/doc/src/images/qeasingcurve-linear.png +++ b/doc/src/images/qeasingcurve-linear.png diff --git a/doc/src/images/qeasingcurve-outback.png b/doc/src/images/qeasingcurve-outback.png Binary files differindex 7cb34c6..83b3fa2 100644 --- a/doc/src/images/qeasingcurve-outback.png +++ b/doc/src/images/qeasingcurve-outback.png diff --git a/doc/src/images/qeasingcurve-outbounce.png b/doc/src/images/qeasingcurve-outbounce.png Binary files differindex 932fc16..27ac979 100644 --- a/doc/src/images/qeasingcurve-outbounce.png +++ b/doc/src/images/qeasingcurve-outbounce.png diff --git a/doc/src/images/qeasingcurve-outcirc.png b/doc/src/images/qeasingcurve-outcirc.png Binary files differindex a1a6cb6..0019370 100644 --- a/doc/src/images/qeasingcurve-outcirc.png +++ b/doc/src/images/qeasingcurve-outcirc.png diff --git a/doc/src/images/qeasingcurve-outcubic.png b/doc/src/images/qeasingcurve-outcubic.png Binary files differindex aa1d604..45477c0 100644 --- a/doc/src/images/qeasingcurve-outcubic.png +++ b/doc/src/images/qeasingcurve-outcubic.png diff --git a/doc/src/images/qeasingcurve-outcurve.png b/doc/src/images/qeasingcurve-outcurve.png Binary files differindex a949ae4..295b471 100644 --- a/doc/src/images/qeasingcurve-outcurve.png +++ b/doc/src/images/qeasingcurve-outcurve.png diff --git a/doc/src/images/qeasingcurve-outelastic.png b/doc/src/images/qeasingcurve-outelastic.png Binary files differindex 2a9ba39..1d407ed 100644 --- a/doc/src/images/qeasingcurve-outelastic.png +++ b/doc/src/images/qeasingcurve-outelastic.png diff --git a/doc/src/images/qeasingcurve-outexpo.png b/doc/src/images/qeasingcurve-outexpo.png Binary files differindex e771c2e..5685155 100644 --- a/doc/src/images/qeasingcurve-outexpo.png +++ b/doc/src/images/qeasingcurve-outexpo.png diff --git a/doc/src/images/qeasingcurve-outinback.png b/doc/src/images/qeasingcurve-outinback.png Binary files differindex 7523727..4700ab0 100644 --- a/doc/src/images/qeasingcurve-outinback.png +++ b/doc/src/images/qeasingcurve-outinback.png diff --git a/doc/src/images/qeasingcurve-outinbounce.png b/doc/src/images/qeasingcurve-outinbounce.png Binary files differindex ab73d02..12cc1a8 100644 --- a/doc/src/images/qeasingcurve-outinbounce.png +++ b/doc/src/images/qeasingcurve-outinbounce.png diff --git a/doc/src/images/qeasingcurve-outincirc.png b/doc/src/images/qeasingcurve-outincirc.png Binary files differindex ec4b8d3..c8a5c86 100644 --- a/doc/src/images/qeasingcurve-outincirc.png +++ b/doc/src/images/qeasingcurve-outincirc.png diff --git a/doc/src/images/qeasingcurve-outincubic.png b/doc/src/images/qeasingcurve-outincubic.png Binary files differindex 8b8ae68..42af870 100644 --- a/doc/src/images/qeasingcurve-outincubic.png +++ b/doc/src/images/qeasingcurve-outincubic.png diff --git a/doc/src/images/qeasingcurve-outinelastic.png b/doc/src/images/qeasingcurve-outinelastic.png Binary files differindex 89dde2c..308be57 100644 --- a/doc/src/images/qeasingcurve-outinelastic.png +++ b/doc/src/images/qeasingcurve-outinelastic.png diff --git a/doc/src/images/qeasingcurve-outinexpo.png b/doc/src/images/qeasingcurve-outinexpo.png Binary files differindex 5909901..0692baa 100644 --- a/doc/src/images/qeasingcurve-outinexpo.png +++ b/doc/src/images/qeasingcurve-outinexpo.png diff --git a/doc/src/images/qeasingcurve-outinquad.png b/doc/src/images/qeasingcurve-outinquad.png Binary files differindex 7ddefee..9e3cd83 100644 --- a/doc/src/images/qeasingcurve-outinquad.png +++ b/doc/src/images/qeasingcurve-outinquad.png diff --git a/doc/src/images/qeasingcurve-outinquart.png b/doc/src/images/qeasingcurve-outinquart.png Binary files differindex 00ef597..9a3c16f 100644 --- a/doc/src/images/qeasingcurve-outinquart.png +++ b/doc/src/images/qeasingcurve-outinquart.png diff --git a/doc/src/images/qeasingcurve-outinquint.png b/doc/src/images/qeasingcurve-outinquint.png Binary files differindex 361bfaa4..add9feb 100644 --- a/doc/src/images/qeasingcurve-outinquint.png +++ b/doc/src/images/qeasingcurve-outinquint.png diff --git a/doc/src/images/qeasingcurve-outinsine.png b/doc/src/images/qeasingcurve-outinsine.png Binary files differindex 1737041..4bc2aaf 100644 --- a/doc/src/images/qeasingcurve-outinsine.png +++ b/doc/src/images/qeasingcurve-outinsine.png diff --git a/doc/src/images/qeasingcurve-outquad.png b/doc/src/images/qeasingcurve-outquad.png Binary files differindex 6f27cbd..c505ff9 100644 --- a/doc/src/images/qeasingcurve-outquad.png +++ b/doc/src/images/qeasingcurve-outquad.png diff --git a/doc/src/images/qeasingcurve-outquart.png b/doc/src/images/qeasingcurve-outquart.png Binary files differindex d45a0b8..6eac058 100644 --- a/doc/src/images/qeasingcurve-outquart.png +++ b/doc/src/images/qeasingcurve-outquart.png diff --git a/doc/src/images/qeasingcurve-outquint.png b/doc/src/images/qeasingcurve-outquint.png Binary files differindex 6e7df0e..77a9ad4 100644 --- a/doc/src/images/qeasingcurve-outquint.png +++ b/doc/src/images/qeasingcurve-outquint.png diff --git a/doc/src/images/qeasingcurve-outsine.png b/doc/src/images/qeasingcurve-outsine.png Binary files differindex 7546a0d..d135b2f 100644 --- a/doc/src/images/qeasingcurve-outsine.png +++ b/doc/src/images/qeasingcurve-outsine.png diff --git a/doc/src/images/qeasingcurve-sinecurve.png b/doc/src/images/qeasingcurve-sinecurve.png Binary files differindex ca67d44..6134a01 100644 --- a/doc/src/images/qeasingcurve-sinecurve.png +++ b/doc/src/images/qeasingcurve-sinecurve.png diff --git a/src/corelib/tools/qeasingcurve.cpp b/src/corelib/tools/qeasingcurve.cpp index 18a252a..34ad599 100644 --- a/src/corelib/tools/qeasingcurve.cpp +++ b/src/corelib/tools/qeasingcurve.cpp @@ -60,8 +60,8 @@ Easing curves describe a function that controls how the speed of the interpolation between 0 and 1 should be. Easing curves allow transitions from one value to another to appear more natural than a simple constant speed would allow. - The QEasingCurve class is usually used in conjunction with the QAnimation class, - but can be used on its own. + The QEasingCurve class is usually used in conjunction with the QVariantAnimation and + QPropertyAnimation classes but can be used on its own. To calculate the speed of the interpolation, the easing curve provides the function valueForProgress(), where the \a progress argument specifies the progress of the @@ -80,10 +80,10 @@ \endcode will print the effective progress of the interpolation between 0 and 1. - When using a QAnimation, the easing curve will be used to control the + When using a QPropertyAnimation, the associated easing curve will be used to control the progress of the interpolation between startValue and endValue: \code - QAnimation animation; + QPropertyAnimation animation; animation.setStartValue(0); animation.setEndValue(1000); animation.setDuration(1000); @@ -98,8 +98,7 @@ \value Linear \inlineimage qeasingcurve-linear.png \br - Easing equation function for a simple linear tweening, - with no easing. + Easing equation function for a linear (t) easing curve. \value InQuad \inlineimage qeasingcurve-inquad.png \br Easing equation function for a quadratic (t^2) easing @@ -280,7 +279,9 @@ \omitvalue OutCurve \omitvalue SineCurve \omitvalue CosineCurve - \value Custom This is returned if the user have specified a custom curve type with setCustomType(). Note that you cannot call setType() with this value, but type() can return it. + \value Custom This is returned if the user specified a custom curve type with + setCustomType(). Note that you cannot call setType() with this value, + but type() can return it. \omitvalue NCurveTypes */ |