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. Quotation mark prints at the end of string

Quotation mark prints at the end of string

Scheduled Pinned Locked Moved Solved General and Desktop
4 Posts 2 Posters 927 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.
  • a8wzA Offline
    a8wzA Offline
    a8wz
    wrote on last edited by a8wz
    #1

    I am porting my application to Qt 5.5.1 from 5.2.1 and with the switch to the newer version, all the log entries printed by my application started to print with a quotation mark at the end of each line. This never happened with Qt 5.2.1. I noticed that the function tr() is causing it because if I remove tr and use the string without translation the text prints correctly.

    Here's an example:

    qWarning() << "!i" << tr("Emulation stopped.");

    This produces: Emulation stopped" in my log (notice the quotation mark at the end). If i don't wrap the string with tr() no quotation mark is printed.

    Does anyone know if this is a bug with Qt or am I doing something wrong?

    D 1 Reply Last reply
    0
    • a8wzA a8wz

      I am porting my application to Qt 5.5.1 from 5.2.1 and with the switch to the newer version, all the log entries printed by my application started to print with a quotation mark at the end of each line. This never happened with Qt 5.2.1. I noticed that the function tr() is causing it because if I remove tr and use the string without translation the text prints correctly.

      Here's an example:

      qWarning() << "!i" << tr("Emulation stopped.");

      This produces: Emulation stopped" in my log (notice the quotation mark at the end). If i don't wrap the string with tr() no quotation mark is printed.

      Does anyone know if this is a bug with Qt or am I doing something wrong?

      D Offline
      D Offline
      Devopia53
      wrote on last edited by
      #2

      @a8wz

      Hi,

      You can enable the noquote() functionality. This function was introduced in Qt 5.4.

      eg. qWarning().noquote() << "!i" << tr("Emulation stopped.");

      a8wzA 1 Reply Last reply
      1
      • a8wzA Offline
        a8wzA Offline
        a8wz
        wrote on last edited by
        #3

        Thank you, I will try that.

        1 Reply Last reply
        0
        • D Devopia53

          @a8wz

          Hi,

          You can enable the noquote() functionality. This function was introduced in Qt 5.4.

          eg. qWarning().noquote() << "!i" << tr("Emulation stopped.");

          a8wzA Offline
          a8wzA Offline
          a8wz
          wrote on last edited by
          #4

          @Devopia53 Thank you this solution worked beautifully, no more quotes at the end of strings.

          1 Reply Last reply
          0

          • Login

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