Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to pass complex qml type data to C++

How to pass complex qml type data to C++

Scheduled Pinned Locked Moved Unsolved General and Desktop
1 Posts 1 Posters 238 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.
  • D Offline
    D Offline
    dalishi
    wrote on last edited by dalishi
    #1

    Hi, I have a QML application to get a navigation route (QML Route), and I would like to pass the resultant route to my C++ processing class once a route is made in QML.

    The approach I can think of is once a route is made in QML, I can call a method of the C++ processing class to process it. (following the tutorial exposing method from C++ to QML).

     Q_INVOKABLE bool processRoute(HOW TO PASS PARAM HERE!!) { ...}
    

    The Route QML Type has property:

    segments : list<RouteSegment>
    

    for each RouteSegment type has property:

    path : list<coordinate>
    

    So it's basically a nested QML list. My question is how to design the parameters type of the C++ method processRoute(...) to be called in QML and pass the Route type? or How to convert the QML Route to a C++-defined type like QVector<QPointF> .

    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