diff options
author | Thierry Bastian <thierry.bastian@nokia.com> | 2009-11-19 10:08:50 (GMT) |
---|---|---|
committer | Thierry Bastian <thierry.bastian@nokia.com> | 2009-11-19 10:08:50 (GMT) |
commit | 132a42c28e35ac69a5af8c2b7d478b86e92b87e4 (patch) | |
tree | c1a3e5c8141946edf40bb3e0af2baf4f12cc7a5e /src/corelib/animation | |
parent | 16220ada80b5131bfc0017ea5a600d9e36c4a469 (diff) | |
download | Qt-132a42c28e35ac69a5af8c2b7d478b86e92b87e4.zip Qt-132a42c28e35ac69a5af8c2b7d478b86e92b87e4.tar.gz Qt-132a42c28e35ac69a5af8c2b7d478b86e92b87e4.tar.bz2 |
Complete QVariantAnimation doc to mention qRegisterAnimationInterpolator
Task-number: QTBUG-5970
Diffstat (limited to 'src/corelib/animation')
-rw-r--r-- | src/corelib/animation/qvariantanimation.cpp | 19 |
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 |