Jason, the only commented out line I see there is misspelled name of the component file. Also, I am able to interect each of three list views, and I see running numbers corresponding to current indices. What should be done to reproduce your issue, and how to know that the flaw was found?
On Mon, Jun 29, 2015 at 8:40 PM, Jason H <[email protected]> wrote: > Wouldn't you know it? In constructing the minimal example, the bug was > found. > > It seems that the currentIndex was being initialized. For the monthModel, > it existed. For the dynamically created model it didn't. It seems a bug > though to never be able to update the currentIndex though. We even tried > to set currentItem after creating the model and it did not work. The intent > was to initialize the list to June, in the vertical middle . > > You'll see the commented line in StyledPicker.qml. > > Sample attached. > > *Sent:* Monday, June 29, 2015 at 1:16 PM > *From:* "Dmitry Volosnykh" <[email protected]> > *To:* "Jason H" <[email protected]> > *Cc:* "[email protected]" <[email protected]> > *Subject:* Re: [Interest] QML ListView/Model currentIndexChanges not > firing for synamic models > Could you provide complete example? > > On Mon, Jun 29, 2015 at 8:10 PM, Jason H <[email protected]> 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 >> [email protected] >> http://lists.qt-project.org/mailman/listinfo/interest > >
_______________________________________________ Interest mailing list [email protected] http://lists.qt-project.org/mailman/listinfo/interest
