[Interest] QML ListView/Model currentIndexChanges not firing for synamic models

Dmitry Volosnykh dmitry.volosnykh at gmail.com
Mon Jun 29 19:16:32 CEST 2015


Could you provide complete example?

On Mon, Jun 29, 2015 at 8:10 PM, Jason H <jhihn at gmx.com> wrote:

> We have two scrolling pickers which are based on ListView. They are the
> same QML Component. When one is assigned a static model
> (ListModel/ListElement) it works. When it is created programmatically, it
> does not.
>
> What is going wrong? We've looked into dynamicRoles and tried using sync()
>
> Thanks in advance,
>
> ListModel {
> id: dayModel
> component.onCompleted {
>  for (var i=1; i< 32; i++)
>   append( { value: i.toString() } )
> }
> }
>
> ListModel {
>   id: monthModel
>   ListElement {...}
>   ...
> }
>
> Meanwhile in ListView...
> ListView {
> model: dayModel
> onCurrentIndexChanged: console.log(index) // never works
> }
>
> ListView {
> model: monthModel
> onCurrentIndexChanged: console.log(index) // works
> }
>
>
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20150629/84d560b1/attachment.html>


More information about the Interest mailing list