2023-02-28 12:44:46 +00:00
|
|
|
import QtQml 2.15
|
|
|
|
import SortFilterProxyModel 0.2
|
|
|
|
|
|
|
|
import StatusQ.Core.Utils 0.1
|
|
|
|
import StatusQ.Core.Theme 0.1
|
2024-01-16 12:05:36 +00:00
|
|
|
import StatusQ 0.1
|
2023-02-28 12:44:46 +00:00
|
|
|
|
|
|
|
import utils 1.0
|
|
|
|
|
|
|
|
SortFilterProxyModel {
|
2024-01-16 12:05:36 +00:00
|
|
|
id: root
|
|
|
|
|
|
|
|
property var selectedChannels
|
|
|
|
property var allChannels
|
|
|
|
|
|
|
|
sourceModel: LeftJoinModel {
|
|
|
|
readonly property var channelsModelAlignedKey: SortFilterProxyModel {
|
|
|
|
sourceModel: root.allChannels
|
|
|
|
proxyRoles: [
|
|
|
|
FastExpressionRole {
|
|
|
|
name: "key"
|
|
|
|
expression: model.itemId ?? ""
|
|
|
|
expectedRoles: ["itemId"]
|
2023-02-28 12:44:46 +00:00
|
|
|
}
|
2024-01-16 12:05:36 +00:00
|
|
|
]
|
2023-02-28 12:44:46 +00:00
|
|
|
}
|
2024-01-16 12:05:36 +00:00
|
|
|
leftModel: root.selectedChannels
|
|
|
|
rightModel: channelsModelAlignedKey
|
|
|
|
joinRole: "key"
|
2023-02-28 12:44:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
proxyRoles: [
|
2024-01-16 12:05:36 +00:00
|
|
|
FastExpressionRole {
|
2023-02-28 12:44:46 +00:00
|
|
|
name: "text"
|
2024-01-16 12:05:36 +00:00
|
|
|
expression: "#" + model.name
|
|
|
|
expectedRoles: ["name"]
|
2023-02-28 12:44:46 +00:00
|
|
|
},
|
2024-01-16 12:05:36 +00:00
|
|
|
FastExpressionRole {
|
2023-02-28 12:44:46 +00:00
|
|
|
name: "imageSource"
|
2024-01-16 12:05:36 +00:00
|
|
|
expression: model.icon
|
|
|
|
expectedRoles: ["icon"]
|
2023-02-28 12:44:46 +00:00
|
|
|
},
|
2024-01-16 12:05:36 +00:00
|
|
|
FastExpressionRole {
|
2023-02-28 12:44:46 +00:00
|
|
|
name: "operator"
|
|
|
|
|
|
|
|
// Direct call for singleton enum is not handled properly by SortFilterProxyModel.
|
|
|
|
readonly property int none: OperatorsUtils.Operators.None
|
|
|
|
|
|
|
|
expression: none
|
2024-01-16 12:05:36 +00:00
|
|
|
expectedRoles: []
|
2023-02-28 12:44:46 +00:00
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|