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 } }
Attachments
For Gerrit Dashboard: QDS-12242 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
547977,5 | QmlDesigner: Fix issues with dynamic vectors | qds/dev | qt-creator/qt-creator | Status: MERGED | +2 | 0 |
548850,1 | QmlDesigner: Fix issues with dynamic vectors | master | qt-creator/qt-creator | Status: ABANDONED | 0 | 0 |