summaryrefslogtreecommitdiffstats
path: root/src/corelib/animation
diff options
context:
space:
mode:
authorThierry Bastian <thierry.bastian@nokia.com>2009-11-19 11:08:50 +0100
committerThierry Bastian <thierry.bastian@nokia.com>2009-11-19 11:08:50 +0100
commit132a42c28e35ac69a5af8c2b7d478b86e92b87e4 (patch)
treec1a3e5c8141946edf40bb3e0af2baf4f12cc7a5e /src/corelib/animation
parent16220ada80b5131bfc0017ea5a600d9e36c4a469 (diff)
Complete QVariantAnimation doc to mention qRegisterAnimationInterpolator
Task-number: QTBUG-5970
Diffstat (limited to 'src/corelib/animation')
-rw-r--r--src/corelib/animation/qvariantanimation.cpp19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/corelib/animation/qvariantanimation.cpp b/src/corelib/animation/qvariantanimation.cpp
index c7357783f2..d529f670fa 100644
--- a/src/corelib/animation/qvariantanimation.cpp
+++ b/src/corelib/animation/qvariantanimation.cpp
@@ -104,15 +104,32 @@ QT_BEGIN_NAMESPACE
\o \l{QMetaType::}{QLine}
\o \l{QMetaType::}{QLineF}
\o \l{QMetaType::}{QPoint}
+ \o \l{QMetaType::}{QPointF}
\o \l{QMetaType::}{QSize}
\o \l{QMetaType::}{QSizeF}
\o \l{QMetaType::}{QRect}
\o \l{QMetaType::}{QRectF}
+ \o \l{QMetaType::}{QColor}
\endlist
If you need to interpolate other variant types, including custom
types, you have to implement interpolation for these yourself.
- You do this by reimplementing interpolated(), which returns
+ To do this, you can register an interpolator function for a given
+ type. This function takes 3 parameters: the start value, the end value
+ and the current progress.
+
+ Example:
+ \code
+ QVariant myColorInterpolator(const QColor &start, const QColor &end, qreal progress)
+ {
+ ...
+ return QColor(...);
+ }
+ ...
+ qRegisterAnimationInterpolator<QColor>(myColorInterpolator);
+ \endcode
+
+ Another option is to reimplement interpolated(), which returns
interpolation values for the value being interpolated.
\omit We need some snippets around here. \endomit