moment/src/qml/SidePane/RoomList.qml

41 lines
970 B
QML
Raw Normal View History

2019-07-07 23:52:41 -04:00
// Copyright 2019 miruka
// This file is part of harmonyqml, licensed under LGPLv3.
import QtQuick 2.12
import QtQuick.Layouts 1.12
import SortFilterProxyModel 0.2
import "../Base"
2019-07-07 05:49:02 -04:00
import "../utils.js" as Utils
2019-05-13 13:15:03 -04:00
HListView {
2019-07-12 17:06:37 -04:00
id: roomList
property string userId: ""
property string category: ""
model: SortFilterProxyModel {
2019-07-04 16:01:44 -04:00
sourceModel: rooms
filters: AllOf {
ValueFilter {
roleName: "category"
value: category
}
ValueFilter {
roleName: "userId"
value: userId
}
ExpressionFilter {
2019-07-07 05:49:02 -04:00
// Utils... won't work directly in expression?
function filterIt(filter, text) {
return Utils.filterMatches(filter, text)
}
2019-07-07 05:49:02 -04:00
expression: filterIt(paneToolBar.roomFilter, displayName)
}
}
}
delegate: RoomDelegate {}
}