How to get a pointer to some qml element from QDeclarativeView?

We had some QDeclarativeView, we downloaded and opened the qml file. How to get a pointer to some of its elements (say a QWebView from a qml WebView with some Id placed inside some rectangle)?

+3
source share
1 answer

I think you need to read this

It explains how to get a link to a qml object in the section "Loading QML Components from C ++"

QML - , , , . QML QObject:: objectName QObject:: findChild(). , MyItem.qml Rectangle:

, , -

QObject *object = yourview.rootObject();
QObject *your_obj = object->findChild<QObject*>("yourobjName");
+4

All Articles