This warning category is spelled [duplicate-property-binding] by qmllint.
One property has multiple interceptors.
Setting multiple interceptors on the same property is unsupported by the QML engine.
Lets use Behavior as interceptor twice on the same property:
import QtQuick Rectangle { Behavior on width { NumberAnimation { duration: 1000 } } Behavior on width { // not ok: Duplicate interceptor on property "width" [duplicate-property-binding] NumberAnimation { duration: 2000 } } }
To fix this warning, remove all but one Behavior:
import QtQuick Rectangle { Behavior on width { NumberAnimation { duration: 2000 } } }
See also Property Modifier Types.
One property has multiple value sources.
The value sources will show unexpected behavior when combined. See example below.
Lets use NumberAnimation as value source twice on the same property:
import QtQuick Rectangle { NumberAnimation on x { to: 50; duration: 1000 } NumberAnimation on x { to: 10; duration: 100 } // not ok: Duplicate value source on property "x" [duplicate-property-binding] onXChanged: console.log(x) }
If you check the output of that program, you will see that the two NumberAnimation will interleave each other, which is probably not the effect that was intended. To fix this warning, remove all but one NumberAnimation:
import QtQuick Rectangle { NumberAnimation on x { to: 50; duration: 1000 } }
One property has a value source and a binding on the same property.
The binding will updated the property value before the value source starts updating this property. This may lead to unexpected behavior, and is also harder to read.
Lets use NumberAnimation as value source on the same property:
import QtQuick Rectangle { NumberAnimation on x { to: 50; duration: 1000 } // not ok: Cannot combine value source and binding on property "x" [duplicate-property-binding] x: 55 onXChanged: console.log(x) }
If you check the output of that program, you will see that the NumberAnimation will animate from 55 to 50, which would be easier to read with following code:
import QtQuick Rectangle { NumberAnimation on x { from: 55; to: 50; duration: 1000 } // ok: intentions are clearer now! }
As part of the free Business evaluation, we offer a free welcome call for companies, to talk about your requirements, and how the Felgo SDK & Services can help you. Just sign up and schedule your call.
Sign up now to start your free Business evaluation: