[Interest] Setting application wide proxy settings
ozemale at ozemail.com.au
ozemale at ozemail.com.au
Tue Jul 23 23:18:55 CEST 2013
I have posted previously about my efforts to get Google Maps to
display in WebView. I discovered that I needed to install OpenSSL so
that HTTPS could be used for some of the Google APIs.
That's all well and good but now on a different machine I am having
touble configuring Qt to use the system proxy. For this one we have
one system proxy that does not require authentication and one that
does. The default proxy is the one that does require authentication.
I have the following code to specify the proxy:
#include
#include "qtquick2applicationviewer.h"
#include
int main(int argc, char *argv[])
{
QGuiApplication app(argc, argv);
QNetworkProxy proxy;
proxy.setType(QNetworkProxy::HttpProxy);
proxy.setHostName("url.of.proxy.not.requiring.authentication");
proxy.setPort(8080);
QNetworkProxy::setApplicationProxy(proxy);
QtQuick2ApplicationViewer viewer;
viewer.setMainQmlFile(QStringLiteral("qml/Maps/main.qml"));
viewer.showExpanded();
return app.exec();
}
When I run this application I get a web page displayed in WebView
whose contents state there is an error 407 because the proxy requires
authentication and the proxy address specified in this page is the
default one and not the one I am explicitly telling Qt to use.
How can I get Qt to use the actual proxy I want it to use? All other
apps on this machine can use it so why not Qt?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20130724/6756e24d/attachment.html>
More information about the Interest
mailing list