How to pass complex qml type data to C++
Unsolved
General and Desktop
-
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> .