moment/src/qml/SidePane/RoomList.qml

39 lines
944 B
QML
Raw Normal View History

import QtQuick 2.7
import QtQuick.Layouts 1.3
import SortFilterProxyModel 0.2
import "../Base"
2019-07-07 19:49:02 +10:00
import "../utils.js" as Utils
2019-05-14 03:15:03 +10:00
HListView {
property string userId: ""
property string category: ""
id: roomList
2019-07-06 06:55:25 +10:00
spacing: sidePane.collapsed ? 0 : sidePane.normalSpacing
model: SortFilterProxyModel {
2019-07-05 06:01:44 +10:00
sourceModel: rooms
filters: AllOf {
ValueFilter {
roleName: "category"
value: category
}
ValueFilter {
roleName: "userId"
value: userId
}
ExpressionFilter {
2019-07-07 19:49:02 +10:00
// Utils... won't work directly in expression?
function filterIt(filter, text) {
return Utils.filterMatches(filter, text)
}
2019-07-07 19:49:02 +10:00
expression: filterIt(paneToolBar.roomFilter, displayName)
}
}
}
delegate: RoomDelegate {}
}