[solved] ListView.positionViewAtIndex() is not working
-
Hi,
calling
patientList.positionViewAtIndex(idx, ListView.Beginning)
on ListView shown below neither scrolls the view nor prints any QML error in console. The same is true for setting currentIndex.ListView { id: patientList anchors.fill: parent property int itemHeight: 14 * mm clip: true maximumFlickVelocity: 9999 model: SqlQueryModel { id: patientsModel query: "SELECT patient_id, name, surname, birth_date, last_visit_date " + "FROM patients " + "ORDER BY surname " } delegate: patientDelegate } // ListView
I have followed this example to subclass QSqlQueryModel and use it in QML (don't know if this matters): https://wiki.qt.io/How_to_Use_a_QSqlQueryModel_in_QML
What am I doing wrong? I also tried to set patientList.contentY, but this is very slow.
-
Hi,
Thanks for sharing your solution.
To mark as solved just edit the thread title and prepend [solved] to it :)