summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--doc/src/diagrams/programs/easingcurve/main.cpp29
-rw-r--r--doc/src/images/qeasingcurve-cosinecurve.pngbin2544 -> 3419 bytes
-rw-r--r--doc/src/images/qeasingcurve-inback.pngbin2225 -> 2808 bytes
-rw-r--r--doc/src/images/qeasingcurve-inbounce.pngbin2378 -> 3154 bytes
-rw-r--r--doc/src/images/qeasingcurve-incirc.pngbin2138 -> 2605 bytes
-rw-r--r--doc/src/images/qeasingcurve-incubic.pngbin2230 -> 2722 bytes
-rw-r--r--doc/src/images/qeasingcurve-incurve.pngbin2325 -> 2692 bytes
-rw-r--r--doc/src/images/qeasingcurve-inelastic.pngbin2314 -> 3304 bytes
-rw-r--r--doc/src/images/qeasingcurve-inexpo.pngbin2183 -> 2675 bytes
-rw-r--r--doc/src/images/qeasingcurve-inoutback.pngbin2460 -> 3241 bytes
-rw-r--r--doc/src/images/qeasingcurve-inoutbounce.pngbin2522 -> 3386 bytes
-rw-r--r--doc/src/images/qeasingcurve-inoutcirc.pngbin2352 -> 2843 bytes
-rw-r--r--doc/src/images/qeasingcurve-inoutcubic.pngbin2410 -> 2931 bytes
-rw-r--r--doc/src/images/qeasingcurve-inoutelastic.pngbin2485 -> 3461 bytes
-rw-r--r--doc/src/images/qeasingcurve-inoutexpo.pngbin2383 -> 3004 bytes
-rw-r--r--doc/src/images/qeasingcurve-inoutquad.pngbin2392 -> 2893 bytes
-rw-r--r--doc/src/images/qeasingcurve-inoutquart.pngbin2331 -> 2925 bytes
-rw-r--r--doc/src/images/qeasingcurve-inoutquint.pngbin2244 -> 2823 bytes
-rw-r--r--doc/src/images/qeasingcurve-inoutsine.pngbin2405 -> 2891 bytes
-rw-r--r--doc/src/images/qeasingcurve-inquad.pngbin2283 -> 2733 bytes
-rw-r--r--doc/src/images/qeasingcurve-inquart.pngbin2261 -> 2727 bytes
-rw-r--r--doc/src/images/qeasingcurve-inquint.pngbin2178 -> 2630 bytes
-rw-r--r--doc/src/images/qeasingcurve-insine.pngbin2167 -> 2567 bytes
-rw-r--r--doc/src/images/qeasingcurve-linear.pngbin2165 -> 2318 bytes
-rw-r--r--doc/src/images/qeasingcurve-outback.pngbin2371 -> 2852 bytes
-rw-r--r--doc/src/images/qeasingcurve-outbounce.pngbin2481 -> 3360 bytes
-rw-r--r--doc/src/images/qeasingcurve-outcirc.pngbin2269 -> 2796 bytes
-rw-r--r--doc/src/images/qeasingcurve-outcubic.pngbin2336 -> 2792 bytes
-rw-r--r--doc/src/images/qeasingcurve-outcurve.pngbin2389 -> 2724 bytes
-rw-r--r--doc/src/images/qeasingcurve-outelastic.pngbin2402 -> 3423 bytes
-rw-r--r--doc/src/images/qeasingcurve-outexpo.pngbin2299 -> 2803 bytes
-rw-r--r--doc/src/images/qeasingcurve-outinback.pngbin2400 -> 3026 bytes
-rw-r--r--doc/src/images/qeasingcurve-outinbounce.pngbin2568 -> 3629 bytes
-rw-r--r--doc/src/images/qeasingcurve-outincirc.pngbin2339 -> 2822 bytes
-rw-r--r--doc/src/images/qeasingcurve-outincubic.pngbin2393 -> 2872 bytes
-rw-r--r--doc/src/images/qeasingcurve-outinelastic.pngbin2517 -> 3941 bytes
-rw-r--r--doc/src/images/qeasingcurve-outinexpo.pngbin2377 -> 2923 bytes
-rw-r--r--doc/src/images/qeasingcurve-outinquad.pngbin2380 -> 2858 bytes
-rw-r--r--doc/src/images/qeasingcurve-outinquart.pngbin2319 -> 2830 bytes
-rw-r--r--doc/src/images/qeasingcurve-outinquint.pngbin2248 -> 2724 bytes
-rw-r--r--doc/src/images/qeasingcurve-outinsine.pngbin2388 -> 2817 bytes
-rw-r--r--doc/src/images/qeasingcurve-outquad.pngbin2324 -> 2760 bytes
-rw-r--r--doc/src/images/qeasingcurve-outquart.pngbin2304 -> 2764 bytes
-rw-r--r--doc/src/images/qeasingcurve-outquint.pngbin2242 -> 2687 bytes
-rw-r--r--doc/src/images/qeasingcurve-outsine.pngbin2364 -> 2773 bytes
-rw-r--r--doc/src/images/qeasingcurve-sinecurve.pngbin2470 -> 3329 bytes
-rw-r--r--src/corelib/tools/qeasingcurve.cpp15
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
index b27e763..8cee978 100644
--- a/doc/src/images/qeasingcurve-cosinecurve.png
+++ b/doc/src/images/qeasingcurve-cosinecurve.png
Binary files differ
diff --git a/doc/src/images/qeasingcurve-inback.png b/doc/src/images/qeasingcurve-inback.png
index 8506c0f..0064cb3 100644
--- a/doc/src/images/qeasingcurve-inback.png
+++ b/doc/src/images/qeasingcurve-inback.png
Binary files differ
diff --git a/doc/src/images/qeasingcurve-inbounce.png b/doc/src/images/qeasingcurve-inbounce.png
index 275b38c..eaa64f8 100644
--- a/doc/src/images/qeasingcurve-inbounce.png
+++ b/doc/src/images/qeasingcurve-inbounce.png
Binary files differ
diff --git a/doc/src/images/qeasingcurve-incirc.png b/doc/src/images/qeasingcurve-incirc.png
index b985e9c..7bd0f09 100644
--- a/doc/src/images/qeasingcurve-incirc.png
+++ b/doc/src/images/qeasingcurve-incirc.png
Binary files differ
diff --git a/doc/src/images/qeasingcurve-incubic.png b/doc/src/images/qeasingcurve-incubic.png
index e417ee1..1ac9eaf 100644
--- a/doc/src/images/qeasingcurve-incubic.png
+++ b/doc/src/images/qeasingcurve-incubic.png
Binary files differ
diff --git a/doc/src/images/qeasingcurve-incurve.png b/doc/src/images/qeasingcurve-incurve.png
index d9a9340..578259e 100644
--- a/doc/src/images/qeasingcurve-incurve.png
+++ b/doc/src/images/qeasingcurve-incurve.png
Binary files differ
diff --git a/doc/src/images/qeasingcurve-inelastic.png b/doc/src/images/qeasingcurve-inelastic.png
index b242fd3..f976b5a 100644
--- a/doc/src/images/qeasingcurve-inelastic.png
+++ b/doc/src/images/qeasingcurve-inelastic.png
Binary files differ
diff --git a/doc/src/images/qeasingcurve-inexpo.png b/doc/src/images/qeasingcurve-inexpo.png
index f06316c..1af3652 100644
--- a/doc/src/images/qeasingcurve-inexpo.png
+++ b/doc/src/images/qeasingcurve-inexpo.png
Binary files differ
diff --git a/doc/src/images/qeasingcurve-inoutback.png b/doc/src/images/qeasingcurve-inoutback.png
index 9fd1446..480bc05 100644
--- a/doc/src/images/qeasingcurve-inoutback.png
+++ b/doc/src/images/qeasingcurve-inoutback.png
Binary files differ
diff --git a/doc/src/images/qeasingcurve-inoutbounce.png b/doc/src/images/qeasingcurve-inoutbounce.png
index fb65f31..de62309 100644
--- a/doc/src/images/qeasingcurve-inoutbounce.png
+++ b/doc/src/images/qeasingcurve-inoutbounce.png
Binary files differ
diff --git a/doc/src/images/qeasingcurve-inoutcirc.png b/doc/src/images/qeasingcurve-inoutcirc.png
index 123cc54..b4be8ac 100644
--- a/doc/src/images/qeasingcurve-inoutcirc.png
+++ b/doc/src/images/qeasingcurve-inoutcirc.png
Binary files differ
diff --git a/doc/src/images/qeasingcurve-inoutcubic.png b/doc/src/images/qeasingcurve-inoutcubic.png
index b07695c..49dfbef 100644
--- a/doc/src/images/qeasingcurve-inoutcubic.png
+++ b/doc/src/images/qeasingcurve-inoutcubic.png
Binary files differ
diff --git a/doc/src/images/qeasingcurve-inoutelastic.png b/doc/src/images/qeasingcurve-inoutelastic.png
index 65851e1..5b0e54a 100644
--- a/doc/src/images/qeasingcurve-inoutelastic.png
+++ b/doc/src/images/qeasingcurve-inoutelastic.png
Binary files differ
diff --git a/doc/src/images/qeasingcurve-inoutexpo.png b/doc/src/images/qeasingcurve-inoutexpo.png
index 7cbfb13..776984a 100644
--- a/doc/src/images/qeasingcurve-inoutexpo.png
+++ b/doc/src/images/qeasingcurve-inoutexpo.png
Binary files differ
diff --git a/doc/src/images/qeasingcurve-inoutquad.png b/doc/src/images/qeasingcurve-inoutquad.png
index c5eed06..2643330 100644
--- a/doc/src/images/qeasingcurve-inoutquad.png
+++ b/doc/src/images/qeasingcurve-inoutquad.png
Binary files differ
diff --git a/doc/src/images/qeasingcurve-inoutquart.png b/doc/src/images/qeasingcurve-inoutquart.png
index 3b66c0d..31fc0c8 100644
--- a/doc/src/images/qeasingcurve-inoutquart.png
+++ b/doc/src/images/qeasingcurve-inoutquart.png
Binary files differ
diff --git a/doc/src/images/qeasingcurve-inoutquint.png b/doc/src/images/qeasingcurve-inoutquint.png
index c74efe9..4d7a745 100644
--- a/doc/src/images/qeasingcurve-inoutquint.png
+++ b/doc/src/images/qeasingcurve-inoutquint.png
Binary files differ
diff --git a/doc/src/images/qeasingcurve-inoutsine.png b/doc/src/images/qeasingcurve-inoutsine.png
index 5964f31..012ff75 100644
--- a/doc/src/images/qeasingcurve-inoutsine.png
+++ b/doc/src/images/qeasingcurve-inoutsine.png
Binary files differ
diff --git a/doc/src/images/qeasingcurve-inquad.png b/doc/src/images/qeasingcurve-inquad.png
index 3373310..e697c20 100644
--- a/doc/src/images/qeasingcurve-inquad.png
+++ b/doc/src/images/qeasingcurve-inquad.png
Binary files differ
diff --git a/doc/src/images/qeasingcurve-inquart.png b/doc/src/images/qeasingcurve-inquart.png
index 28086d8..6d65175 100644
--- a/doc/src/images/qeasingcurve-inquart.png
+++ b/doc/src/images/qeasingcurve-inquart.png
Binary files differ
diff --git a/doc/src/images/qeasingcurve-inquint.png b/doc/src/images/qeasingcurve-inquint.png
index 330aa85..faaaea7 100644
--- a/doc/src/images/qeasingcurve-inquint.png
+++ b/doc/src/images/qeasingcurve-inquint.png
Binary files differ
diff --git a/doc/src/images/qeasingcurve-insine.png b/doc/src/images/qeasingcurve-insine.png
index 63d9238..0944903 100644
--- a/doc/src/images/qeasingcurve-insine.png
+++ b/doc/src/images/qeasingcurve-insine.png
Binary files differ
diff --git a/doc/src/images/qeasingcurve-linear.png b/doc/src/images/qeasingcurve-linear.png
index 2a05885..fb3aaf3 100644
--- a/doc/src/images/qeasingcurve-linear.png
+++ b/doc/src/images/qeasingcurve-linear.png
Binary files differ
diff --git a/doc/src/images/qeasingcurve-outback.png b/doc/src/images/qeasingcurve-outback.png
index 7cb34c6..83b3fa2 100644
--- a/doc/src/images/qeasingcurve-outback.png
+++ b/doc/src/images/qeasingcurve-outback.png
Binary files differ
diff --git a/doc/src/images/qeasingcurve-outbounce.png b/doc/src/images/qeasingcurve-outbounce.png
index 932fc16..27ac979 100644
--- a/doc/src/images/qeasingcurve-outbounce.png
+++ b/doc/src/images/qeasingcurve-outbounce.png
Binary files differ
diff --git a/doc/src/images/qeasingcurve-outcirc.png b/doc/src/images/qeasingcurve-outcirc.png
index a1a6cb6..0019370 100644
--- a/doc/src/images/qeasingcurve-outcirc.png
+++ b/doc/src/images/qeasingcurve-outcirc.png
Binary files differ
diff --git a/doc/src/images/qeasingcurve-outcubic.png b/doc/src/images/qeasingcurve-outcubic.png
index aa1d604..45477c0 100644
--- a/doc/src/images/qeasingcurve-outcubic.png
+++ b/doc/src/images/qeasingcurve-outcubic.png
Binary files differ
diff --git a/doc/src/images/qeasingcurve-outcurve.png b/doc/src/images/qeasingcurve-outcurve.png
index a949ae4..295b471 100644
--- a/doc/src/images/qeasingcurve-outcurve.png
+++ b/doc/src/images/qeasingcurve-outcurve.png
Binary files differ
diff --git a/doc/src/images/qeasingcurve-outelastic.png b/doc/src/images/qeasingcurve-outelastic.png
index 2a9ba39..1d407ed 100644
--- a/doc/src/images/qeasingcurve-outelastic.png
+++ b/doc/src/images/qeasingcurve-outelastic.png
Binary files differ
diff --git a/doc/src/images/qeasingcurve-outexpo.png b/doc/src/images/qeasingcurve-outexpo.png
index e771c2e..5685155 100644
--- a/doc/src/images/qeasingcurve-outexpo.png
+++ b/doc/src/images/qeasingcurve-outexpo.png
Binary files differ
diff --git a/doc/src/images/qeasingcurve-outinback.png b/doc/src/images/qeasingcurve-outinback.png
index 7523727..4700ab0 100644
--- a/doc/src/images/qeasingcurve-outinback.png
+++ b/doc/src/images/qeasingcurve-outinback.png
Binary files differ
diff --git a/doc/src/images/qeasingcurve-outinbounce.png b/doc/src/images/qeasingcurve-outinbounce.png
index ab73d02..12cc1a8 100644
--- a/doc/src/images/qeasingcurve-outinbounce.png
+++ b/doc/src/images/qeasingcurve-outinbounce.png
Binary files differ
diff --git a/doc/src/images/qeasingcurve-outincirc.png b/doc/src/images/qeasingcurve-outincirc.png
index ec4b8d3..c8a5c86 100644
--- a/doc/src/images/qeasingcurve-outincirc.png
+++ b/doc/src/images/qeasingcurve-outincirc.png
Binary files differ
diff --git a/doc/src/images/qeasingcurve-outincubic.png b/doc/src/images/qeasingcurve-outincubic.png
index 8b8ae68..42af870 100644
--- a/doc/src/images/qeasingcurve-outincubic.png
+++ b/doc/src/images/qeasingcurve-outincubic.png
Binary files differ
diff --git a/doc/src/images/qeasingcurve-outinelastic.png b/doc/src/images/qeasingcurve-outinelastic.png
index 89dde2c..308be57 100644
--- a/doc/src/images/qeasingcurve-outinelastic.png
+++ b/doc/src/images/qeasingcurve-outinelastic.png
Binary files differ
diff --git a/doc/src/images/qeasingcurve-outinexpo.png b/doc/src/images/qeasingcurve-outinexpo.png
index 5909901..0692baa 100644
--- a/doc/src/images/qeasingcurve-outinexpo.png
+++ b/doc/src/images/qeasingcurve-outinexpo.png
Binary files differ
diff --git a/doc/src/images/qeasingcurve-outinquad.png b/doc/src/images/qeasingcurve-outinquad.png
index 7ddefee..9e3cd83 100644
--- a/doc/src/images/qeasingcurve-outinquad.png
+++ b/doc/src/images/qeasingcurve-outinquad.png
Binary files differ
diff --git a/doc/src/images/qeasingcurve-outinquart.png b/doc/src/images/qeasingcurve-outinquart.png
index 00ef597..9a3c16f 100644
--- a/doc/src/images/qeasingcurve-outinquart.png
+++ b/doc/src/images/qeasingcurve-outinquart.png
Binary files differ
diff --git a/doc/src/images/qeasingcurve-outinquint.png b/doc/src/images/qeasingcurve-outinquint.png
index 361bfaa4..add9feb 100644
--- a/doc/src/images/qeasingcurve-outinquint.png
+++ b/doc/src/images/qeasingcurve-outinquint.png
Binary files differ
diff --git a/doc/src/images/qeasingcurve-outinsine.png b/doc/src/images/qeasingcurve-outinsine.png
index 1737041..4bc2aaf 100644
--- a/doc/src/images/qeasingcurve-outinsine.png
+++ b/doc/src/images/qeasingcurve-outinsine.png
Binary files differ
diff --git a/doc/src/images/qeasingcurve-outquad.png b/doc/src/images/qeasingcurve-outquad.png
index 6f27cbd..c505ff9 100644
--- a/doc/src/images/qeasingcurve-outquad.png
+++ b/doc/src/images/qeasingcurve-outquad.png
Binary files differ
diff --git a/doc/src/images/qeasingcurve-outquart.png b/doc/src/images/qeasingcurve-outquart.png
index d45a0b8..6eac058 100644
--- a/doc/src/images/qeasingcurve-outquart.png
+++ b/doc/src/images/qeasingcurve-outquart.png
Binary files differ
diff --git a/doc/src/images/qeasingcurve-outquint.png b/doc/src/images/qeasingcurve-outquint.png
index 6e7df0e..77a9ad4 100644
--- a/doc/src/images/qeasingcurve-outquint.png
+++ b/doc/src/images/qeasingcurve-outquint.png
Binary files differ
diff --git a/doc/src/images/qeasingcurve-outsine.png b/doc/src/images/qeasingcurve-outsine.png
index 7546a0d..d135b2f 100644
--- a/doc/src/images/qeasingcurve-outsine.png
+++ b/doc/src/images/qeasingcurve-outsine.png
Binary files differ
diff --git a/doc/src/images/qeasingcurve-sinecurve.png b/doc/src/images/qeasingcurve-sinecurve.png
index ca67d44..6134a01 100644
--- a/doc/src/images/qeasingcurve-sinecurve.png
+++ b/doc/src/images/qeasingcurve-sinecurve.png
Binary files differ
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
*/