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

Moving dot-separated properties to a new line breaks auto-indentation

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • Qt Creator 4.3.0
    • Quick / QML Support
    • None
    • Qt: qt-opensource-linux-x64-5.9.0
      Build host: Ubuntu 64bit

    Description

      Moving dot-separated properties to a new line breaks auto-indentation (Ctrl-i) of the "}" braces that follow this line.

      1) Auto-indentation works fine without line breaks:

      Window {
          Text {
              text: qsTr("%1").arg("text")
          }
      }
      

      2) Auto-indentation is broken, when '.arg' is moved to the new line (for example, because

      the line will be too long otherwise):

      Window {
          Text {
              text: qsTr("%1: very long text here")
              .arg("very long text here too")
          }
          } // <-- after the auto-completion is applied, the last closing curly brace 
            // is indented and is aligned horizontally with the previous closing 
            // curly brace. Correct behavior should be: the last closing curly 
            // brace is not indented.
      

      3) Similarly, auto-indentation is also broken for other dot-separated properties:

       

      Window {
          Text {
              text: font
              .family
          }
          } // <-- same problem with the last closing curly brace.
      

      4) A workaround to fix auto-completion (but will not work with the 'font.family'-like example above, e.g. something long like "currentFontOfSomeSpecialItem.familyWhichBelongsToTheSansGroup"):

       

       

      Window {
          Text {
              text: qsTr("%1: very long text here").arg(
                    "very long text here too")
          }
      }

       

       

      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
            j0hnny j0hnny
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes