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

qmlformat removes single blank lines which were useful for grouping related properties

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • P3: Somewhat important
    • 6.1
    • 5.15.0
    • QML: Tooling
    • All

    Description

      Here is the QML code before qmlformat edited it:

      ```

      QtObject {
      property color primaryDark: '#802566'
      property color primaryMediumDark: '#a72a74'
      property color primaryMedium: '#d42e83'
      property color primaryMediumLight: '#e86cb0'
      property color primaryLight: '#f1bfdd'

      property color secondaryDark: '#511d6f'
      property color secondaryMediumDark: '#7b2a88'
      property color secondaryMedium: '#983597'
      property color secondaryMediumLight: '#cd95cb'
      property color secondaryLight: '#e0bfdf'

      property color neutralDark: '#262527'
      property color neutralMediumDark: '#5a575c'
      property color neutralMedium: '#827e85'
      property color neutralMediumLight: '#a6a3a8'
      property color neutralLight: '#f2f2f3'

      ```

      And here is how it looked afterward:

      ```
      QtObject {
      property color primaryDark: "#802566"
      property color primaryMediumDark: "#a72a74"
      property color primaryMedium: "#d42e83"
      property color primaryMediumLight: "#e86cb0"
      property color primaryLight: "#f1bfdd"
      property color secondaryDark: "#511d6f"
      property color secondaryMediumDark: "#7b2a88"
      property color secondaryMedium: "#983597"
      property color secondaryMediumLight: "#cd95cb"
      property color secondaryLight: "#e0bfdf"
      property color neutralDark: "#262527"
      property color neutralMediumDark: "#5a575c"
      property color neutralMedium: "#827e85"
      property color neutralMediumLight: "#a6a3a8"
      property color neutralLight: "#f2f2f3"
      ```

      I would prefer to keep the single blank lines that grouped those three groups of properties according to whether the property was prefixed by "primary", "secondary", or "neutral".

       

      Attachments

        1. Theme.after.qml
          3 kB
          Kelly Heller
        2. Theme.before.qml
          3 kB
          Kelly Heller
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            max.goldstein Maximilian Goldstein
            kh-219design Kelly Heller
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes