Unsolved Send data from C++ to Qml
-
Hello , i am really new in Qt development
Can anyone explain me how can i send data from c++ to my Qml file .
Ps: I displayed my Qml in Qquickwidget
Any help will be appreciated -
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