diff options
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 }) } } |
