[Qt-qml] ListView and positionViewAtIndex problem

Stephen Kelly steveire at gmail.com
Wed Jan 5 14:05:31 CET 2011


ext-ari.t.koskenvaara at nokia.com wrote:

> Hi,
> 
> I'm trying to roll listview to show some item which dosen't seen at the
> start of the list. Qml help says that you can use Component.onCompleted
> where you can call positionViewAtIndex, but it seems not working.
> 
> Here is example code:
> 
> ListView {
>     id: list
>     height: parent.height
>     delegate: listDelegate
>     model: theModel
>     clip: true
>     boundsBehavior: "StopAtBounds"
>     focus: true
>     highlight: null
>     Component.onCompleted: {
>         positionViewAtIndex(9, ListView.End); //This is not working
>         //timer.start(); //This is same thing with timer and this is
>         working, but isn't nice solution. console.log("onCompeted");
>     }
>     /*Timer {
>         id: timer
>         interval: 1
>         onTriggered: list.positionViewAtIndex(9, ListView.End);
>     }*/
>     //onFocusChanged: positionViewAtIndex(9, ListView.End); // This is
>     working, but isn't nice solution. //onHeightChanged:
>     positionViewAtIndex(9, ListView.End); // This is working, but isn't
>     nice solution.
> 
> Does anyone seen some kind of problem

Yes. I've seen things like this before and had them fixed.

> and know some good solution to it?

File a bug report. It will be fixed in a later version.

Regards,

Steve.

> 
> Regards
> Ari Koskenvaara




More information about the Qt-qml mailing list