Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QString \n \t not being translated
Forum Updated to NodeBB v4.3 + New Features

QString \n \t not being translated

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 3 Posters 868 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • SPlattenS Offline
    SPlattenS Offline
    SPlatten
    wrote on last edited by
    #1

    I'm not sure how I've managed to do this I'm building up a string that contains tabs (\t) and carriage returns (\n), however instead of tabs and carriage returns Im seeing the literal strings \t and \n in the Application Output. Is there any reason why this could be happening?

    Also, formatting this string:

    QString strMsg;
    strMsg = QString("S%1 ").arg(++msint64DbgSeqNo, 20, 10, QChar('0')) + strMsg;
    

    Gives an output something like:

    S00000000000000000016 "xmleng.setAttribute(strSID, \"title\", objJSON[\"text\"]); } } }*/"
    

    Where do the quotes come from after the 16 and at the end of the string?

    Kind Regards,
    Sy

    1 Reply Last reply
    0
    • B Offline
      B Offline
      Bonnie
      wrote on last edited by Bonnie
      #2

      That's how qDebug() normally prints QString.
      If you don't want it adding quotes and escaping non-printable characters, you should use qDebug().noquote()

      SPlattenS 1 Reply Last reply
      8
      • B Bonnie

        That's how qDebug() normally prints QString.
        If you don't want it adding quotes and escaping non-printable characters, you should use qDebug().noquote()

        SPlattenS Offline
        SPlattenS Offline
        SPlatten
        wrote on last edited by
        #3

        @Bonnie Thank you, is there any way to change the default behaviour of qDebug to do this by default without having to edit every instance?

        Kind Regards,
        Sy

        B 1 Reply Last reply
        0
        • SPlattenS SPlatten

          @Bonnie Thank you, is there any way to change the default behaviour of qDebug to do this by default without having to edit every instance?

          B Offline
          B Offline
          Bonnie
          wrote on last edited by
          #4

          @SPlatten
          As far as I know, there's not.

          1 Reply Last reply
          0
          • Christian EhrlicherC Offline
            Christian EhrlicherC Offline
            Christian Ehrlicher
            Lifetime Qt Champion
            wrote on last edited by
            #5

            And there is no reason for it - it's debug output...

            Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
            Visit the Qt Academy at https://academy.qt.io/catalog

            1 Reply Last reply
            1

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved