Access items in Grid from C++ code
Unsolved
QML and Qt Quick
-
Hello everyone,
Is there a way in Qt to access items (added with repeater) in Grid from C++ code?
If there is no way to do so or is considered to be a bad practice, would you please suggest an alternative?Thanks))
-
findChild() do not works with Repeater. You need to call itemAt() to get specific children from Repeater.
For example:
QQuickItem* child; QMetaObject::invokeMethod(repeater,"itemAt",Qt::DirectConnection, Q_RETURN_ARG(QQuickItem*,child), Q_ARG(int,i));
-
Thanks for your reply.
3/3