diff options
| author | Xavier Del Campo Romero <xavi92@disroot.org> | 2026-02-03 23:06:44 +0100 |
|---|---|---|
| committer | Xavier Del Campo Romero <xavi92@disroot.org> | 2026-02-03 23:06:44 +0100 |
| commit | b934e6b0fdcc56f2cca1cca9ebce289cebaaafa2 (patch) | |
| tree | 686950abbdc508561a635d5551a38d811c75d337 /ContactList.qml | |
| parent | 997e9b168d362a50cdcdc82c6cc3488a6852737a (diff) | |
| download | yachat6-b934e6b0fdcc56f2cca1cca9ebce289cebaaafa2.tar.gz | |
Replace ConversationModel with ListModel
Diffstat (limited to 'ContactList.qml')
| -rw-r--r-- | ContactList.qml | 34 |
1 files changed, 21 insertions, 13 deletions
diff --git a/ContactList.qml b/ContactList.qml index fa83d51..0eee13b 100644 --- a/ContactList.qml +++ b/ContactList.qml @@ -17,34 +17,42 @@ Page } } - ConversationModel + ListView { - id: cmodel - } + ListModel + { + id: cmodel + } - Connections - { - target: Yc - function onNewConversation(value) + Connections { - cmodel.append(value) + target: Yc + function onNewConversation(jid, to, lastmsg) + { + console.log("jid:", jid, ", to:", to, ", lastmsg:", lastmsg) + cmodel.append({ + "jid": jid, + "to": to, + "lastmsg": lastmsg, + }) + } } - } - ListView - { width: parent.width anchors.fill: parent anchors.horizontalCenter: parent.horizontalCenter model: cmodel delegate: ItemDelegate { + required property int index + required property var model + width: parent.width - text: cmodel.conversations + text: "<b>" + model.jid + "</b>" anchors.horizontalCenter: parent.horizontalCenter onClicked: stack.push("qrc:/org/yachat/app/ChatView.qml", { - destination: cmodel.conversations + destination: model.to }) } } |
