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. How to access nested Repeater's item property
Forum Update on Monday, May 27th 2025

How to access nested Repeater's item property

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
3 Posts 3 Posters 492 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.
  • Bhushan_SureB Offline
    Bhushan_SureB Offline
    Bhushan_Sure
    wrote on last edited by
    #1
    Column {
            Repeater {
                id: calloutColOuter
                model: 3
                delegate: Rectangle {
                    id: outerDel
                    width: 57 
                    height: 20
    
                    Column {
                        Repeater {
                            id: calloutColInner
                            model: 3
                            delegate: Text {
                                text: " "
                                color: "red"
                                width: 10
                                height: 10
                            }
                        }
                    }
                }
            }
        }
    

    So here, there are two nested repeater. I want to access inner repeater's item by index value. I tried accessing first item of inner repeater by giving this :- "calloutColOuter.itemAt(0).children[0].children[0].itemAt(0).text"
    But this is giving error.

    After that i tried giving this :- calloutColOuter.itemAt(0).children[0].children[0].text
    this is working good but this is printing first item's text, I want to access text of second and third item also.

    Any idea, how can i access Second and third item text also ?

    Thanks :)

    1 Reply Last reply
    0
    • dheerendraD Offline
      dheerendraD Offline
      dheerendra
      Qt Champions 2022
      wrote on last edited by
      #2

      Give the id to each column item & try to access the children. It should work.

      Dheerendra
      @Community Service
      Certified Qt Specialist
      http://www.pthinks.com

      GrecKoG 1 Reply Last reply
      0
      • dheerendraD dheerendra

        Give the id to each column item & try to access the children. It should work.

        GrecKoG Offline
        GrecKoG Offline
        GrecKo
        Qt Champions 2018
        wrote on last edited by
        #3

        @dheerendra said in How to access nested Repeater's item property:

        Give the id to each column item & try to access the children. It should work.

        No it won't. The inner Column is not in the same context.

        @Bhushan_Sure said in How to access nested Repeater's item property:

        Any idea, how can i access Second and third item text also ?

        What's your higher goal? What do you want to achieve? What you are trying to do raises some red flags.

        1 Reply Last reply
        1

        • Login

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