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

Jason H jhihn at gmx.com
Mon Jun 29 19:10:03 CEST 2015


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
}





More information about the Interest mailing list