Use filtered model strictly when neccessary

This commit is contained in:
miruka
2020-04-15 16:54:24 -04:00
parent 01adcff77e
commit 99d59bb49b
3 changed files with 26 additions and 31 deletions

View File

@@ -14,7 +14,17 @@ HColumnLayout {
id: memberList
clip: true
model: HSortFilterProxyModel {
// https://github.com/oKcerG/SortFilterProxyModel/issues/75
model: filterField.text ? proxy : proxy.sourceModel
delegate: MemberDelegate {
width: memberList.width
}
Layout.fillWidth: true
Layout.fillHeight: true
readonly property HSortFilterProxyModel proxy: HSortFilterProxyModel {
sourceModel: ModelStore.get(chat.userId, chat.roomId, "members")
filters: ExpressionFilter {
@@ -24,13 +34,6 @@ HColumnLayout {
}
}
delegate: MemberDelegate {
width: memberList.width
}
Layout.fillWidth: true
Layout.fillHeight: true
Rectangle {
anchors.fill: parent
z: -100