Details
-
Bug
-
Resolution: Fixed
-
P2: Important
-
5.15.14, 6.5.1, 6.5.2
-
0fdf9042c (dev), 3ea55bf39 (dev), c07f63d06 (6.6), 7326d41be (6.6), dc4bd4fb3 (tqtc/lts-6.5), 11045230c (tqtc/lts-6.5), 6b43739ad (tqtc/lts-6.2), c850ac5cc (tqtc/lts-6.2)
Description
A sample is attached. Basically, a Rectangle defined in SubItem1.qml is instantiated in main.qml. There are 2 aliases 'fillColor' and 'borderColor' defined inside Rectangle, referring to color and border.color which are further bound to 'trueFillColor' and 'trueBorderColor' respectively. Both aliases are rebound in main.qml, but the behavior is not as expected.
5 observations:
1. Rebinding of alias 'fillColor' at the time of instantiation using colon ':' works. But rebinding of alias 'borderColor' in the same way fails. That is, 'myItem' is instantiated as a light grey Rectangle without visible border at the first place.
2. Rebinding of both aliases later using Qt.binding work, i.e. clicking 'Rebind' button makes Rectangle filled in red with blue border.
3. Reassigning of aliases later using equal sign '=' work too.
4. The output from onColorChanged and border.onColorChanged goes like following. So color looks OK, that it changes to grey once and emits signal. But border.color emits singal twice and neither is black. border.color is changed to transparent twice.
5. Modify SubItem1 a little. Let color and border.color be bound directly to value, e.g. "transparent", instead of to other properties, and then relaunch the application. This time, rectangle looks correct at the first place, i.e. a rectangle filled in grey with black border.
Attachments
Issue Links
- relates to
-
QTBUG-121501 Initializing property through alias to bound bindable property fails
- Closed