From e7e7540aecc5a4a44f1d1a25e58ccbcf662cbe24 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Mon, 27 Jul 2020 17:00:22 +0200 Subject: Deprecate int based convert/canConvert Better to provide the correct meta type to convert to. Change-Id: I8e0d46e4ba482186201c157e302c03874bd38e7b Reviewed-by: Thiago Macieira --- src/corelib/animation/qvariantanimation.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/corelib/animation/qvariantanimation.cpp') diff --git a/src/corelib/animation/qvariantanimation.cpp b/src/corelib/animation/qvariantanimation.cpp index e50cdd05ec..efe1675fe5 100644 --- a/src/corelib/animation/qvariantanimation.cpp +++ b/src/corelib/animation/qvariantanimation.cpp @@ -190,14 +190,15 @@ QVariantAnimationPrivate::QVariantAnimationPrivate() : duration(250), interpolat void QVariantAnimationPrivate::convertValues(int t) { + auto type = QMetaType(t); //this ensures that all the keyValues are of type t for (int i = 0; i < keyValues.count(); ++i) { QVariantAnimation::KeyValue &pair = keyValues[i]; - pair.second.convert(t); + pair.second.convert(type); } //we also need update to the current interval if needed - currentInterval.start.second.convert(t); - currentInterval.end.second.convert(t); + currentInterval.start.second.convert(type); + currentInterval.end.second.convert(type); //... and the interpolator updateInterpolator(); -- cgit v1.2.3