Reputation: 12327
I have the following code that I am trying to extract the systems proxy settings from:
QList<QNetworkProxy> listOfProxies = QNetworkProxyFactory::systemProxyForQuery();
foreach ( QNetworkProxy loopItem, listOfProxies ) {
qDebug() << "proxyUsed:" << loopItem.hostName();
}
I only get one item back and with a blank host name. Any ideas what I am missing?
Upvotes: 2
Views: 7949
Reputation: 11
QNetworkProxyQuery npq(QUrl(QLatin1String("http://www.google.com")));
Don't forget to use QLatin1String :)
Upvotes: 1
Reputation: 12327
By putting:
QNetworkProxyQuery npq(QUrl("http://www.google.com"));
QList<QNetworkProxy> listOfProxies = QNetworkProxyFactory::systemProxyForQuery(npq);
I appear get the proxy out.
Upvotes: 6