Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Dynamic access to QML elements from QML

Dynamic access to QML elements from QML

Scheduled Pinned Locked Moved Unsolved General and Desktop
qmldynamictextinputkeyboarddynamic linking
2 Posts 2 Posters 1.3k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    monster
    wrote on 29 Apr 2016, 10:26 last edited by monster
    #1

    Hello!

    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.

    P 1 Reply Last reply 29 Apr 2016, 11:04
    0
    • M monster
      29 Apr 2016, 10:26

      Hello!

      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.

      P Offline
      P Offline
      p3c0
      Moderators
      wrote on 29 Apr 2016, 11:04 last edited by
      #2

      @monster You can create the TextInput using createComponent and 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);
      

      157

      1 Reply Last reply
      0

      2/2

      29 Apr 2016, 11:04

      • Login

      • Login or register to search.
      2 out of 2
      • First post
        2/2
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved