diff options
author | Paolo Angelelli <paolo.angelelli@theqtcompany.com> | 2015-11-05 10:22:11 +0100 |
---|---|---|
committer | Paolo Angelelli <paolo.angelelli@theqtcompany.com> | 2015-11-06 09:32:41 +0000 |
commit | 1c7543a64072c07ca6d8741ae352e5f999f4c270 (patch) | |
tree | 63cbd5a1a2a1f6dcea973681f6f23329efb7502e /examples/multimedia/video/qmlvideofx/qml/qmlvideofx/EffectMagnify.qml | |
parent | 95bd9d58d8d37ddec8d37f5b35128689c0aa55a8 (diff) |
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>
Diffstat (limited to 'examples/multimedia/video/qmlvideofx/qml/qmlvideofx/EffectMagnify.qml')
-rw-r--r-- | examples/multimedia/video/qmlvideofx/qml/qmlvideofx/EffectMagnify.qml | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/examples/multimedia/video/qmlvideofx/qml/qmlvideofx/EffectMagnify.qml b/examples/multimedia/video/qmlvideofx/qml/qmlvideofx/EffectMagnify.qml index 5e8c9e0ef..76535ea7e 100644 --- a/examples/multimedia/video/qmlvideofx/qml/qmlvideofx/EffectMagnify.qml +++ b/examples/multimedia/video/qmlvideofx/qml/qmlvideofx/EffectMagnify.qml @@ -46,6 +46,13 @@ Effect { name: "Diffraction" value: 0.5 } + onDataChanged: updateParameters() + } + + function updateParameters() + { + radius = parameters.get(0).value * 100; + diffractionIndex = parameters.get(1).value; } property real posX: -1 @@ -59,8 +66,8 @@ Effect { } // Transform slider values, and bind result to shader uniforms - property real radius: parameters.get(0).value * 100 - property real diffractionIndex: parameters.get(1).value + property real radius: 0.5 * 100 + property real diffractionIndex: 0.5 onTargetWidthChanged: { if (posX == -1) |