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

qmlformat should group related properties

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Unresolved
    • P3: Somewhat important
    • Some future release
    • 6.5.1
    • QML: Tooling
    • None
    • All

    Description

       

      I want to reformat the following code:

      import QtQuick
      import QtQuick.WindowWindow {
          height: Screen.desktopAvailableHeight
          width: Screen.desktopAvailableWidth
          color: "white"
          visible: true
      } 

      but its output is:

       

      import QtQuick
      import QtQuick.WindowWindow {
          color: "white"
          height: Screen.desktopAvailableHeight
          visible: true
          width: Screen.desktopAvailableWidth
      } 

      As this link written (https://doc.qt.io/qt-6/qml-codingconventions.html) , it will "try to group related properties together", but the height and weight in the output didn't group together, I think maybe the "visible" property make something wrong.

      My Qt Creator settings is:

      Qt Quick->QML/JS Editing,

      "Use custom command instead of built-in formatter" √

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

      Arguments: -f -n

      I'm using Qt 6.5.1 MSVC 2019.

       

       

       

       

      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
            roachlin Lin Lin
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes