[Qt-interest] Proxy Detection in Qt Application
Raja Rokkam
rokkamraja at gmail.com
Mon Nov 16 09:13:44 CET 2009
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/798d276b/attachment.html
More information about the Qt-interest-old
mailing list