QML - reload Repeater data?
-
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???
-
@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 = []
orundefined
(can't remember now which one), and then redefine it
-
@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.
-
Maybe you can take a look at Fluffy Chat
https://gitlab.com/ChristianPauly/fluffychat/ -
@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 ?