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. Using QNetworkReply multiple times
Qt 6.11 is out! See what's new in the release blog

Using QNetworkReply multiple times

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 2 Posters 303 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
    Creaperdown
    wrote on last edited by
    #1

    Hey, I need to send out many network requests throughout the lifetime of my application and I am running into difficulties with QNetworkReplys because I need to do some work once the http response arrives, so I need to connect a slot to the finished signal of QNetworkReply.
    I need to send the same http request multiple times, thus I can not use one QNetworkReply and simply connect a slot to its finished signal, since the second, third, ... http request would mess this up when trying to connect them to the finished signals of the same QNetworkReply.

    I think that it should be doable to write a container which dynamically creates QNetworkReplys for you and deletes the existing ones, which are no longer used.

    Does something like this already exist by any chance, or would I need to implement it myself?
    Thanks in advance.

    Christian EhrlicherC 1 Reply Last reply
    0
    • Christian EhrlicherC Christian Ehrlicher

      @Creaperdown said in Using QNetworkReply multiple times:

      I think that it should be doable to write a container which dynamically creates QNetworkReplys for you and deletes the existing ones, which are no longer used.

      I don't understand this - a QNetworkReply returns some data for a request. You can do with this data whatever you want so why do you need to duplicate the reply then?

      C Offline
      C Offline
      Creaperdown
      wrote on last edited by
      #3

      @Christian-Ehrlicher I am sorry, I have realized that I have used QNetworkReplys wrongly. Someone has mentioned the correct way to connect signals and slots on it and now my problem does not persist anymore

      1 Reply Last reply
      0
      • C Creaperdown

        Hey, I need to send out many network requests throughout the lifetime of my application and I am running into difficulties with QNetworkReplys because I need to do some work once the http response arrives, so I need to connect a slot to the finished signal of QNetworkReply.
        I need to send the same http request multiple times, thus I can not use one QNetworkReply and simply connect a slot to its finished signal, since the second, third, ... http request would mess this up when trying to connect them to the finished signals of the same QNetworkReply.

        I think that it should be doable to write a container which dynamically creates QNetworkReplys for you and deletes the existing ones, which are no longer used.

        Does something like this already exist by any chance, or would I need to implement it myself?
        Thanks in advance.

        Christian EhrlicherC Offline
        Christian EhrlicherC Offline
        Christian Ehrlicher
        Lifetime Qt Champion
        wrote on last edited by
        #2

        @Creaperdown said in Using QNetworkReply multiple times:

        I think that it should be doable to write a container which dynamically creates QNetworkReplys for you and deletes the existing ones, which are no longer used.

        I don't understand this - a QNetworkReply returns some data for a request. You can do with this data whatever you want so why do you need to duplicate the reply then?

        Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
        Visit the Qt Academy at https://academy.qt.io/catalog

        C 1 Reply Last reply
        0
        • Christian EhrlicherC Christian Ehrlicher

          @Creaperdown said in Using QNetworkReply multiple times:

          I think that it should be doable to write a container which dynamically creates QNetworkReplys for you and deletes the existing ones, which are no longer used.

          I don't understand this - a QNetworkReply returns some data for a request. You can do with this data whatever you want so why do you need to duplicate the reply then?

          C Offline
          C Offline
          Creaperdown
          wrote on last edited by
          #3

          @Christian-Ehrlicher I am sorry, I have realized that I have used QNetworkReplys wrongly. Someone has mentioned the correct way to connect signals and slots on it and now my problem does not persist anymore

          1 Reply Last reply
          0
          • C Creaperdown has marked this topic as solved on

          • Login

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