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. Stop download with QNetworkReply
QtWS25 Last Chance

Stop download with QNetworkReply

Scheduled Pinned Locked Moved Solved General and Desktop
qnetworkreply
20 Posts 4 Posters 5.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.
  • M mrjj
    9 May 2016, 17:52

    @ARASHz4
    Thx. its cute :)
    I can use any file for test?

    A Offline
    A Offline
    ARASHz4
    wrote on 9 May 2016, 17:53 last edited by
    #11

    @mrjj yes I think

    ? M 2 Replies Last reply 9 May 2016, 18:12
    0
    • A ARASHz4
      9 May 2016, 17:53

      @mrjj yes I think

      ? Offline
      ? Offline
      A Former User
      wrote on 9 May 2016, 18:12 last edited by
      #12

      Hi! Does this also happen when you replace abort() with close()? Another thing: After calling abort(), is the finished() signal emitted?

      ? 1 Reply Last reply 9 May 2016, 18:13
      0
      • ? A Former User
        9 May 2016, 18:12

        Hi! Does this also happen when you replace abort() with close()? Another thing: After calling abort(), is the finished() signal emitted?

        ? Offline
        ? Offline
        A Former User
        wrote on 9 May 2016, 18:13 last edited by
        #13

        And: On what platform do you observe this behaviour? Windows? Linux?

        A 1 Reply Last reply 9 May 2016, 18:29
        0
        • ? Offline
          ? Offline
          A Former User
          wrote on 9 May 2016, 18:17 last edited by
          #14

          BTW: In your cancelDownload() function, it says:

          reply->abort();
          reply = 0;
          

          Looks like a memory leak to me.

          1 Reply Last reply
          0
          • ? A Former User
            9 May 2016, 18:13

            And: On what platform do you observe this behaviour? Windows? Linux?

            A Offline
            A Offline
            ARASHz4
            wrote on 9 May 2016, 18:29 last edited by
            #15

            @Wieland
            i test before close()
            i use Windows now

            1 Reply Last reply
            0
            • A ARASHz4
              9 May 2016, 17:53

              @mrjj yes I think

              M Offline
              M Offline
              mrjj
              Lifetime Qt Champion
              wrote on 9 May 2016, 18:30 last edited by
              #16

              @ARASHz4

              hi
              in

              Downloader::Downloader(QUrl Url, QObject *parent) :
                  QObject(parent)
              {
                  QNetworkRequest request(Url);
                  DownloadManager.get(request);<<<<< THIS ?
              
                  reply =  DownloadManager.get(request);
              

              you have extra DownloadManager.get(request);
              if I // it, it now drops to 0 when I abort.
              Before it did not.

              ? A 3 Replies Last reply 9 May 2016, 18:31
              1
              • M mrjj
                9 May 2016, 18:30

                @ARASHz4

                hi
                in

                Downloader::Downloader(QUrl Url, QObject *parent) :
                    QObject(parent)
                {
                    QNetworkRequest request(Url);
                    DownloadManager.get(request);<<<<< THIS ?
                
                    reply =  DownloadManager.get(request);
                

                you have extra DownloadManager.get(request);
                if I // it, it now drops to 0 when I abort.
                Before it did not.

                ? Offline
                ? Offline
                A Former User
                wrote on 9 May 2016, 18:31 last edited by
                #17

                @mrjj Guter Mann. ;-)

                1 Reply Last reply
                1
                • M mrjj
                  9 May 2016, 18:30

                  @ARASHz4

                  hi
                  in

                  Downloader::Downloader(QUrl Url, QObject *parent) :
                      QObject(parent)
                  {
                      QNetworkRequest request(Url);
                      DownloadManager.get(request);<<<<< THIS ?
                  
                      reply =  DownloadManager.get(request);
                  

                  you have extra DownloadManager.get(request);
                  if I // it, it now drops to 0 when I abort.
                  Before it did not.

                  A Offline
                  A Offline
                  ARASHz4
                  wrote on 9 May 2016, 18:42 last edited by ARASHz4 5 Sept 2016, 18:43
                  #18

                  @mrjj DownloadManager is a private member in downloader.h

                  1 Reply Last reply
                  0
                  • M mrjj
                    9 May 2016, 18:30

                    @ARASHz4

                    hi
                    in

                    Downloader::Downloader(QUrl Url, QObject *parent) :
                        QObject(parent)
                    {
                        QNetworkRequest request(Url);
                        DownloadManager.get(request);<<<<< THIS ?
                    
                        reply =  DownloadManager.get(request);
                    

                    you have extra DownloadManager.get(request);
                    if I // it, it now drops to 0 when I abort.
                    Before it did not.

                    A Offline
                    A Offline
                    ARASHz4
                    wrote on 9 May 2016, 18:47 last edited by
                    #19

                    @mrjj Yes thank you now I understand
                    i Fix it

                    1 Reply Last reply
                    0
                    • S Offline
                      S Offline
                      seyed
                      wrote on 8 Sept 2019, 08:42 last edited by
                      #20

                      In my case, disconnecting all signals relating to QNetworkReply from all slots causes to abort() not works.

                      disconnect(m_reply, nullptr, nullptr, nullptr);
                      

                      abort function works normal after commenting this line.

                      1 Reply Last reply
                      2

                      • Login

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