Accessing a QList<QObject*> from QML with Qt 4.7

582 views Asked by At

I have a QList list for a primitive logging part. Basically it looks something like this: QList appLog -> appLogEntry -> NfcLogEntry -> QString url + QString uid

I want to expose my model to QML and access the url and uid and other intermediate variables. I have read and gone through several articles, but I think I still have my confusions over the topic. What would be the best way to do it?

Anyone can help me with an example or a code snippet that works on Qt 4.7 and QML 1.0 (I'm developing for a N9)?

1

There are 1 answers

2
NG_ On

That is already described in documentation, take a look at Qt Project -- QML Data Models. See "QObjectList-based model", and here is example.

Good luck!