Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct


    Qt World Summit: Early-Bird Tickets

    QNetworkReply::isFinished()

    General and Desktop
    3
    10
    5325
    Loading More Posts
    • 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
      Felix last edited by

      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 Reply Quote 0
      • F
        Franzk last edited by

        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 Reply Quote 0
        • F
          Felix last edited by

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

          1 Reply Last reply Reply Quote 0
          • F
            Franzk last edited by

            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 Reply Quote 0
            • F
              Felix last edited by

              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 Reply Quote 0
              • G
                goetz last edited by

                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 Reply Quote 0
                • F
                  Felix last edited by

                  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 Reply Quote 0
                  • G
                    goetz last edited by

                    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 Reply Quote 0
                    • F
                      Felix last edited by

                      thank you volker for the link.

                      Anyone has a suggestion for a workaround for now?

                      1 Reply Last reply Reply Quote 0
                      • G
                        goetz last edited by

                        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 Reply Quote 0
                        • First post
                          Last post