[Interest] Quick2 ListView - set current index to a new item when added

Ola Røer Thorsen ola at silentwings.no
Mon Dec 9 15:40:27 CET 2013


>
> 2013/12/9 Preet <prismatic.project at gmail.com>
>
>>
>>
>> Have you tried connecting to the onAdd() signal and then calling
>> positionViewAtIndex?
>>
>>
>> http://doc-snapshot.qt-project.org/qdoc/qml-qtquick-listview.html#positionViewAtIndex-method
>>
>>
I was a bit confused about that one, it has to be done like this, right?
It's an attached signal handler, so...

Component {
   id: myDelegate
   Item {

      ListView.onAdd: {
         // here it is, but what is the index?
      }
   }
}

If i use that, what's the index to use in positionViewAtIndex?

What's the difference between that one and Component.onCompleted?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20131209/95f745b3/attachment.html>


More information about the Interest mailing list