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

Allow animating over a Path in QML using PathAnimation

XMLWordPrintable

      Background

      All Transitions on x,y are linear in QML (i.e. a straight line). It would be useful to be able to animate over a Path

      Use-case

      • Create an animation between two points, but where the animated object follows a path rather than a straight line

      Example Code

      Animation over a Path

      Rectangle {
           id: rect
           width: 200; height: 200;
           Rectangle {
               color: "red"
               width: 50; height: 50
               PathAnimation on x,y {
                   path: Path {
                       startX: 120; startY: 100
                       PathQuad { x: 120; y: 25; controlX: 260; controlY: 75 }
                       PathQuad { x: 120; y: 100; controlX: -20; controlY: 75 }
                       } 
               }
           }
       }
      

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

            brasser Michael Brasser (closed Nokia identity) (Inactive)
            hhartz Henrik Hartz (closed Nokia identity) (Inactive)
            Votes:
            8 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes