QML Dynamic Focus

Hi, I'm working in an application running under an embedded linux device. It
is a complex application that has many QML components which are created and
destroyed when necessary. The user interface is the touchscreen and 4 buttons
accessible through standard GPIO's. What I need to achieve is to change focus
"dynamically" between all the present components, without having to
modify every qml document (if it is possible), when a button is pressed. Each
button has a dedicated signal that the root qml component (ApplicationWindow)
receives. I'm aware of the FocusScope implementation but I wanted to know if
there is some mechanism to access all the root's children and their
properties. Thanks in advanced. Best regards

Hi @p3c0,
Thanks for your response. Sorry if I can't make myself clear but English is not my native language. My application has many QML components and recently I've been requested to implement these function keys (simple buttons attached to GPIOs) as navigation keys. There are 3 keys: up, down and enter. Pressing up or down should highlight the next or the previous element on the screen and pressing enter should simulate the click. So I was wandering if it is possible to access to every child recursively through a simple function. I can't figure it out how would I do it but that would be the idea. Doing this, I want to avoid modifying every single element in the project.

Hi @p3c0
Sorry for keeping you waiting (?) but I was working on another things. I have tried what you said but the element ApplicationWIndow has no property children. On console, whenever I access to root.children.length (root is the id of my ApplicationWIndow) it says

"TypeError: Cannot read property 'length' of undefined"

So, I keep looking and I found out that instead of the children property I have to use the contentItem property and it works.
Thanks a lot for the help
Best regards
Gustavo