Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
6.10.0 Beta1
-
None
Description
Since Qt 6.10.0 Beta 1 we have the following warning
Warning: App.qml:17:4: Duplicate binding on property 'size' [duplicate-property-binding] SequentialAnimation on size { ^^^^^^^^^^^^^^^^^^^ Warning: App.qml:15:24: Note: previous binding on 'size' here [duplicate-property-binding] property real size: initialSize ^^^^^^^^^^^
Example:
import QtQuick import QtQuick.Controls Window { width: 640 height: 480 visible: true title: qsTr("Hello World") Column { Item { id: bindingTest property real initialSize: 5 property real size: initialSize SequentialAnimation on size { id: animation loops: Animation.Infinite running: false NumberAnimation { duration: 5000 from: 0 to: bindingTest.initialSize } NumberAnimation { duration: 5000 easing.type: Easing.Linear from: bindingTest.initialSize to: 0 } } } Text { text: bindingTest.size } Button { text: "toggle" onClicked: { animation.running = !animation.running } } } }
Using
property real size: 5
leads to
Warning: App.qml:17:4: Duplicate binding on property 'size' [duplicate-property-binding] SequentialAnimation on size { ^^^^^^^^^^^^^^^^^^^ Warning: App.qml:15:24: Note: previous binding on 'size' here [duplicate-property-binding] property real size: 5 ^ Warning: App.qml:17:4: Cannot combine value source and binding on property "size" [duplicate-property-binding] SequentialAnimation on size { ^^^^^^^^^^^^^^^^^^^
The workaround seems to be
property real size Component.onCompleted: { size = initialSize }
Our use case is to ensure the initial value even if the animation is not running.
Attachments
Issue Links
- relates to
-
QTBUG-118105 qmllint: "Cannot combine value source and binding"-warning not always triggered
-
- Reported
-
Gerrit Reviews
For Gerrit Dashboard: QTBUG-137946 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
658199,3 | Relax duplicate binding check | dev | qt/qtdeclarative | Status: NEW | +2 | 0 |