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. Detecting onComplete of Repeater
Forum Updated to NodeBB v4.3 + New Features

Detecting onComplete of Repeater

Scheduled Pinned Locked Moved QML and Qt Quick
5 Posts 2 Posters 1.6k Views 1 Watching
  • 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.
  • S Offline
    S Offline
    Schneidi
    wrote on last edited by
    #1

    Hello,

    I use a repeater to display Items in a column.
    And i need to detect the moment the repeater has finished the
    instantiation of its items.

    Currently i use the onItemAdded and emit a signal when the last item was added.
    But this doesn't work because after gettin the signal the properties of the repeaters
    items may still change.

    What can i do to call a function after the repeater has build all its items. And the items
    are done processing their properties ?

    Thanks for any help

    1 Reply Last reply
    0
    • GianlucaG Offline
      GianlucaG Offline
      Gianluca
      wrote on last edited by
      #2

      I've never had exactly your problem, but in other case I got a similar problem.
      So, when the onComplete it's not enough, I use an intermediate Loader.
      But, I've never tried this approach on Repeater, so give a try and let me know.

      The idea is to wrapped the Repeated into a Loader item in this way:
      @

      Loader {
      id: repeaterWrapper
      // this synchronize the loading of wrapped items
      asynchronous: false
      // this will hide everything during the creation of the Repeater
      visible: false
      sourceComponent: Repeater {
      ... your stuff ...
      }
      onStatusChanged: {
      if ( status == Loader.Ready ) {
      // do what you need to do after completation
      visible = true
      }
      }
      @

      1 Reply Last reply
      0
      • S Offline
        S Offline
        Schneidi
        wrote on last edited by
        #3

        seems like a good approach. Didn't know that this is possible.

        I may give it a try.

        Thanks

        1 Reply Last reply
        0
        • GianlucaG Offline
          GianlucaG Offline
          Gianluca
          wrote on last edited by
          #4

          Loader is one of my favorite item ... it's incredibile how you can exploit it do to a lot of stuff :-)

          1 Reply Last reply
          0
          • S Offline
            S Offline
            Schneidi
            wrote on last edited by
            #5

            Nope this approach doesn't solved the problem.
            Same behavior as before.

            The onStatusChanged signal emits another signal which is used
            to process the repeaters items. But the log shows that the Items
            in the Repeater still chance after the loader is finished.

            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