summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
authorOlivier Goffart <ogoffart@trolltech.com>2009-11-20 14:08:26 (GMT)
committerOlivier Goffart <ogoffart@trolltech.com>2009-11-20 14:08:26 (GMT)
commit991a5ed5a8dc0c81d56c88823bd69d986618d4e5 (patch)
treed0391f75f14d3dfcf10773006869da3b574dd136 /src/corelib
parentea990fc4c575a76c46464e8b8caa2a03c64f067b (diff)
parentd9fa92933ff6ff1afad342f7f94e37f810cf8176 (diff)
downloadQt-991a5ed5a8dc0c81d56c88823bd69d986618d4e5.zip
Qt-991a5ed5a8dc0c81d56c88823bd69d986618d4e5.tar.gz
Qt-991a5ed5a8dc0c81d56c88823bd69d986618d4e5.tar.bz2
Merge commit 'd9fa92' into origin-4.6
Diffstat (limited to 'src/corelib')
-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 c735778..d529f67 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