• Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Register
  • Login
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 3.5k 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 12 Mar 2020, 18:14 3 Dec 2020, 18:04

      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???

      C 1 Reply Last reply 3 Dec 2020, 18:20 Reply Quote 0
      • C Offline
        CiberSheep @007fred50
        last edited by 3 Dec 2020, 18:20

        @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 3 Dec 2020, 18:51 Reply Quote 0
        • 0 Offline
          007fred50 @CiberSheep
          last edited by 007fred50 12 Mar 2020, 18:53 3 Dec 2020, 18:51

          @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.

          L 1 Reply Last reply 3 Dec 2020, 21:45 Reply Quote 0
          • C Offline
            CiberSheep
            last edited by 3 Dec 2020, 18:56

            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
            • L Offline
              lduboeuf @007fred50
              last edited by lduboeuf 12 Mar 2020, 21:47 3 Dec 2020, 21:45

              @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
              2 out of 5
              • First post
                2/5
                Last post