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

SmoothedAnimation cannot be used in a SequentialAnimation

    XMLWordPrintable

Details

    Description

      As shown in the following example (taken from QTBUG-17552), SmoothedAnimations inside a SequentialAnimation will only play once.

      import QtQuick 1.1
      Item {
          width: 950
          height: 500
      
          Rectangle {
              id: blueRect
              color: "blue"
              width: 500; height: 300
      
              Rectangle {
                  id: redRect
                  color: "red"
                  width: 50
                  height: 50
                  anchors.verticalCenter: parent.verticalCenter
              }
      
              SequentialAnimation {
                  id: anim
                  running: true
                  loops: Animation.Infinite
                  SmoothedAnimation {
                      target: redRect; property: "x"
                      from: 0; to: blueRect.width-redRect.width
                      duration: 1000
                  }
                  SmoothedAnimation {
                      target: redRect; property: "x"
                      from: blueRect.width-redRect.width; to: 0
                      onFromChanged: print("new from value: " + from)
                      duration: 1000
                  }
              }
          }
      }
      

      Attachments

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

        Activity

          People

            Unassigned Unassigned
            brasser Michael Brasser (closed Nokia identity) (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes