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

qDebug command on QStrings now print out \n characters

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • Not Evaluated
    • None
    • 5.5.1
    • None

    Description

      const QString test = "some string\nfor testing new\nlines";
      qDebug() << test;
      

      In Qt 5.4.2, the output would format the new lines properly. In 5.5.1, the string output now keeps the \n characters instead of separating the statement into new lines. The workaround is to turn the string into a char * (test.toUtf8().constData()).

      output in 5.4.2

      some string
      for testing new
      lines
      

      output in 5.5.1

      some string\nfor testing new\nlines
      

      I'm reporting this because I'm not sure if this change in behavior with qDebug (or QString?) is intended between 5.4.2 and 5.5.1.

      Attachments

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

        Activity

          People

            thiago Thiago Macieira
            atemple03 Adam Temple
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes