Details
-
Type:
Bug
-
Status: Closed
-
Priority:
P1: Critical
-
Resolution: Done
-
Affects Version/s: Qt Creator 4.9.0-beta1
-
Fix Version/s: Qt Creator 4.9.0
-
Component/s: Quick / QML Support
-
Labels:None
Description
// Imagine we have next var: readonly property var model: [{ "delegate": headerLabelComponent, "text": qsTr("Display") }, { "delegate": scaleSliderDelegate }, { "delegate": switchDelegateComponent, "text": qsTr("Dark theme"), "value": theme.style === Theme.Dark, "checkedCb": function (checked) { if (checked) { theme.style = Theme.Dark return } theme.style = Theme.Light } }, { "delegate": headerLabelComponent, "text": qsTr("Additional") }, { "delegate": itemDelegateComponent, "text": qsTr("emergency call"), "onClicked": function () { Qt.openUrlExternally('tel:112') } }]
After saving file with such variable formatter deletes all array items and left me with:
readonly property var model: [, , , , ]
Seems like critical bug to me
Attachments
Issue Links
- is duplicated by
-
QTCREATORBUG-22258 Array elements removed when using Reformat File
-
- Closed
-
-
QTCREATORBUG-22241 Re-formater deletes code
-
- Closed
-
- relates to
-
QTCREATORBUG-22259 Qml formatter breaks function arguments
-
- Closed
-