Results 1 to 3 of 3

Thread: the pure virtual method "abort" in QNetworkReply

  1. #1
    Join Date
    Jul 2011
    Posts
    3
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default the pure virtual method "abort" in QNetworkReply

    Hi guys:

    I'm confused about the pure virtual function abort in the QNetworkReply.
    It is never implemented. what do you guys do if you want to abort a httpget?
    since according to the doc, using the close() function only closes the IODevice to prevent further reading, but the network resources are not discarded.
    And I'm wondering whether it is safe to delete the QnetworkReply instance when it is still receiving data from the network.

    Since it is natural to abort a network request in curl, I think there must be an equivalent method in Qt.

    If any of you have subclassed QNetworkReply and implemented the abort function, can you share the code to me? Any other solutions are welcomed.

    Thank you!

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: the pure virtual method "abort" in QNetworkReply

    There is an implementation of abort() in the QNetworkReply objects returned by QNetworkAccessManager. These objects are actually of type QNetworkReplyImpl: see src/network/access/qnetworkreplyimpl.cpp in the Qt sources.

  3. #3
    Join Date
    Jul 2011
    Posts
    3
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: the pure virtual method "abort" in QNetworkReply

    Nice! I see.
    Thank you!

Similar Threads

  1. protocol "" is unknown QNetworkReply
    By mahadevans87 in forum Qt Programming
    Replies: 1
    Last Post: 11th May 2011, 12:55
  2. Replies: 5
    Last Post: 9th May 2011, 13:40
  3. Replies: 3
    Last Post: 22nd February 2011, 08:53
  4. Store several "QNetworkReply" in a QMap !
    By fitzy in forum Qt Programming
    Replies: 3
    Last Post: 29th November 2009, 11:50
  5. Translation QFileDialog standart buttons ("Open"/"Save"/"Cancel")
    By victor.yacovlev in forum Qt Programming
    Replies: 4
    Last Post: 24th January 2008, 19:05

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.