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

Mandeep Sandhu mandeepsandhu.chd at gmail.com
Thu Aug 9 07:31:36 CEST 2012

> I'd like to have an event manager where I can just post a custom event
> with a qnetworkrequest parameter, but the only way that seems feasible
> really is to have all potential objects receive a
> finished(qnetworkreply*) signal from the manager and check the
> pointer, which seems really inefficient if you have a lot of network
> traffic.

I'm not sure what your requirements are, but we do something similar
in our project. We have an application that displays images in a grid
with some meta-data per image. So we first fetch the meta-data (as a
JSON) from the webserver, parsing which we get to the image url. We
then dispatch the requests for fetching the images.

The image grid is also split into 'pages', so when an image reply
comes, one of the issues we faced was how to identify for which page
the image was for. I did not want to have to keep a list of mappings
for img url to page number. So instead, I added a custom attribute
(i.e the page number to which the img url belongs) to my
QNetworkRequest which was then available to me during the image reply
processing (QNReply holds the original QNReq). So this helped the code
in being as state-less as possible.


> Oh well, if that's my biggest complaint about the code base given the
> feature set it provides, then I can't really complain.
> Thanks for the input!
> Justin

More information about the Interest mailing list