How to access C++ object instantiated by QML item?
-
Is it possible for my C++ backend code to access the C++ object instantiated by a QML item? In particular I want to access the QSurface3DSeries instantiated by Surface3DSeries. I understand that the backend can get a pointer to the QML item like this:
QObject *surface3DSeries = rootObject->findChild<QObject*>("mySeries");
But how do I get a pointer to the QSurface3DSeries that's instantiated by surface3DSeries so that I can explicitly set its data from C++?
Thanks
Tom -
Is it possible for my C++ backend code to access the C++ object instantiated by a QML item? In particular I want to access the QSurface3DSeries instantiated by Surface3DSeries. I understand that the backend can get a pointer to the QML item like this:
QObject *surface3DSeries = rootObject->findChild<QObject*>("mySeries");
But how do I get a pointer to the QSurface3DSeries that's instantiated by surface3DSeries so that I can explicitly set its data from C++?
Thanks
Tom@tom-asso said in How to access C++ object instantiated by QML item?:
the same way:
rootObject->findChild<QSurface3DSeries*>()