You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have the following SortFilterProxyModel with an ExpressionRole that has a name that changes based on some property binding. When I select option 'a' or 'b' I expect that I could use the respective role name, but it seems to not trigger the expression function (no log message) and I get undefined as a return value. Does the SortFilterProxyModel not support the behavior that I want or is QML not recognizing that there is a new role present?
ComboBox{
id: nameComboBox
model: ['a','b']
currentIndex:0
}
SortFilterProxyModel{
id: minimumTestModel
sourceModel: ListModel{
ListElement{
unUsed:"you can ignore this"
}
}
proxyRoles: [
ExpressionRole{
// dynamic name, should work when 'b' is selected in ComboBox but doesnt
name:nameComboBox.currentValue
expression: {
console.log('trigger')
return1
}
},
ExpressionRole{
// constant name - present in the combobox, works
name:'a'
expression: {
console.log('trigger')
return2
}
}
]
}
Repeater{
model: minimumTestModel
delegate:Text{
text: model[nameComboBox.currentValue]
}
}
The text was updated successfully, but these errors were encountered:
I have the following SortFilterProxyModel with an ExpressionRole that has a name that changes based on some property binding. When I select option 'a' or 'b' I expect that I could use the respective role name, but it seems to not trigger the expression function (no log message) and I get
undefined
as a return value. Does the SortFilterProxyModel not support the behavior that I want or is QML not recognizing that there is a new role present?The text was updated successfully, but these errors were encountered: