Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. passing c++ complex model to qml

passing c++ complex model to qml

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
1 Posts 1 Posters 215 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    GregWilsonLindberg
    wrote on last edited by
    #1

    I'm trying to figure out how to pass in a complex structure to qml. I'm using the data in it to populate the models of several qtquick elements.

    The top level object is a QList<QObject *> list with the objects having other QList<QObject *> inside. I've figured out how to get the top level list in to qml from the examples @ Using C++ Models with Qt Quick Views. My current problem is how do I get qml to process the QLists that point to other objects that are contained in the top level object?

    The top level object list is set as a property with a fromVariant() like this:

    ....setInitialProperties({{ "model", QVariant::fromValue(dataList) }});

    If I need to do something similar to the QLists inside the top level object, how do I do that?

    Regards,
    Greg

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved