Details
-
Bug
-
Resolution: Done
-
P1: Critical
-
Qt Creator 4.9.0-beta1
-
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