From f9c60038bf098015172998c2a216dd02672cd96b Mon Sep 17 00:00:00 2001 From: Alejandro Exojo Date: Sun, 8 May 2016 17:34:26 +0200 Subject: Fix QVariantAnimation documentation Since 5.0, this class is not abstract. Only the documentation of updateCurrentValue was updated at that time. Fix the class reference and the mentions of the class being abstract in the Animation Framework overview. Change-Id: I8ef9accb0b870dc8eb75bfc74361c7f2ad8d1d8b Reviewed-by: Venugopal Shivashankar Reviewed-by: Frederik Gladhorn --- src/corelib/animation/qvariantanimation.cpp | 6 ++---- src/corelib/doc/src/animation.qdoc | 11 ++++++----- 2 files changed, 8 insertions(+), 9 deletions(-) (limited to 'src/corelib') diff --git a/src/corelib/animation/qvariantanimation.cpp b/src/corelib/animation/qvariantanimation.cpp index 1322b8c810..d2545bfb88 100644 --- a/src/corelib/animation/qvariantanimation.cpp +++ b/src/corelib/animation/qvariantanimation.cpp @@ -48,15 +48,13 @@ QT_BEGIN_NAMESPACE \class QVariantAnimation \inmodule QtCore \ingroup animation - \brief The QVariantAnimation class provides an abstract base class for animations. + \brief The QVariantAnimation class provides a base class for animations. \since 4.6 This class is part of \l{The Animation Framework}. It serves as a base class for property and item animations, with functions for shared functionality. - QVariantAnimation cannot be used directly as it is an abstract - class; it has a pure virtual method called updateCurrentValue(). The class performs interpolation over \l{QVariant}s, but leaves using the interpolated values to its subclasses. Currently, Qt provides QPropertyAnimation, which @@ -69,7 +67,7 @@ QT_BEGIN_NAMESPACE start the animation. QVariantAnimation will interpolate the property of the target object and emit valueChanged(). To react to a change in the current value you have to reimplement the - updateCurrentValue() virtual function. + updateCurrentValue() virtual function or connect to said signal. It is also possible to set values at specified steps situated between the start and end value. The interpolation will then diff --git a/src/corelib/doc/src/animation.qdoc b/src/corelib/doc/src/animation.qdoc index e5e67cf503..304eb9d112 100644 --- a/src/corelib/doc/src/animation.qdoc +++ b/src/corelib/doc/src/animation.qdoc @@ -118,11 +118,12 @@ \section1 Animating Qt Properties - As mentioned in the previous section, the QPropertyAnimation class - can interpolate over Qt properties. It is this class that should - be used for animation of values; in fact, its superclass, - QVariantAnimation, is an abstract class, and cannot be used - directly. + As mentioned in the previous section, the QPropertyAnimation class can + interpolate over Qt properties. It is often this class that should be used + for animation of values; in fact, its superclass, QVariantAnimation, has an + empty implementation of \l{QAbstractAnimation::}{updateCurrentValue()}, and + does not change any value unless we change it ourselves on the + \l{QVariantAnimation::valueChanged()}{valueChanged signal}. A major reason we chose to animate Qt properties is that it presents us with freedom to animate already existing classes in -- cgit v1.2.3