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. Simple io issue
Forum Updated to NodeBB v4.3 + New Features

Simple io issue

Scheduled Pinned Locked Moved General and Desktop
5 Posts 3 Posters 1.3k 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.
  • B Offline
    B Offline
    brainchild
    wrote on last edited by
    #1

    I am trying to do something very simple: to generate an XML document to be used as the body of an HTTP request. QXmlStreamWriter provides a set of methods to write desired XML nodes to any QIODevice. QNetworkAccessManager provides methods to send HTTP requests, reading request body data from a QIODevice. Using these tools, I would have a reader and writer. How can I get data from the writer to the reader, keeping in mind that the network transfer is likely to be much slower than the XML generation, causing the possiblity of buffer overflows?

    1 Reply Last reply
    0
    • C Offline
      C Offline
      ChrisW67
      wrote on last edited by
      #2

      How big is this XML payload?

      1 Reply Last reply
      0
      • JeroentjehomeJ Offline
        JeroentjehomeJ Offline
        Jeroentjehome
        wrote on last edited by
        #3

        Hi, Almost all QIOdevices have a "GetStatus" function. This returns the availability of data ready to read/write. Check it out ;-)

        Greetz, Jeroen

        1 Reply Last reply
        0
        • B Offline
          B Offline
          brainchild
          wrote on last edited by
          #4

          The payload is not enormous, but I want to avoid a DOM-based approach, if that's where you're going.

          How does the getStatus() help? I know the status of each instance, I just don't know the best way to move data FROM a WRITER, TO a READER. That's the issue.

          1 Reply Last reply
          0
          • C Offline
            C Offline
            ChrisW67
            wrote on last edited by
            #5

            Serialise your small-ish XML payload using QXmlStreamWriter into a QBuffer/QTemporaryFile and then feed that to QNetworkAccessManager::post().

            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