Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-107163

Allow adjusting animation speed/duration while running

XMLWordPrintable

    • Icon: Suggestion Suggestion
    • Resolution: Unresolved
    • Icon: P2: Important P2: Important
    • None
    • None
    • Quick: Other
    • None

      Current Qt Quick animations like PropertyAnimation, NumberAnimation etc. are designed for cases where animating values from A to B with a duration. If user wants to change the duration while the animation is running, this doesn't really work. Duration changes are applied when the animation next time restarts. This is understandable since duration affects easing, which can't be smoothly readjusted while duration changes.

      Consider adding new "animationSpeed" property defaulting to 1.0 which could be modified during the animation runtime to dynamically adjust the animation speed. Due to animations architecture, this could be available just for groups (SequentialAnimation & ParallelAnimation). QML Animation (https://doc.qt.io/qt-6/qml-qtquick-animation.html) is probably a bit too abstact for this as it doesn't contain duration etc. either. Also it could be added into PropertyAnimation (https://doc.qt.io/qt-6/qml-qtquick-propertyanimation.html) but then it wouldn't exist for SequentialAnimation & ParallelAnimation which are probably the most important users and also speed calculations become more costly if all sub-animations can have own animationSpeed and total inherited animationSpeed needs to be calculated.

      Use cases:

      1) Allow changing a running animation speed: Duration can not be adjusted when the animation is running, but it is possible to adjust speed as that only affects the future and not past (easing). There are different use-cases where animation speed should be freely adjustable during the runtime.

      2) Simply adjust the group animations: Say you have a complicated SeqentialAnimation / ParallelAnimation set and you have fine tuned durations of its subanimations. Now there is a request to see what it would look like 10 - 20 % faster. Currently that would require changing duration of each child animation. With animationSpeed it can be done easily with a single property.

      3) Easier slow-motion: Sometime there is a need to provide "slow motion" mode. With animationSpeed that can be more easily achieved to required animation groups than applying multiplier to all durations.

        For Gerrit Dashboard: QTBUG-107163
        # Subject Branch Project Status CR V

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            kagro Kaj Grönholm
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:

                There is 1 open Gerrit change