[SailfishDevel] Problem with ListView/Model

Gabriel Boehme m.gabrielboehme at googlemail.com
Wed Sep 18 20:29:02 UTC 2013

Hi again,

I was able to solve the problem with deploying and reading from the
right folders. Now I want to show my data (again) on a ListView, this
worked in Alpha1, but will not at the moment.

I'd written a ListModel with role names (reimplemented roleNames() like
Qt5 wants). But the strange thing is, I allways get too much rows. A
qDebug() from rowCount() says for example 6 rows should the model have,
because it's the length of my list with objects, but the ListView has 20
elements as console.log(index) tells me. If there are 8 real rows, it
ends up in 35 rows in the ListView. But I don't know why?

Another thing is, that I get "Unable to assign [undefined] to QString"
for my role names, but they are shown as they should - so they seem to
land correctly in the ListView. The model is extended to QML via
setContextProperty() from main.cpp.

Code is online here: https://github.com/AlphaX2/Freiertag-SailfishOS-Qt5

The thing is: I'm not sure if it's a explicit Sailfish/Silica bug, or
just me, doing something wrong! :-/

Help is very appreciated! 
Thanks in advance!

More information about the Devel mailing list