summaryrefslogtreecommitdiffstats
path: root/examples/multimedia/video/qmlvideofx/qml/qmlvideofx/EffectShockwave.qml
diff options
context:
space:
mode:
authorPaolo Angelelli <paolo.angelelli@theqtcompany.com>2015-11-05 10:22:11 +0100
committerPaolo Angelelli <paolo.angelelli@theqtcompany.com>2015-11-06 09:32:41 +0000
commit1c7543a64072c07ca6d8741ae352e5f999f4c270 (patch)
tree63cbd5a1a2a1f6dcea973681f6f23329efb7502e /examples/multimedia/video/qmlvideofx/qml/qmlvideofx/EffectShockwave.qml
parent95bd9d58d8d37ddec8d37f5b35128689c0aa55a8 (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/EffectShockwave.qml')
-rw-r--r--examples/multimedia/video/qmlvideofx/qml/qmlvideofx/EffectShockwave.qml11
1 files changed, 9 insertions, 2 deletions
diff --git a/examples/multimedia/video/qmlvideofx/qml/qmlvideofx/EffectShockwave.qml b/examples/multimedia/video/qmlvideofx/qml/qmlvideofx/EffectShockwave.qml
index 0e0520c29..a20f2445e 100644
--- a/examples/multimedia/video/qmlvideofx/qml/qmlvideofx/EffectShockwave.qml
+++ b/examples/multimedia/video/qmlvideofx/qml/qmlvideofx/EffectShockwave.qml
@@ -40,11 +40,18 @@ Effect {
name: "Amplitude"
value: 0.5
}
+ onDataChanged: updateParameters()
+ }
+
+ function updateParameters()
+ {
+ granularity = parameters.get(0).value * 20;
+ weight = parameters.get(0).value;
}
// Transform slider values, and bind result to shader uniforms
- property real granularity: parameters.get(0).value * 20
- property real weight: parameters.get(0).value
+ property real granularity: 0.5 * 20
+ property real weight: 0.5
property real centerX
property real centerY