Thanks to both of you. I don't know why, in my tests, the y property of the delegate was always zero. I guess I should stop testing code changes late at night. :D
I can surely build on that. Thanks a lot, F. Il 25/nov/2014 10:56 <jen...@gmail.com> ha scritto: > > > On 24 Nov 2014, at 20:14, Federico Buti <bacaro...@gmail.com> wrote: > > > > Hi all. > > > > The "add", "remove" and the other Transition properties of the Views > enable a nice customization for the animation of items w.r.t. their view. > > What about scrolling? Is is possible to customize the way items behave > on View scroll? Something like this for instance. > > > > What elements to be used? I had an example (which I modified) that > applys transformations on the currently selected item, so no gradual > transformations like in the example. > > > > I think that it is necessary to define a Behaviour on the y property of > each item to apply a specific Transition. But how to obtain the y poisiton > w.r.t. to the view? MapfromItem()? Where to store it, since saving it as a > property inside the delegate seems not a good idea at all? > > It’s not a problem declaring such properties inside your delegate. > Delegates are are unique objects with theirs own state in QML. A fairly > simple way of doing it is like this: > > ListView { > id: list > model: 100 > anchors.fill: parent > delegate: Rectangle { > property int listY: y - list.contentY > scale: Math.min(1, listY/100) > width: parent.width ; height: 30 > border.color: "lightgray" > } > } > > Regards, > > Jens
_______________________________________________ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest