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

Default command for running qmlformat is invalid on Windows

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Not Evaluated
    • Qt Creator 14.0.0
    • Qt Creator 13.0.2, Qt Creator 14.0.0-rc1
    • Quick / QML Support
    • None
    • Windows 10 22H2
    • Windows
    • e6dc3fb00 (14.0)

    Description

      If I enable "Edit" > "Preferences..." > "Qt Quick" > "QML/JS Editing" > "Use custom command instead of built-in formatter", then Qt Creator applies a default command to launch qmlformat:

      %{CurrentDocument:Project:QT_HOST_BINS}/qmlformat
      

       

      However, on Windows, this produces errors like:

      Error in text formatting: Failed to format: The command "C:\Qt\6.7.2\msvc2019_64\bin\qmlformat --inplace C:/Users/USER/AppData/Local/Temp/QtCreator-vHlKuA/qtc_beautifier_cRuGtNut.qml" could not be started..
      

       

      Fix

      We must add the ".exe" suffix to the command:

      %{CurrentDocument:Project:QT_HOST_BINS}/qmlformat.exe
      

      Attachments

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

        Activity

          People

            qtqmlteam Qt Qml Team User
            skoh-qt Sze Howe Koh
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes