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

qmlformat: creates lines over 100 characters long

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P2: Important P2: Important
    • 6.9
    • 6.5.2
    • QML: Tooling
    • None
    • All

      https://wiki.qt.io/Qt_Coding_Style says:

      "Keep lines shorter than 100 characters"

      Problem: qmlformat creates lines over 100 characters long. 

      E.g. when you qmlformat the attached file, these two lines

              readonly property string minutes:
                  "%1".arg(parseInt(progressSlider.value / 60)).padStart(2, '0')

      are concatenated into a single line 105 characters long. 

      Note: https://doc.qt.io/qt-6/qml-codingconventions.html does not mention line length limit at all, but my understanding is that generic Qt coding style rules would apply in that case. It wouldn't hurt to clarify this in the QML Coding Conventions. 

        1. Main.qml
          0.6 kB
          Janne Juntunen
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            semih.yavuz Semih Yavuz
            jannej Janne Juntunen
            Votes:
            3 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes