How to get a pointer to some qml element from QDeclarativeView?
c++, qml, qt
Solution
I think you need to read this
It explains how to get a reference to a qml object in the section named "Loading QML components from C++"
QML components are essentially object trees with children that have siblings and their own children. Child objects of QML components can be located using the QObject::objectName property with QObject::findChild(). For example, if the root item in MyItem.qml had a child Rectangle item:
So if you need to get a reference you have to write something like
QObject *object = yourview.rootObject();
QObject *your_obj = object->findChild<QObject*>("yourobjName");
Problem
We had some QDeclarativeView, we loaded and opened qml file. How to get pointer to some of its elements (say QWebView from qml's WebView with some Id, placed inside some rectangle)?