[solved] correct implementation of ListView with C++
-
Hello everybody
I am enjoying QML for a while now, but i still haven't really solved the use of ListView built from C++ side objects.
"This link ":http://doc-snapshot.qt-project.org/qt5-stable/qtquick/qtquick-modelviewsdata-cppmodels.html appears does not work with 5.1, and i am seeking for good manner in this field.
-
How about this link?
"listView":http://cdumez.blogspot.com/2010/11/how-to-use-c-list-model-in-qml.html
I haven't tried it on Qt5, hope this could solve your problem -
Hi,
The docs you linked should work fine. Any model extending QAbstractListModel can be exposed as a type (via qmlRegisterType) to QML and used as a model for a ListView.
When you say "appears not to work" what do you mean? Which errors do you see reported? What does your list view look like, what do your delegates look like, which roles does your model export as data?
Cheers,
Chris. -
Hello, thank you for your answers.
I finally get a rather good manner using QQmlListProperty which quite efficient and well explained.