From 1af8c97734a9ded4aa3aa91811753e8f946cdb57 Mon Sep 17 00:00:00 2001 From: miruka Date: Sun, 7 Jul 2019 05:25:03 -0400 Subject: [PATCH] Sort the room members --- src/qml/Chat/RoomSidePane/MembersView.qml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/qml/Chat/RoomSidePane/MembersView.qml b/src/qml/Chat/RoomSidePane/MembersView.qml index 3e42a892..e6aaddc4 100644 --- a/src/qml/Chat/RoomSidePane/MembersView.qml +++ b/src/qml/Chat/RoomSidePane/MembersView.qml @@ -1,5 +1,6 @@ import QtQuick 2.7 import QtQuick.Layouts 1.3 +import SortFilterProxyModel 0.2 import "../../Base" HColumnLayout { @@ -17,7 +18,19 @@ HColumnLayout { Layout.leftMargin: normalSpacing Layout.rightMargin: normalSpacing - model: chatPage.roomInfo.members + model: HListModel { + sourceModel: chatPage.roomInfo.members + + proxyRoles: ExpressionRole { + name: "displayName" + expression: users.getUser(userId).displayName || userId + } + + sorters: StringSorter { + roleName: "displayName" + } + } + delegate: MemberDelegate {} Layout.fillWidth: true