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

Using Path independently from a PathView, opening Path's api

    XMLWordPrintable

Details

    Description

      The work behind PathView is wonderful - it allows you to specify arbitrary curves from a few parameters and move them along the path.

      It would be really great if it could be used out of the delegate/component model. For example, plenty of games could use the features provided by path components to move objects along those path.

      For example:

      Item {
        Path {id: path; ...}
      
        property float percent: 0.0;
      
        NumberAnimation on percent { from: 0.0; to: 1.0; duration: 1000; }
      
        x: path.xAtPercent(percent);
        y: path.yAtPercent(percent);
      }

      The advantage of opening Path's api (or each pathelement instead) would be to allow code such as this, allowing to move an asteroid or an UFO along a path such as you can do in Flash. Or just move different items during an animation with parabolic curves without having to calculate the coordinates manually. It's really a nifty feature, yet nothing is exposed for use by the programmer!

      For example, QPainterPath exposes the necessary methods: http://doc.qt.nokia.com/latest/qpainterpath.html#pointAtPercent. In my opinion QML paths have a lot of potential use, which could be enabled by exposing just bits of the API.

      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)
            coyotte508 coyotte508
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes