diff options
Diffstat (limited to 'examples')
-rw-r--r-- | examples/location/mapviewer/main.cpp | 3 | ||||
-rw-r--r-- | examples/location/mapviewer/mapviewer.qml | 13 |
2 files changed, 16 insertions, 0 deletions
diff --git a/examples/location/mapviewer/main.cpp b/examples/location/mapviewer/main.cpp index 73bc937b..39c117ed 100644 --- a/examples/location/mapviewer/main.cpp +++ b/examples/location/mapviewer/main.cpp @@ -52,6 +52,8 @@ #include <QtGui/QGuiApplication> #include <QtQml/QQmlApplicationEngine> #include <QtQuick/QQuickItem> +#include <QSslSocket> +#include <QQmlContext> static bool parseArgs(QStringList& args, QVariantMap& parameters) { @@ -131,6 +133,7 @@ int main(int argc, char *argv[]) parameters[QStringLiteral("osm.useragent")] = QStringLiteral("QtLocation Mapviewer example"); QQmlApplicationEngine engine; + engine.rootContext()->setContextProperty("supportsSsl", QSslSocket::supportsSsl()); engine.addImportPath(QStringLiteral(":/imports")); engine.load(QUrl(QStringLiteral("qrc:///mapviewer.qml"))); QObject::connect(&engine, SIGNAL(quit()), qApp, SLOT(quit())); diff --git a/examples/location/mapviewer/mapviewer.qml b/examples/location/mapviewer/mapviewer.qml index e97076ab..e8b016aa 100644 --- a/examples/location/mapviewer/mapviewer.qml +++ b/examples/location/mapviewer/mapviewer.qml @@ -429,6 +429,19 @@ ApplicationWindow { focus: true initialItem: Item { id: page + + Text { + visible: !supportsSsl && map && map.activeMapType && activeMapType.metadata.isHTTPS + text: "The active map type\n +requires (missing) SSL\n +support" + horizontalAlignment: Text.AlignHCenter + font.pixelSize: appWindow.width / 12 + font.bold: true + color: "grey" + anchors.centerIn: parent + z: 12 + } } function showMessage(title,message,backPage) |