How to get the IE Proxy Settings for Qt Application?
-
You can set proxy for the whole application, that is every request made by app will go through proxy. Use this in constructor.
@QNetworkProxy proxy;
proxy.setType(QNetworkProxy::Socks5Proxy);
proxy.setHostName("proxy.example.com");
proxy.setPort(1080);
proxy.setUser("username");
proxy.setPassword("password");
QNetworkProxy::setApplicationProxy(proxy);@For system proxy you can use this static function
@QList<QNetworkProxy> QNetworkProxyFactory::systemProxyForQuery ( const QNetworkProxyQuery & query = QNetworkProxyQuery() ) [static]@ -
Thank you for your kingly reply, but what i am faced now is that we have a QWebkit page to access the internet from http, and our application what a settting option for user just like "using the IE's proxy setting"
but i am not find out how to get the NTLM type poxy 's username and password such as the IE proxy setting ? -
Perhaps you may get a solution here:
-
I think what he's saying is that he wants his Qt app to "borrow" whatever settings Internet Explorer has configured for its proxy, rather than making the user reconfigure his app separately.
I don't know of an easy way to do that, but there may be some sort of native code you could use to either query those settings, or read them from the registry directly. That's just a guess though. It's not something that Qt does natively, AFAIK.