Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-114839

qmlformat: Cannot format object destructuring

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P1: Critical
    • 6.5, 6.6.0 Beta3, 6.7.0 FF
    • 6.5.1
    • QML: Tooling
    • None
    • PySide6-Essentials v6.5.1.1
    • 115916f21 (dev), aa603e154 (6.6)

    Description

      Given code like this:

      Component.onCompleted: ({x, y, width, height} = settings.coords)

       

      pyside6-qmlformat outputs:

      Error: qt.qmldom.writeOut: writeOut of MyFile.qml created invalid code:
      ...
      Component.onCompleted: ({}{ "x":

                                "y":

                                "width":

                                "height":

           }{}= settings.coords)
      ...
      [Dom][QmlFile][Parsing] Error: Expected token `,' for .currentItem
      qt.qmldom.writeOut: failure reformatting "MyFile.qml"
      "Error while writing"

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            semih.yavuz Semih Yavuz
            demberto Confidential This too
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes