When the QNetworkSocketEngine (e.g. for QTCPSocket) checks if a proxy is used (QNativeSocketEnginePrivate::checkProxy) it passes an incomplete QNetworkProxyQuery to the QNetworkProxyFactory.
This prevents the factory from using different proxy configurations depending on e.g. the peer hostname. For the system proxy on windows it leads to the proxy bypass being ignored, because the peer hostname is required to evaluate the bypass list.
The following code shows the bug.
The output is:
Query: "192.0.2.1" : 12345
Query: "" : -1
The first line is originated in QAbstractSocketPrivate::resolveProxy.
The second line in QNativeSocketEngine::connectToHost.
For the second invocation of queryProxy the Query is only initialized with a type, but no hostname or port.