[QTBUG-13230] Make QVariantAnimation non-abstract

The bug report argues convincingly that, but for the pure virtual
updateCurrentValue(QVariant) function, QVariantAnimation is quite
usable as-is.

So add an empty implementation.

Reported-by: André Somers <andre@familiesomers.nl>
Task-number: QTBUG-13230
Change-Id: I689b4a80fc7d5dfae67c2255777f89afb16f9c21
Reviewed-by: Andre Somers <andre@familiesomers.nl>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
Marc Mutz 2012-10-04 11:12:45 +02:00 committed by The Qt Project
parent ffc60160d2
commit caaeb20435
2 changed files with 5 additions and 4 deletions

View File

@ -148,13 +148,14 @@ QT_BEGIN_NAMESPACE
*/
/*!
\fn void QVariantAnimation::updateCurrentValue(const QVariant &value) = 0;
This pure virtual function is called every time the animation's current
This virtual function is called every time the animation's current
value changes. The \a value argument is the new current value.
The base class implementation does nothing.
\sa currentValue
*/
void QVariantAnimation::updateCurrentValue(const QVariant &) {}
static bool animationValueLessThan(const QVariantAnimation::KeyValue &p1, const QVariantAnimation::KeyValue &p2)
{

View File

@ -104,7 +104,7 @@ protected:
void updateCurrentTime(int);
void updateState(QAbstractAnimation::State newState, QAbstractAnimation::State oldState);
virtual void updateCurrentValue(const QVariant &value) = 0;
virtual void updateCurrentValue(const QVariant &value);
virtual QVariant interpolated(const QVariant &from, const QVariant &to, qreal progress) const;
private: