Details
-
Bug
-
Resolution: Fixed
-
P1: Critical
-
QDS 3.7, QDS 3.8, QDS 3.9, QDS 4.0, QDS 4.1, QDS 4.4, QDS 4.2, QDS 4.3.2
-
None
-
d72f55bbd (qds/dev)
-
QDS Berlin - 2024 Week 11/12
Description
When having a property like property vector2d test: Qt.vector2d(7 / Constants.width, 7 / Constants.height) and selecting a different item (e.g. dummy in the example below) then re-selecting the item with the test property the dynamic property logic will remove the expression and only leave the numbers in like property vector2d test: Qt.vector2d(7, 7).
This is due to updateProxyValues() in DynamicPropertiesSection.qml:321 doesn't care about expressions. The actual expression
Qt.vector2d(7 / Constants.width, 7 / Constants.height)
is reduced to
7 / Constants.width, 7 / Constants.height
and then split on ",". This will result in an array
[7 / Constants.width, 7 / Constants.height]
Each of the elements will be parsed with parseFloat() which removes all the unknown strings and results in [7, 7].
Rectangle { id: rectangle width: Constants.width height: Constants.height color: Constants.backgroundColor // Qt.vector2d(1 / Constants.width, 1 / Constants.height) // Qt.vector2d(7 / Constants.width, 7 / Constants.height) property vector2d test: Qt.vector2d(7, 7) property real textX: 1 / Constants.width Item { id: dummy } }