How to set proxy for Nokia Qt SDK Simulator?
How to set proxy for Nokia Qt SDK Simulator?
As far as I know there is no way.
So you coulld set an application proxy using http://doc.qt.nokia.com/4.6/qnetwork...plicationProxy
Last edited by gnuton; 2010-06-30 at 14:03.
Wonder how come they missed such an important feature.
The simulator accepts the system proxy settings just like any other application. What is your use case for separate proxy settings in the simulator?
PS: Note that in order to make use of proxys in Qt applications (no matter the platform, i.e. wether on the device or in the simulator) with QNetworkAccessManager, you need to set
in the main() function before using any networking functionality.Code:QNetworkProxyFactory::setUseSystemConfiguration(true);
Last edited by danimo; 2010-06-30 at 13:48.
In my case the simulator is not accepting system proxy settings. Is there any example with which I can test it.
The example you need to use is Google Chat it in the Nokia Qt SDK examples at path C:\NokiaQtSDK\Examples\4.6\webkit\googlechat
in main.cpp the code is
ThanksCode:#include <QtGui> #include <QNetworkProxyFactory> #include "googlechat.h" int main(int argc, char * argv[]) { QApplication app(argc, argv); QNetworkProxyFactory::setUseSystemConfiguration(true); GoogleChat chat; chat.show(); return app.exec(); }
Jim
So won't it work with out the line
QNetworkProxyFactory::setUseSystemConfiguration(true);
Is it always required.
Reading the manual/docs seems so see http://doc.qt.nokia.com/4.6-snapshot...xyfactory.html
as you will see this is new for Qt 4.6 so old code will need converting this would seemvoid QNetworkProxyFactory::setUseSystemConfiguration ( bool enable ) [static]
If you remove this line in the example this fails.
Enables the use of the platform-specific proxy settings, and only those. See systemProxyForQuery() for more information.
Internally, this method (when called with enable set to true) sets an application-wide proxy factory. For this reason, this method is mutually exclusive with setApplicationProxyFactory: calling setApplicationProxyFactory overrides the use of the system-wide proxy, and calling setUseSystemConfiguration overrides any application proxy or proxy factory that was previously set.
This function was introduced in Qt 4.6.
From the source code for Qt 4.5 you can see this did not exist in Qt 4.5. Qt 4.5 chose to implement transparent "basic" proxy.
To add to the problems Microsoft changed the way product Proxy server worked therefore causing Qt to fail and this is most likely why changes were madeCode:\since 4.4 Returns true if this proxy supports transparent tunneling of TCP connections. This matches the QNetworkProxy::TunnelingCapability capability. In Qt 4.4, the capability was tied to the proxy type, but since Qt 4.5 it is possible to remove the capability of caching from a proxy by calling setCapabilities(). \sa capabilities(), type(), isCachingProxy() */ 00566 bool QNetworkProxy::isTransparentProxy() const { return capabilities() & TunnelingCapability;
Jim