2019-03-26 18:19:55 +11:00
|
|
|
import QtQuick 2.7
|
2019-04-29 05:45:42 +10:00
|
|
|
import QtQuick.Layouts 1.3
|
2019-07-03 03:59:52 +10:00
|
|
|
import SortFilterProxyModel 0.2
|
2019-04-29 05:18:36 +10:00
|
|
|
import "../Base"
|
2019-03-26 18:19:55 +11:00
|
|
|
|
2019-05-14 03:15:03 +10:00
|
|
|
HListView {
|
2019-05-03 04:20:21 +10:00
|
|
|
property string userId: ""
|
|
|
|
property string category: ""
|
2019-04-22 06:53:16 +10:00
|
|
|
|
2019-04-21 07:45:51 +10:00
|
|
|
id: roomList
|
2019-07-03 03:59:52 +10:00
|
|
|
spacing: sidePane.normalSpacing
|
|
|
|
|
|
|
|
model: SortFilterProxyModel {
|
2019-07-05 06:01:44 +10:00
|
|
|
sourceModel: rooms
|
2019-07-03 03:59:52 +10:00
|
|
|
filters: AllOf {
|
|
|
|
ValueFilter {
|
|
|
|
roleName: "category"
|
|
|
|
value: category
|
|
|
|
}
|
|
|
|
|
|
|
|
ValueFilter {
|
|
|
|
roleName: "userId"
|
|
|
|
value: userId
|
|
|
|
}
|
|
|
|
|
|
|
|
ExpressionFilter {
|
|
|
|
expression: {
|
|
|
|
var filter = paneToolBar.roomFilter.toLowerCase()
|
|
|
|
var words = filter.split(" ")
|
|
|
|
var room_name = displayName.toLowerCase()
|
|
|
|
|
|
|
|
for (var i = 0; i < words.length; i++) {
|
|
|
|
if (words[i] && room_name.indexOf(words[i]) == -1) {
|
|
|
|
return false
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-03-26 18:19:55 +11:00
|
|
|
delegate: RoomDelegate {}
|
|
|
|
}
|