View Single Post
Posts: 435 | Thanked: 769 times | Joined on Apr 2010
#3
You need a QAbstractListModel with the following implementations to be able to use section scrollers or fast scroll:

//the number of total items property...
Q_PROPERTY(int count READ rowCount)

//... and its read method implementation
Q_INVOKABLE int rowCount(const QModelIndex &parent = QModelIndex()) const;

//a get method
Q_INVOKABLE Element* get(int index)




If you think it's an overkill, you may set a class which emits the items in your list and a qml listmodel to capture them. If the items are a lot, hovewer, it will slow down a lot your UI thread.

In my opinion a correct QAbstractListModel is far better, it gives you more features and you can expand it at needs.
__________________
My Fremantle projects: InternetRadioPlayer, QRadio, InternetRadioWidget, AutoRemoveSms, PSAutoLock, TodoListWidget, MediaPlayerWidget
My Harmattan projects: InternetRadioPlayer, QMLRadio, SigmaPlayer, WidgetCanvas, NotesExporter, 3DTris, NoStopPlayer, NotesImporter
 

The Following User Says Thank You to gionni88 For This Useful Post: