summaryrefslogtreecommitdiff
path: root/tests/systemtests/map3d/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/systemtests/map3d/main.cpp')
-rw-r--r--tests/systemtests/map3d/main.cpp45
1 files changed, 45 insertions, 0 deletions
diff --git a/tests/systemtests/map3d/main.cpp b/tests/systemtests/map3d/main.cpp
new file mode 100644
index 00000000..4c9d0b85
--- /dev/null
+++ b/tests/systemtests/map3d/main.cpp
@@ -0,0 +1,45 @@
+#include <QApplication>
+
+#include <QUrl>
+#include <QSettings>
+#include <QProcessEnvironment>
+#include <QNetworkProxyFactory>
+
+#include "mainwidget.h"
+
+int main(int argc, char** argv)
+{
+ QApplication app(argc, argv);
+
+ // not in the tutorial text: set up a proxy server from
+ // a QSettings file if necessary (useful on Linux)
+
+ QApplication::setOrganizationName("Nokia");
+ QApplication::setApplicationName("Maps3D");
+
+ QSettings settings;
+
+ QVariant value = settings.value("http.proxy");
+ if (value.isValid()) {
+ QUrl url(value.toString(), QUrl::TolerantMode);
+ QNetworkProxy proxy;
+ proxy.setType(QNetworkProxy::HttpProxy);
+ proxy.setHostName(url.host());
+ proxy.setPort(url.port(8080));
+ QNetworkProxy::setApplicationProxy(proxy);
+ }
+
+ int bm = 0;
+
+ if (argc == 2) {
+ bool ok = false;
+ bm = QString(QLatin1String(argv[1])).toInt(&ok);
+ if (!ok)
+ bm = 0;
+ }
+
+ MainWidget *w = new MainWidget(0, bm);
+ w->show();
+
+ return app.exec();
+}