Details
-
Bug
-
Resolution: Done
-
P2: Important
-
4.7.2
-
None
-
Tested in Linux, latest 4.7 branch
COMMIT: 6af078b2a13f4855a35d48376e58154ee2d57ec1
-
f609c2f3b148f0d31167b9feeabe8f2c4bbd03b8
Description
I have a Slider in QML that uses two Binding objects inside it. These objects ensure that the Handle follows the "value" property and vice-versa.
In other words, I want my Slider to be usable both as an INPUT widget (user drags slider, value changes) and as an OUTPUT widget (application sets value, user sees the handle in a new position).
See attached example.
To reproduce:
1) Run example (qmlviewer main.qml)
2) Drag slider at the top
=== EXPECTED result ===
a. Bottom slider follows top slider
b. Values of both sliders change as stated by the debug text at the very bottom
=== ACTUAL result ===
(a) does not happen. Bottom slider does not follow the new value set to it.
I understand this is a loop situation, "s2.value" is being affected by two bindings:
1) Binding object internal to S2
2) binding expression written in main.qml (value: s1.value)
However since these bindings converge, I would expect that to work. If it doesn't, is the only solution to properly implement such widget to do that in C++ or use onChanged() imperative event handlers?
Attachments
Issue Links
- relates to
-
QTBUG-33444 Binding does not restore original property value if it was assigned as a constant
- Closed