diff --git a/tests/tst_proxyroles.qml b/tests/tst_proxyroles.qml index f77eeca..c974621 100644 --- a/tests/tst_proxyroles.qml +++ b/tests/tst_proxyroles.qml @@ -55,6 +55,32 @@ Item { } } + ListModel { + id: singleRowModel + ListElement { + changingRole: "Change me" + otherRole: "I don't change" + } + } + + SortFilterProxyModel { + id: noProxyRolesProxyModel + sourceModel: singleRowModel + } + + Instantiator { + id: outerInstantiator + model: noProxyRolesProxyModel + QtObject { + property var counter: ({ count : 0 }) + property string changingRole: model.changingRole + property string otherRole: { + ++counter.count; + return model.otherRole; + } + } + } + TestCase { name: "ProxyRoles" @@ -89,5 +115,12 @@ Item { compare(testModel.get(0, "role1"), "data for role1"); compare(testModel.get(0, "role2"), "data for role2"); } + + function test_ProxyRolesDataChanged() { + outerInstantiator.object.counter.count = 0; + singleRowModel.setProperty(0, "changingRole", "Changed") + compare(outerInstantiator.object.changingRole, "Changed"); + compare(outerInstantiator.object.counter.count, 0); + } } }