March 13, 2012

dqiyy dqiyy
Lab Rat
4 posts

How to get the IE Proxy Settings for Qt Application?

 

How can we get the IE Proxy Settings such as Server IP,Port, UserName, Password from the qt desktop application on windows system?
or QNetworkProxy provide some mechisim for directy using system proxy settings?

5 replies

March 13, 2012

adnan adnan
Lab Rat
276 posts

You can set proxy for the whole application, that is every request made by app will go through proxy. Use this in constructor.

  1.  proxy.setType(QNetworkProxy::Socks5Proxy);
  2.  proxy.setHostName("proxy.example.com");
  3.  proxy.setPort(1080);
  4.  proxy.setUser("username");
  5.  proxy.setPassword("password");
  6.  QNetworkProxy::setApplicationProxy(proxy);

For system proxy you can use this static function

  1. QList<QNetworkProxy> QNetworkProxyFactory::systemProxyForQuery ( const QNetworkProxyQuery & query = QNetworkProxyQuery() ) [static]

March 13, 2012

dqiyy dqiyy
Lab Rat
4 posts

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 ?

March 13, 2012

adnan adnan
Lab Rat
276 posts

I am sorry i couldn’t figure out what you are trying to say. Their are lot of grammatical mistakes. Can you try again.

March 13, 2012

adnan adnan
Lab Rat
276 posts

Perhaps you may get a solution here:

http://permalink.gmane.org/gmane.comp.lib.qt.general/38081

March 13, 2012

mlong mlong
Robot Herder
1551 posts

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.

 Signature 

Senior Software Engineer
AccuWeather Enterprise Solutions
/* My views and opinions do not necessarily reflect those of my employer.  Void where prohibited. */

 
  ‹‹ Pasting Graphics From Word for Mac into Qt      Developing Table and columns which gets updated Dynamically for Desktop- Plz Assit ››

You must log in to post a reply. Not a member yet? Register here!