[QGIS-Developer] connecting to QgsNetworkAccessManagers signals

Richard Duivenvoorde rdmailings at duif.net
Sat Jan 19 06:51:35 PST 2019

On 1/18/19 10:56 PM, Nyall Dawson wrote:
> On Fri, 18 Jan 2019 at 21:19, Richard Duivenvoorde <rdmailings at duif.net> wrote:
>> On 1/18/19 12:13 PM, Alessandro Pasotti wrote:
>>> I didn't look at the code but maybe it's because the NAM instance is
>>> per-thread and WMS/WFS downloaders run within threads.
>> Yeah, that is what I'm afraid of...
>> I just do QgsNetworkAccessManager.instance() which get's it from current
>> thread.
>> And (from what I understand) most providers do not keep an handle to
>> some NAM :-(
>> There is no way to QgsNetworkAccessManager what instances are running in
>> different threads?
> It'd need to be a change made in the core code -- the signals from the
> background threads would need to be "bubbled up" to the main thread
> instance of the manager.

Meaning (?), that wherever now a signal of the nam
(NetworkAccessManager) is connected to some local method, it is also to
be connected to the nam of the parent/application thread?

I had a look into some providers, but do not understand where this
connection between signals is to be made?

Is it in the application main thread when you create some
downloader-class that you add some extra 'connect'-calls?

Or is it in the downloader-class that you can fetch the
parent/application thread and then get the nam-instance from there and
do the connection?

Or should I not even try :-)


Richard Duivenvoorde

More information about the QGIS-Developer mailing list