UBports Robot Logo UBports Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    QML - reload Repeater data?

    Scheduled Pinned Locked Moved App Development
    5 Posts 3 Posters 4.2k Views 1 Watching
    Loading More Posts
    • 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.
    • 0 Offline
      007fred50
      last edited by 007fred50

      Hello,

      How can i reload Repeater data ??

      i try something like this (repeater.update()) but nothing happen

      Repeater{
      id: repeater
      }

      Or how can i reload all data in Repeater???

      CiberSheepC 1 Reply Last reply Reply Quote 0
      • CiberSheepC Offline
        CiberSheep @007fred50
        last edited by

        @007fred50 You could try something like:

        • If you are using a ListModel, clear() it and re-add() the elements
        • If you are using other type of model, try to id-of-theRepeater.model = [] or undefined (can't remember now which one), and then redefine it

        Another planet, another time, another universe!

        0 1 Reply Last reply Reply Quote 0
        • 0 Offline
          007fred50 @CiberSheep
          last edited by 007fred50

          @CiberSheep Hello,

          How can i create an Message chat app with ListModel

          I use this here:

          Repeater {
                          id: idrepeater
                          model: checkleftright.length
                          Rectangle{
                              width: parent.width
                              height: 50
                              color: "grey"
          
                              Rectangle{
                                  x: setchat(parent.width,index)
                                  width: parent.width / 2
                                  //height: 100
                                  color: "red"
                                  //radius: 15
          
                                  Text{
                                      width: parent.width
                                      height: parent.height
                                      text: chatmessages[index+1]
          
                                      wrapMode: Text.WordWrap
                                  }
                              }
                          }
                      }
          

          this is dynamic on page load.

          lduboeufL 1 Reply Last reply Reply Quote 0
          • CiberSheepC Offline
            CiberSheep
            last edited by

            Maybe you can take a look at Fluffy Chat
            https://gitlab.com/ChristianPauly/fluffychat/

            Another planet, another time, another universe!

            1 Reply Last reply Reply Quote 0
            • lduboeufL Offline
              lduboeuf @007fred50
              last edited by lduboeuf

              @007fred50 Have you read some documentations about the Model View Delegate in QML ?.
              I can suggest https://qmlbook.github.io/ or the general Qt QML documentation
              [link text](link url)

              And yes best is to find examples. What does not work with yoyr. example ?

              1 Reply Last reply Reply Quote 0

              Hello! It looks like you're interested in this conversation, but you don't have an account yet.

              Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

              With your input, this post could be even better 💗

              Register Login
              • First post
                Last post