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

QVariantAnimation with 0 duration doesn't work when direction is QAbstractAnimation::Backward

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3: Somewhat important
    • Resolution: Done
    • Affects Version/s: 4.8.3, 5.0.0 Beta 1
    • Fix Version/s: 5.0.0 RC 1
    • Labels:
      None
    • Environment:
      All platforms, any environment. The bug is in cross platform code.
    • Commits:
      f3597af5adcd2275503e9e4bfb425549f9ab3ced (qtbase)

      Description

      If you set the duration of any variant or property animation to 0, its progress will be stuck at 1 (0..1), and its "end" value set on the target object, after start() has been called. If you change the direction of the animation to QAbstractAnimation::Backward, you would expect the progress to be 0 after start. Instead it's still 1; the code seems to assume that if the duration is 0, the progress must be 1 always.

      We use zero-duration animations for several things - for instance, assigning to a boolean property as part of a more complex animation. We also use zero for all animations in our GUI when we do automated testing. This works for all but animations that have the direction set to QAbstractAnimation::Backward.

      The workaround is to set the duration to higher than 0, but in our testing case, this means we have to wait() between all tests.

      Fix coming up...

        Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            Assignee:
            treinio Topi Reiniƶ
            Reporter:
            bibr Andreas Aardal Hanssen
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes