Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. [SOLVED]Accessing QML component property dynamically

[SOLVED]Accessing QML component property dynamically

Scheduled Pinned Locked Moved QML and Qt Quick
3 Posts 2 Posters 907 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.
  • K Offline
    K Offline
    KushalAusula
    wrote on last edited by
    #1

    Hi,
    How can we access properties of multiple qml components in a loop

    i.e I have a custom components "box1" "box2" "box3"....."box30"
    this box has a property named "txtLabel" to store text in it.

    Now i have to find out which box has empty "txtLabel"

    i want to do it in a for loop

    like
    for(var i=1; i<=30;i++)
    {
    console.log((box+"i").txtLabel)
    }

    Please help me in achieving above computing.

    Thanq.

    1 Reply Last reply
    0
    • D Offline
      D Offline
      dasRicardo
      wrote on last edited by
      #2

      Take a look @ "this":http://qt-project.org/doc/qt-4.8/qml-item.html#children-prop

      **Sorry for my english :)

      PLEASE ADD [SOLVED] TO YOUR THREAD TITLE IF IT&#x27;S SOLVED.**

      1 Reply Last reply
      0
      • K Offline
        K Offline
        KushalAusula
        wrote on last edited by
        #3

        Its done. That helped me. Thanq.

        1 Reply Last reply
        0

        • Login

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