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. QStrings (and other text) lose (ignore) embedded quote chars
Forum Updated to NodeBB v4.3 + New Features

QStrings (and other text) lose (ignore) embedded quote chars

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 872 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.
  • C Offline
    C Offline
    cicsoft
    wrote on last edited by
    #1

    Using QT4 development with VisualGDB. The single quote char (') is stripped from the text strings. For example:
    QString str = "That's strange" appears as "Thats strange"

    Single quotes are needed as I am using sql queries with SQLITE3.
    Also tried using the escape char ('):
    The following construct also fails:
    const char str = "That's strange" with the same results.

    1 Reply Last reply
    0
    • dheerendraD Offline
      dheerendraD Offline
      dheerendra
      Qt Champions 2022
      wrote on last edited by
      #2

      welcome to the forum. This should not happen. I tried with Mac and gcc on linux. It was not filtered out. I agree with you that problem is happening. Is it happening with very simple sting you are trying ? I tried the following. It gave exact string. It worked as expected.

      @ QString str = "That's me";
      qDebug() << str;
      QLabel label(str);
      label.show();@

      Are you including this string some where else doing some manipulation ? Is it part of some bigger string ? May be in some specific case it is failing ?

      Dheerendra
      @Community Service
      Certified Qt Specialist
      http://www.pthinks.com

      1 Reply Last reply
      0
      • C Offline
        C Offline
        cicsoft
        wrote on last edited by
        #3

        No I am not, but I did find the problem. In VisualGDB when I do a quickwatch on the object (a string in this case), it does not show the single quotes, but if I check the length of the string, it does account for two single quotes. Rather strange...
        Thanks so much for the quick response.

        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