QML Bar Chart with live-updating data from C++
-
Hi @Hedge,
You have following ways to do it:- Defining QML Types from C++
In short create a QObject derived class and register it using qmlRegisterType so that it is available in QML. - Exposing Attributes of C++ Types to QML
Create a QObject derived class , add some public slots orQ_INVOKABLE
functions and make these available by setting that class as a contextProperty.
In both the cases it will be good idea to provide some properties defined as
Q_PROPERTY
with their respective signals so that QML gets notified on changes in the values of these properties from C++. - Defining QML Types from C++