[Qt-qml] how to expose nested ListModel from C++ to QML?

Chris dchris at gmail.com
Thu Dec 9 11:16:06 CET 2010


>
>
> I used an INVOKABLE method in class A which will return a
> QAbstractListModel, and use it as the model of the inner ListView, but it
> doesn't work.
>
> Actually, this works for me.
I believe you need to cast the returned model to a QObject* to make it work.
For example:

Q_INVOKABLE QObject* commentsForActivity(const QString &id) const;

Kr,
Chris.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt.nokia.com/pipermail/qt-qml/attachments/20101209/07ed03f1/attachment.html 


More information about the Qt-qml mailing list