[solved] Find a quick item by name
-
Dear all,
I've read that from C++ is possible to find a QuickItem by name http://qt-project.org/doc/qt-5.0/qtqml/qtqml-cppintegration-interactqmlfromcpp.html. But, is it possible to find an item by name in Quick Object? That is from a Rectangle or from an Item?
@
Rectangle {
[...]
var child = find("object name");
[...]
}
@Joaquim Duran
-
In QML you can usually just use the ID.
All QObject properties are still available, so you can still find it through:
@
for (var i = 0; i < parent.children.length; ++i) {
if (parent.children[i].objectName === "object name") {
// BINGO :)
}
}
@