diff options
author | Sona Kurazyan <sona.kurazyan@qt.io> | 2021-04-07 13:41:17 +0200 |
---|---|---|
committer | Sona Kurazyan <sona.kurazyan@qt.io> | 2021-04-07 14:51:04 +0200 |
commit | a4d1ed854d14f3f15218f6c9bc2ff190259a4d5a (patch) | |
tree | cbdd1a610976562d33bb854658ec590af54dfb94 /src/corelib/animation/qpauseanimation.cpp | |
parent | 0c9fc20e7ff7b4ff0f15e0b2c071ea834625dce9 (diff) |
Do not notify about property changes if the value hasn't changed
After 2ffb91ac592d69adf9458ac45074174537435918 we manually call notify()
for QObjectCompatProperties. Currently we always call it when setting
values to compat properties, even if the value hasn't actually changed.
Fixed to call notify() only if the value is being changed.
Task-number: QTBUG-85520
Change-Id: I385db84c4009c45406e204b96e0e37ce5fa8882b
Reviewed-by: Andreas Buhr <andreas.buhr@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/corelib/animation/qpauseanimation.cpp')
-rw-r--r-- | src/corelib/animation/qpauseanimation.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/corelib/animation/qpauseanimation.cpp b/src/corelib/animation/qpauseanimation.cpp index c2599da692..04d8cca273 100644 --- a/src/corelib/animation/qpauseanimation.cpp +++ b/src/corelib/animation/qpauseanimation.cpp @@ -129,8 +129,13 @@ void QPauseAnimation::setDuration(int msecs) return; } Q_D(QPauseAnimation); - d->duration.setValue(msecs); - d->duration.notify(); + + if (msecs != d->duration) { + d->duration = msecs; + d->duration.notify(); + } else { + d->duration.removeBindingUnlessInWrapper(); + } } QBindable<int> QPauseAnimation::bindableDuration() |