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

[Reg 5.15 -> 6.x] qmlformat: Blank line between sections no longer enforced

    XMLWordPrintable

    Details

    • Commits:
      d01880e8f6 (qt/qtdeclarative/dev) d01880e8f6 (qt/tqtc-qtdeclarative/dev)

      Description

      https://doc.qt.io/qt-6/qml-codingconventions.html says, "For better readability, we separate these different parts with an empty line."

      However, this is no longer properly enforced in Qt 6.x.

      In the example below, both Qt 5.15 and 6.x correctly insert a line between import and Rectangle. However, on Qt 5.15 inserts a line between id and property – Qt 6.x does not.

       

      Input file

      import QtQuick 2.15
      Rectangle {
          id: photo
          property bool thumbnail: false
      }
      

       

      Outcome for Qt 5.15.10 (correct)

      import QtQuick 2.15
      
      Rectangle {
          id: photo
      
          property bool thumbnail: false
      }
      

       

      Outcome for Qt 6.x (wrong)

      import QtQuick 2.15
      
      Rectangle {
          id: photo
          property bool thumbnail: false
      }
      

        Attachments

        For Gerrit Dashboard: QTBUG-105479
        # Subject Branch Project Status CR V

          Activity

            People

            Assignee:
            sami.shalayel Sami Shalayel
            Reporter:
            skoh-qt Sze Howe Koh
            Votes:
            3 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes