Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
passing coordinate value from c++ source file to qml file
hem1 last edited by
i am trying to update the coordinate values used in qml file for showing location on the map through c++ source file.
My c++ source file
QQuickView *view = new QQuickView();
Qobject *item =view->rootObject();
where lat and lon are the values which i want to pass to Qml file
i have declared two properties named longitude and latitude for getting values from c++ file
the map center is able to access these lat long values if they are chnaged from source file but marker is not updated according to the chnaged values, is there any better way to pass variables from Qt c++ to Qt Qml?
Use a separate QObject-derived class and set it as context property.