Details
-
User Story
-
Resolution: Done
-
Not Evaluated
-
None
-
None
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.