Results 1 to 3 of 3

Thread: Getting windows internet proxy settings

  1. #1
    Join Date
    May 2007
    Posts
    9
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Question Getting windows internet proxy settings

    Is there any way in Qt to query for windows proxy settings that could then be fed into QNetworkProxy::setApplicationProxy? I would like to be able to get and use the same proxy settings as internet explorer in my application.

  2. #2
    Join Date
    May 2007
    Posts
    9
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Unhappy Re: Getting windows internet proxy settings

    It looks like QNetworkProxyFactory::systemProxyForQuery should work for this, but It is not returning the proxy that I expect.

    Qt Code:
    1. QNetworkProxyQuery q;
    2. q.setQueryType(QNetworkProxyQuery::UrlRequest);
    3. q.setProtocolTag("http");
    4.  
    5. QList<QNetworkProxy> proxies = QNetworkProxyFactory::systemProxyForQuery(q);
    6. if( proxies.size() > 0 && proxies[0].type() != QNetworkProxy::NoProxy )
    7. QNetworkProxy::setApplicationProxy(proxies[0]);
    8. else
    9. qDebug("No proxy server selected");
    To copy to clipboard, switch view to plain text mode 

    I always get back a single item in the list with NoProxy for type. Any ideas?

  3. #3
    Join Date
    May 2007
    Posts
    9
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Arrow Re: Getting windows internet proxy settings

    Turns out it works if you add a url to the query.

Similar Threads

  1. Replies: 5
    Last Post: 15th January 2009, 09:03
  2. Using windows proxy settings
    By schall_l in forum Qt Programming
    Replies: 0
    Last Post: 22nd October 2008, 15:05

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.