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

Animation start() / pause() bug

    XMLWordPrintable

Details

    • 9bc7e70c00736678d1430190566d2575c2ec764a

    Description

      If you call pause() immediately after an animation is started, this animation will change its running state to false before it really finishes.

      A patch that solves this problem is attached.

      Code to reproduce the bug:

      Item {
          width: 200
          height: 200
      
          MouseArea {
              anchors.fill: parent;
              onClicked: animation.running = true;
          }
      
          Timer {
              id: holdTimer
              interval: 1000
              onTriggered: animation.paused = false;
          }
      
          SequentialAnimation {
              id: animation
              onCompleted: console.log("animation completed");
      
              ScriptAction { script: console.log("action 1"); }
              ScriptAction { script: { animation.paused = true; holdTimer.running = true; } }
              PauseAnimation { duration: 200; }
              ScriptAction { script: console.log("action 2"); }
          }
      }
      

      How to reproduce:

      1 Click and wait.

      1.1 The following output is the correct one:

      action 1
      action 2
      animation completed

      1.2 But the following output is generated:

      action 1
      animation completed
      action 2

      Attachments

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

        Activity

          People

            brasser Michael Brasser (closed Nokia identity) (Inactive)
            arezende Adriano Rezende
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes