diff options
| author | Andreas Buhr <andreas.buhr@qt.io> | 2020-12-17 10:04:17 +0100 |
|---|---|---|
| committer | Andreas Buhr <andreas.buhr@qt.io> | 2021-04-19 15:18:46 +0200 |
| commit | 7b6cef0e654eef0d932d1f8afe986eaa9b2299d4 (patch) | |
| tree | f566ef4c5e337e8b0307b80f8b4b49097d8a08f1 /src/corelib/animation/qsequentialanimationgroup.cpp | |
| parent | 97a8727f0ed87d1f9cb79d702f7d1da3951c2e2a (diff) | |
Port QSequentialAnimationGroup to new property system
There is only one property in QSequentialAnimationGroup,
currentAnimation.
This patch ports this property to the new property system
Task-number: QTBUG-85520
Change-Id: Id528d30f551e88a6165bbb6a3c09d44e89257de5
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/corelib/animation/qsequentialanimationgroup.cpp')
| -rw-r--r-- | src/corelib/animation/qsequentialanimationgroup.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/corelib/animation/qsequentialanimationgroup.cpp b/src/corelib/animation/qsequentialanimationgroup.cpp index 1d0b799fefe..7ce86586286 100644 --- a/src/corelib/animation/qsequentialanimationgroup.cpp +++ b/src/corelib/animation/qsequentialanimationgroup.cpp @@ -301,6 +301,11 @@ QAbstractAnimation *QSequentialAnimationGroup::currentAnimation() const return d->currentAnimation; } +QBindable<QAbstractAnimation *> QSequentialAnimationGroup::bindableCurrentAnimation() const +{ + return &d_func()->currentAnimation; +} + /*! \reimp */ @@ -424,6 +429,8 @@ bool QSequentialAnimationGroup::event(QEvent *event) void QSequentialAnimationGroupPrivate::setCurrentAnimation(int index, bool intermediate) { Q_Q(QSequentialAnimationGroup); + // currentAnimation.removeBindingUnlessInWrapper() + // is not necessary here, since it is read only index = qMin(index, animations.count() - 1); @@ -443,8 +450,8 @@ void QSequentialAnimationGroupPrivate::setCurrentAnimation(int index, bool inter if (currentAnimation) currentAnimation->stop(); - currentAnimation = animations.at(index); currentAnimationIndex = index; + currentAnimation = animations.at(index); emit q->currentAnimationChanged(currentAnimation); |
