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. Access items in Grid from C++ code
QtWS25 Last Chance

Access items in Grid from C++ code

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
repeateritemaccessgridc++
3 Posts 2 Posters 1.5k 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.
  • D Offline
    D Offline
    diredko
    wrote on 25 Dec 2015, 12:32 last edited by
    #1

    Hello everyone,
    Is there a way in Qt to access items (added with repeater) in Grid from C++ code?
    If there is no way to do so or is considered to be a bad practice, would you please suggest an alternative?

    Thanks))

    1 Reply Last reply
    0
    • B Offline
      B Offline
      benlau
      Qt Champions 2016
      wrote on 26 Dec 2015, 13:33 last edited by
      #2

      findChild() do not works with Repeater. You need to call itemAt() to get specific children from Repeater.

      For example:

                  QQuickItem* child;
                  QMetaObject::invokeMethod(repeater,"itemAt",Qt::DirectConnection,
                                            Q_RETURN_ARG(QQuickItem*,child),
                                            Q_ARG(int,i));
      
      1 Reply Last reply
      0
      • D Offline
        D Offline
        diredko
        wrote on 30 Dec 2015, 13:07 last edited by
        #3

        Thanks for your reply.

        1 Reply Last reply
        0

        1/3

        25 Dec 2015, 12:32

        • Login

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