Details
-
Suggestion
-
Resolution: Duplicate
-
P3: Somewhat important
-
None
-
4.7.1
-
None
-
PC Ubuntu
Description
After a component's width attribute has been overwritten with an anchors definition, the width still continues to be bind and causes useless bindings.
After starting the test.qml file in attachment, click on the text field, the following text outputs in the console:
text clicked black width res=30 purple width res=20 purple width res=20
We can see that the width is still bound to the "testVal" property but the value returned for the width property is not saved because of the anchors definition.
The width property of the purple rectangle is then called twice, which is useless because the width value of the parent has not been updated.
I suggest to remove the binding to other properties when overwritten with anchors.
This behavior may be wanted if the user wish to restore the property binding later, like this:
testCompo.anchors.right = undefined; testCompo.testVal++; testCompo.testVal--;
The aim of the ugly increment/decrement of the "testCompo.testVal" is to force the update of the width of the black and purple rectangles.
Attachments
Issue Links
- is replaced by
-
QTBUG-19606 Create a system for geometry ownership in QML
-
- Closed
-