April 27, 2011

Milnadar Milnadar
Lab Rat
26 posts

How to get ListModel elements in C++

 

  1. ListModel{
  2. objectName: "list"
  3. ListElement{
  4. name: "first"
  5. }
  6. ListElement{
  7. name: "second"
  8. }
  9. }

How can i get it’s elements in c++?
I tried to get model by it’s name

  1.  QObject *list = object->findChild<QObject*>("list");

But i do not know what to do next.

1 reply

May 17, 2011

apap_ apap_
Lab Rat
32 posts

you can access to all its children : list->children()

 
  ‹‹ How to create a nested Listview      Create images with QML ››

You must log in to post a reply. Not a member yet? Register here!