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. How to send and receive QVariantMap with pyqt5 QDatastream ?

How to send and receive QVariantMap with pyqt5 QDatastream ?

Scheduled Pinned Locked Moved Unsolved General and Desktop
6 Posts 2 Posters 424 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.
  • R Offline
    R Offline
    RahibeMeryem
    wrote on 28 Jan 2020, 13:58 last edited by
    #1

    Hi,

    I can send QVariantMap from C++ to the python client and can receive with:

               VariantMap  = out.readQVariantMap()  ##map["dbname"]
                png         = VariantMap["PNG-image"]
                UserName    = VariantMap["mq_username"]
                np_database = VariantMap["np_database"]
                category    = VariantMap["category"]
    

    How can I send the same QVariantMap from python ? I am using mtqq for messaging and utilizing the QDataStream.

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 29 Jan 2020, 05:32 last edited by
      #2

      Hi,

      What are you using on the Python side for MQTT communication ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • R Offline
        R Offline
        RahibeMeryem
        wrote on 30 Jan 2020, 16:10 last edited by
        #3

        @SGaist

        i m using paho

        1 Reply Last reply
        0
        • S Offline
          S Offline
          SGaist
          Lifetime Qt Champion
          wrote on 30 Jan 2020, 19:31 last edited by
          #4

          Just send your data using the client. You'll get the message on the other side.

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • R Offline
            R Offline
            RahibeMeryem
            wrote on 1 Feb 2020, 12:52 last edited by
            #5

            @SGaist

            I coulnt find the QVariantMap in the PyQt5 to receive in c++ side

            1 Reply Last reply
            0
            • S Offline
              S Offline
              SGaist
              Lifetime Qt Champion
              wrote on 1 Feb 2020, 16:13 last edited by
              #6

              Likely because it's a dict.

              In any case, why are you trying to send a QVariantMap since you are using a different library to communicate with your mqtt server ?

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              0

              4/6

              30 Jan 2020, 19:31

              • Login

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