Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. qmlformat 6.3.0 let to var "Error while writing"
Qt 6.11 is out! See what's new in the release blog

qmlformat 6.3.0 let to var "Error while writing"

Scheduled Pinned Locked Moved Solved Qt Creator and other tools
4 Posts 2 Posters 700 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • qmluserQ Offline
    qmluserQ Offline
    qmluser
    wrote on last edited by qmluser
    #1

    Running the qmlformat binary from Qt 6.3.0 on a Mac or (Ubuntu 20) there is a consistent "Error while writing" when attempting to reformat inplace. It occurs when there is a for loop where the index is declared with let and it should be reformatted to var.
    Command: qmlformat MyFile.qml -i
    Original:

    for (let i = 0; i < model.count; i++) {
        // do something
    }
    

    Reformatted:

    for (var i = 0; i < model.count; i++) {
        // do something
    }
    

    Error message: "Error while writing"

    Is this known? Will it be fixed?

    Edit: Reproduced under linux

    qmluserQ 1 Reply Last reply
    0
    • qmluserQ Offline
      qmluserQ Offline
      qmluser
      wrote on last edited by
      #3

      Looks like a fix will be in an upcoming release of 6.x.x
      https://codereview.qt-project.org/c/qt/qtdeclarative/+/425203

      @moderator Please mark as resolved.

      SGaistS 1 Reply Last reply
      0
      • qmluserQ qmluser

        Running the qmlformat binary from Qt 6.3.0 on a Mac or (Ubuntu 20) there is a consistent "Error while writing" when attempting to reformat inplace. It occurs when there is a for loop where the index is declared with let and it should be reformatted to var.
        Command: qmlformat MyFile.qml -i
        Original:

        for (let i = 0; i < model.count; i++) {
            // do something
        }
        

        Reformatted:

        for (var i = 0; i < model.count; i++) {
            // do something
        }
        

        Error message: "Error while writing"

        Is this known? Will it be fixed?

        Edit: Reproduced under linux

        qmluserQ Offline
        qmluserQ Offline
        qmluser
        wrote on last edited by
        #2

        Now an official bug:
        https://bugreports.qt.io/browse/QTBUG-105361

        1 Reply Last reply
        0
        • qmluserQ Offline
          qmluserQ Offline
          qmluser
          wrote on last edited by
          #3

          Looks like a fix will be in an upcoming release of 6.x.x
          https://codereview.qt-project.org/c/qt/qtdeclarative/+/425203

          @moderator Please mark as resolved.

          SGaistS 1 Reply Last reply
          0
          • qmluserQ qmluser

            Looks like a fix will be in an upcoming release of 6.x.x
            https://codereview.qt-project.org/c/qt/qtdeclarative/+/425203

            @moderator Please mark as resolved.

            SGaistS Offline
            SGaistS Offline
            SGaist
            Lifetime Qt Champion
            wrote on last edited by
            #4

            @qmluser Hi, you can mark it solved yourself using the "Topic Tools" button or the three dotted menu beside the answer you deem correct :-)

            Interested in AI ? www.idiap.ch
            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 Reply Last reply
            0

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved