From b64e36240b807e6dba783732593036439fec8a62 Mon Sep 17 00:00:00 2001 From: Ivan Solovev Date: Fri, 25 Aug 2023 17:21:11 +0200 Subject: QPauseAnimation: extend tests and fix binding loop Extend the unit-tests for bindable properties and fix the discovered binding loop by using {set}ValueBypassingBindings() in the setter of the duration property. The code refactoring does not modify the setter logic, because previously the binding was anyway implicitly removed when calling the assignment operator. The updated code just does it explicitly. Task-number: QTBUG-116346 Pick-to: 6.6 6.5 Change-Id: I0f339d182efb60500ee7f12e407f200d739da312 Reviewed-by: Ulf Hermann --- src/corelib/animation/qpauseanimation.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/corelib/animation/qpauseanimation.cpp') diff --git a/src/corelib/animation/qpauseanimation.cpp b/src/corelib/animation/qpauseanimation.cpp index eb1e6c3c81b..344b21946e3 100644 --- a/src/corelib/animation/qpauseanimation.cpp +++ b/src/corelib/animation/qpauseanimation.cpp @@ -94,11 +94,10 @@ void QPauseAnimation::setDuration(int msecs) } Q_D(QPauseAnimation); - if (msecs != d->duration) { - d->duration = msecs; + d->duration.removeBindingUnlessInWrapper(); + if (msecs != d->duration.valueBypassingBindings()) { + d->duration.setValueBypassingBindings(msecs); d->duration.notify(); - } else { - d->duration.removeBindingUnlessInWrapper(); } } -- cgit v1.2.3