[Interest] [solved] Re: advice on debugging a qnetworkaccessmanager/qnetworkreply issue

André Somers andre at familiesomers.nl
Thu Aug 9 09:17:50 CEST 2012


Op 9-8-2012 1:02, Justin Ferguson schreef:
> Is there a clean manner for using the QNAMs finished(qnetworkreply*)
> signal and then determining whose reply it is and calling its handler?
> Everything I can think of seems sorta clunky and error prone; or is
> there a synchronous QNAM-like class? Having to reimplement the HTTP
> code in a qtcpsocket seems counter-productive and qhttp is apparently
> deprecated.
>
At the moment you do the request, you already get a pointer to the reply 
object. You can just keep that pointer around, or you can add some kind 
identifier to the reply object by using the fact that QNetworkReply is a 
QObject, and QObject has setProperty with dynamic properties. That makes 
it easy to set a marker on the reply object, that you can test for when 
you receive a pointer to the object again from the finished() signal.

André




More information about the Interest mailing list