Send data from C++ to Qml
-
https://doc.qt.io/qt-5/qtqml-cppintegration-exposecppattributes.html
https://doc.qt.io/qt-5/qtqml-cppintegration-overview.html#:~:text=Overview - QML and C%2B%2B Integration QML is,C%2B%2B functionality to be invoked directly from QML.create a class extends
QObject
use
Q_PROPERTY
,Q_INVOKE
... to expose attribute to qmlcreate a instance of this type
rootObject
setContentProperties()
in main.cppthen you can use this instance, in rootObject qml