[Interest] Customized scrolling

Federico Buti bacarozzo at gmail.com
Tue Nov 25 15:17:32 CET 2014


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 <jensbw at gmail.com> ha scritto:

>
> > On 24 Nov 2014, at 20:14, Federico Buti <bacarozzo at 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20141125/6b410eba/attachment.html>


More information about the Interest mailing list