Planned maintenance: From Sunday 8th December 10:00 CET there will be changes to try and solve the caching issues that have been experienced. If anyone has a problem connecting after this period then please PM @AndyS or any of the moderators.
Dynamic access to QML elements from QML
monster last edited by monster
Is there any way to have "n" TextInputs/TextEdits, and dynamically access them from another object? For example by their objectNames (I know that it is possible to do from Cpp, but I haven't found any method to do this in QML).
Thanks in advance
P.S. The need came out from an idea to use custom global keyboard, that can be set visible or not. But to make this keyboard work, I have to make dynamic match between actually clicked object (text input) and the global keyboard.
@monster You can create the TextInput using
createComponentand then after creating its object you can assign it to a js variable. You can store them for eg. in an array for further reference.
var component = Qt.createComponent("MyTextInput.qml"); var textinput = component.createObject(parent);