summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Shaw <andy.shaw@qt.io>2019-04-29 09:46:48 +0200
committerAndy Shaw <andy.shaw@qt.io>2019-04-29 15:41:56 +0000
commit1e88a55671d6514894a663bf207d783e85759781 (patch)
tree84f7a8ab1c1f6965d9cb6f476fff2771ae3541b5
parent6c30ba1141c60c271cab67bf12a7b78323bfdd45 (diff)
downloadqtlocation-1e88a55671d6514894a663bf207d783e85759781.tar.gz
Check that SSL support is available at compile time before using it
Change-Id: Id0e7e14a06306a2d8c2098bcb6de6c53d28ca88f Reviewed-by: Paolo Angelelli <paolo.angelelli@qt.io>
-rw-r--r--examples/location/mapviewer/main.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/examples/location/mapviewer/main.cpp b/examples/location/mapviewer/main.cpp
index 39c117ed..b332de8c 100644
--- a/examples/location/mapviewer/main.cpp
+++ b/examples/location/mapviewer/main.cpp
@@ -52,7 +52,9 @@
#include <QtGui/QGuiApplication>
#include <QtQml/QQmlApplicationEngine>
#include <QtQuick/QQuickItem>
+#if QT_CONFIG(ssl)
#include <QSslSocket>
+#endif
#include <QQmlContext>
static bool parseArgs(QStringList& args, QVariantMap& parameters)
@@ -133,7 +135,11 @@ int main(int argc, char *argv[])
parameters[QStringLiteral("osm.useragent")] = QStringLiteral("QtLocation Mapviewer example");
QQmlApplicationEngine engine;
+#if QT_CONFIG(ssl)
engine.rootContext()->setContextProperty("supportsSsl", QSslSocket::supportsSsl());
+#else
+ engine.rootContext()->setContextProperty("supportsSsl", false);
+#endif
engine.addImportPath(QStringLiteral(":/imports"));
engine.load(QUrl(QStringLiteral("qrc:///mapviewer.qml")));
QObject::connect(&engine, SIGNAL(quit()), qApp, SLOT(quit()));