Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-22026

[Reg 4.8->4.9] QML auto format breaks valid structures

    XMLWordPrintable

    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

          For Gerrit Dashboard: QTCREATORBUG-22026
          # Subject Branch Project Status CR V

            Activity

              People

              Assignee:
              thohartm Thomas Hartmann
              Reporter:
              alexeym A M
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Gerrit Reviews

                  There are no open Gerrit changes