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. QNetworkReply::isFinished()
QtWS25 Last Chance

QNetworkReply::isFinished()

Scheduled Pinned Locked Moved General and Desktop
10 Posts 3 Posters 5.8k 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.
  • F Offline
    F Offline
    Felix
    wrote on last edited by
    #1

    Hi

    I have a problem with subclassing QNetworkReply.

    When I make a Subclass and call isFinished i get always false as result, and have no way to change it manually since this method is only virtual in QNetworkReplyPrivate. But as the name says, this class doesnt belong to the public API so i can't change it at that location.
    So what can I do to get this method working correctly?

    Felix

    1 Reply Last reply
    0
    • F Offline
      F Offline
      Franzk
      wrote on last edited by
      #2

      Just to get a clear view of what you want to achieve: Why do you want to subclass the QNetworkReply?

      "Horse sense is the thing a horse has which keeps it from betting on people." -- W.C. Fields

      http://www.catb.org/~esr/faqs/smart-questions.html

      1 Reply Last reply
      0
      • F Offline
        F Offline
        Felix
        wrote on last edited by
        #3

        yes, and in that subclass there is the problem with isFinished and isRunning

        1 Reply Last reply
        0
        • F Offline
          F Offline
          Franzk
          wrote on last edited by
          #4

          That was not an answer to my question :). After a quick review the whole implementation leads me to believe the QNetworkReply isn't there to be subclassed (by non-qnetwork code that is). If you really need to subclass this thing, you should have it depend on on the non-public API, I'm afraid.

          That is why I wanted to know why you are trying to subclass it -- what are you trying to achieve that you need this subclass for?

          "Horse sense is the thing a horse has which keeps it from betting on people." -- W.C. Fields

          http://www.catb.org/~esr/faqs/smart-questions.html

          1 Reply Last reply
          0
          • F Offline
            F Offline
            Felix
            wrote on last edited by
            #5

            ah sorry i didnt get the why in your question :)
            several reasons: the first is to provide my own network protocol (QNetworkAccessManager provides a virtual createRequest method)
            the second is to rewrite the Ftp part to enable resumePut and resumeGet which isnt provided by the default implementation

            1 Reply Last reply
            0
            • G Offline
              G Offline
              goetz
              wrote on last edited by
              #6

              When you're done with your work, you must emit signal finished().

              You cannot do that in the constructor of your QNetworkReply subclass, because at that time the signal/slot connections in your client code were not setup!

              Some more info on this in the "Qt mailing list":http://lists.trolltech.com/qt-interest/2008-11/thread00002-0.html

              http://www.catb.org/~esr/faqs/smart-questions.html

              1 Reply Last reply
              0
              • F Offline
                F Offline
                Felix
                wrote on last edited by
                #7

                i am emitting finished. That is noth the problem. I am talking about QNetworkReply::isFinished() not about the SIGNAL QNetworkReply::finished() .

                I found no line in the Qt source where this Signal is connected internally. Also connecting it internally wouldnt solve my problem, since in QNetworkReplyPrivate the method isFinished always returns false. I cant change that private class to have a late binding on that function.

                1 Reply Last reply
                0
                • G Offline
                  G Offline
                  goetz
                  wrote on last edited by
                  #8

                  I overlooked that. That's a bug, indeed. It's already addressed and fixed by Nokia, see "QTBUG-11737":http://bugreports.qt.nokia.com/browse/QTBUG-11737, although it will be public not until Qt 4.8.0.

                  http://www.catb.org/~esr/faqs/smart-questions.html

                  1 Reply Last reply
                  0
                  • F Offline
                    F Offline
                    Felix
                    wrote on last edited by
                    #9

                    thank you volker for the link.

                    Anyone has a suggestion for a workaround for now?

                    1 Reply Last reply
                    0
                    • G Offline
                      G Offline
                      goetz
                      wrote on last edited by
                      #10

                      If you do not rely on a prebuilt Qt you can get the patch (there's a link to the git commit on the bugtracker) and apply it to your sources.

                      http://www.catb.org/~esr/faqs/smart-questions.html

                      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