Fix for disallowed property bindings in qml effect files

According to the documentation of ListModel.get, "The returned object
is not guaranteed to remain valid. It should not be used in property
bindings." So the property bindings have been removed, and a js function
has been introduced to update the properties upon list change.

Task-number: QTBUG-49221
Change-Id: Idaed746ca237198b52a3aff0234076331e1512c1
Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
This commit is contained in:
Paolo Angelelli
2015-11-05 10:22:11 +01:00
parent 95bd9d58d8
commit 1c7543a640
12 changed files with 106 additions and 17 deletions

View File

@@ -39,10 +39,16 @@ Effect {
name: "Gamma"
value: 0.5
}
onDataChanged: updateParameters()
}
function updateParameters()
{
gamma = parameters.get(0).value;
}
// Transform slider values, and bind result to shader uniforms
property real gamma: parameters.get(0).value
property real gamma: 0.5
property real numColors: 8.0