View Full Version : QNetworkAccessManager doesn't obey QNetworkProxyFactory::setUseSystemConfiguration()

5th November 2014, 19:31
Consider the following code fragment:

QNetworkProxyFactory::setUseSystemConfiguration(tr ue);

QNetworkAccessManager manager;
QNetworkProxy::ProxyType type = manager.proxy().type(); //DefaultProxy
QNetworkProxyFactory *factory = manager.proxyFactory(); //0x0

I'd expect QNetworkAccessManager to obey the internal global QNetworkProxyFactory created by QNetworkProxyFactory::setUseSystemConfiguration(tr ue), but it doesn't.
(Observed on Windows - don't know if that matters.)

Is this a bug or a feature? If a feature, what might be the reasoning?

6th November 2014, 20:56
How have you verified that it does not use the global default proxy provided by QNetworkProxyFactory? All you have verified there is that there has been no specific proxy set on the QNetworkAccessManager, and it even tells you that it is using the default proxy.

6th November 2014, 21:17
I thought I have, first by assessing the application's reaction to various proxy settings, then by peeking QtNetwork sources and debugging into. I probably wasn't sufficiently thorough, though. I'll make up leeway, then return here.

10th November 2014, 00:55
Hmm, looks like I was rash.

QNetworkProxyFactory::setUseSystemConfiguration(tr ue);
indeed seems to work as expected.

Thx for making me backpedal and reassess.

(I'll content myself with empiricism for now...)