Change Path Property of MapPolyline from c++

  • Hi everyone!

    I am developing a small App with QtQuick and I want to draw a line for a route into the map. For that I used the MapPolyline:

     MapPolyline {
            id: mapline
            objectName: "MapLine"
                    { latitude: 47.219791, longitude: 9.546032 },
                    { latitude: 47.219657, longitude: 9.542508 },
                    { latitude: 47.2194446, longitude: 9.5437876 }

    It works perfectly, if I define the coordinates directly in QML.

    But how can I change the content of the path - property from the c++ file?

    Thanks for help!