'Get the QNetworkProxies for a query.
Args:
query: The QNetworkProxyQuery to get a proxy for.
Return:
A list of QNetworkProxy objects in order of preference.'

def queryProxy(self, query):

    proxy = config.get('network', 'proxy')
    if (proxy is configtypes.SYSTEM_PROXY):
        proxies = QNetworkProxyFactory.systemProxyForQuery(query)
    elif isinstance(proxy, pac.PACFetcher):
        proxies = proxy.resolve(query)
    else:
        proxies = [proxy]
    for p in proxies:
        if (p.type() != QNetworkProxy.NoProxy):
            capabilities = p.capabilities()
            if config.get('network', 'proxy-dns-requests'):
                capabilities |= QNetworkProxy.HostNameLookupCapability
            else:
                capabilities &= (~ QNetworkProxy.HostNameLookupCapability)
            p.setCapabilities(capabilities)
    return proxies
