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

QML/JS formatting should not format string bloc

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • Qt Creator 11.0.1
    • Quick / QML Support
    • None
    • All

    Description

      It is possible to define a sting variable with single/double quot (") (') but also with Grave Accent (`).

      single/double quot are single line while Grave Accent allow multiple lines like this

       

      Text {
              text: ' ABC ' + " DEF " + texte
              property string texte: `
      Lorem ipsum dolor sit amet, consectetur adipiscing elit.
      Nam sed molestie purus, ut mattis magna.
      Lorem ipsum dolor sit amet, consectetur adipiscing elit.
      Integer eros massa, lobortis a malesuada ac, faucibus auctor eros.
      Nullam placerat placerat nisl sit amet elementum.`
      } 

      One of the good point about Grave Accent is that you dont need to add \n at the end of each lines. The text will look like the same as defined

       

      But QML formatting will add space for each line to align the text which it should not do as it also add space in the string

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              qtqmlteam Qt Qml Team User
              dalverny Sébastien Dalverny
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes