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

QML/JS formatting should not format string bloc

XMLWordPrintable

    • All

      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

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

            ulherman Ulf Hermann
            dalverny Sébastien Dalverny
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes