Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Unsolved QMap key (QString) with Space

    General and Desktop
    3
    5
    826
    Loading More Posts
    • 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
      inforathinam last edited by inforathinam

      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?

      raven-worx 1 Reply Last reply Reply Quote 0
      • raven-worx
        raven-worx Moderators @inforathinam last edited by

        @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 Reply Quote 0
        • I
          inforathinam @raven-worx last edited by

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

          raven-worx jsulm 2 Replies Last reply Reply Quote 0
          • raven-worx
            raven-worx Moderators @inforathinam last edited by

            @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 Reply Quote 1
            • jsulm
              jsulm Lifetime Qt Champion @inforathinam last edited by

              @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 Reply Quote 0
              • First post
                Last post