[Qt-interest] Proxy Detection in Qt Application
Raja Rokkam
rokkamraja at gmail.com
Mon Nov 16 09:19:46 CET 2009
Hi,
I guess this should do the work:
http://stackoverflow.com/questions/932824/how-do-i-get-the-system-proxy-using-qt
Thanks,
Raja.
On Mon, Nov 16, 2009 at 1:43 PM, Raja Rokkam <rokkamraja at gmail.com> wrote:
> Hi All,
>
> I would like to add a snippet of code wherein my application can
> automatically detect the proxies to be used, depending on the platform and
> write into a file so that other applications can use it.
>
> I have come across QNetworkProxyFactory class and its static method:
> QNetworkProxyFactory::systemProxyForQuery(), but not sure if it will solve
> my problem as I am not getting any proper output with t his.
>
> Can anyone who has use this class before or have done something similar to
> this in past help me with it ?
>
> A simple snippet of code which I am using is:
>
> proxyConfig::proxyConfig()
>
> {
>
> listNetworkProxy = QNetworkProxyFactory::systemProxyForQuery();
>
> CustomLogger::getInstance()->write( "Constructor Entry point\n" );
>
> for( int i = 0; i < listNetworkProxy.size(); i++ )
>
> {
>
> CustomLogger::getInstance()->write( ( listNetworkProxy.at( i ).hostName()
> ).toStdString().c_str() );
>
> }
>
> CustomLogger::getInstance()->write( "Constructor Exit point\n" );
>
> }
>
>
>
> My log file shows the following:
>
> -----------Mon Nov 16 13:36:07 2009 -----------
> Mon Nov 16 13:36:07 2009 - Constructor Entry point
>
> Mon Nov 16 13:36:07 2009 -
>
> Mon Nov 16 13:36:07 2009 - Constructor Exit point
>
>
> Thanks,
> Raja.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20091116/18698d81/attachment.html
More information about the Qt-interest-old
mailing list