Closed doakey3 closed 6 months ago
This is solved by using an ExpressionFilter
SortFilterProxyModel {
id: filteredGames
sourceModel: api.allGames
filters: [
ExpressionFilter {
expression: {
if (window.esrb_filter == "none") {
return true
}
else if (window.esrb_filter == model.extra.esrb) {
return true
}
return false
}
enabled: true
}
]
}
In my game metadata files, I have a property:
x-ESRB
with values likeE
,E10plus
,T
,M
. I was wondering if I could filter the games by their ESRB rating using a SortFilterProxyModel, but I can't seem to figure out the proper role name to use. I've triedgame.extra.ESRB
,extra.ESRB
,x-ESRB
. I was referring to this page in the api: https://pegasus-frontend.org/docs/themes/api/Here is the relevant section of code: