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. QMap key (QString) with Space
Forum Updated to NodeBB v4.3 + New Features

QMap key (QString) with Space

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 3 Posters 1.1k Views
  • 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.
  • I Offline
    I Offline
    inforathinam
    wrote on 21 Jun 2016, 07:17 last edited by inforathinam
    #1

    I have created a QMap as follows:
    QMap<QString,QString> mymap;

    When i insert "[TP_1::a_33 aa ff]" as key, it is taking only "TP_1::a_33" as key.
    Can someone tell me space is not allowed in the key?

    R 1 Reply Last reply 21 Jun 2016, 07:19
    0
    • I inforathinam
      21 Jun 2016, 07:17

      I have created a QMap as follows:
      QMap<QString,QString> mymap;

      When i insert "[TP_1::a_33 aa ff]" as key, it is taking only "TP_1::a_33" as key.
      Can someone tell me space is not allowed in the key?

      R Offline
      R Offline
      raven-worx
      Moderators
      wrote on 21 Jun 2016, 07:19 last edited by
      #2

      @inforathinam
      Please show some code, especially how you create and insert the key.

      --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
      If you have a question please use the forum so others can benefit from the solution in the future

      I 1 Reply Last reply 21 Jun 2016, 07:56
      0
      • R raven-worx
        21 Jun 2016, 07:19

        @inforathinam
        Please show some code, especially how you create and insert the key.

        I Offline
        I Offline
        inforathinam
        wrote on 21 Jun 2016, 07:56 last edited by
        #3

        @raven-worx
        QString testname = "[TP_1::a_33 aa ff]";
        mymap.insert(testname,"E2_0600_X.sum");

        R J 2 Replies Last reply 21 Jun 2016, 08:04
        0
        • I inforathinam
          21 Jun 2016, 07:56

          @raven-worx
          QString testname = "[TP_1::a_33 aa ff]";
          mymap.insert(testname,"E2_0600_X.sum");

          R Offline
          R Offline
          raven-worx
          Moderators
          wrote on 21 Jun 2016, 08:04 last edited by
          #4

          @inforathinam
          this code works, at least in Qt 5.6.

          Maybe your source file itself has some strange encoding?
          Did you compile Qt yourself?
          How does the string look like before inserting it into the hash?

          --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
          If you have a question please use the forum so others can benefit from the solution in the future

          1 Reply Last reply
          1
          • I inforathinam
            21 Jun 2016, 07:56

            @raven-worx
            QString testname = "[TP_1::a_33 aa ff]";
            mymap.insert(testname,"E2_0600_X.sum");

            J Offline
            J Offline
            jsulm
            Lifetime Qt Champion
            wrote on 21 Jun 2016, 08:48 last edited by
            #5

            @inforathinam How do you know that only the part before blank is inserted?

            https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 Reply Last reply
            0

            1/5

            21 Jun 2016, 07:17

            • Login

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