![]() |
[Help needed] SectionScroller QML and QList<QObject*>
Hi,
I'd like to use QML SectionScroller with a QList<QObject*> based model. My ListView's section configuration is: Code:
section.criteria: ViewSection.FirstCharacter When the SectionScroller is inserted to the QML code, I'm getting an error: Code:
.../com/nokia/meego/SectionScroller.qml:319: Error: cannot assign [undefined] to QString Code:
class IrregularVerb : public QObject |
Re: FastScroll/SectionScroller QML and QList<QObject*>
Updated the opening post
|
Re: [Help needed] SectionScroller QML and QList<QObject*>
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. |
All times are GMT. The time now is 03:05. |
vBulletin® Version 3.8.8