diff options
author | Bruno de Oliveira Abinader <bruno@mapbox.com> | 2018-03-02 19:43:30 +0200 |
---|---|---|
committer | Bruno de Oliveira Abinader <bruno@mapbox.com> | 2018-03-05 14:41:58 -0500 |
commit | fc140e265b559868a2a9f568583689ee4a6b9dfd (patch) | |
tree | 2dfbd48d9b8d5b5b720b0aa50ce65211abc4e481 /platform/qt | |
parent | ae0e583590ce8d7a564c8d9cb7c0fcee5515125e (diff) | |
download | qtlocation-mapboxgl-fc140e265b559868a2a9f568583689ee4a6b9dfd.tar.gz |
[Qt] Expose mapLoadingFailed signal
Diffstat (limited to 'platform/qt')
-rw-r--r-- | platform/qt/include/qmapboxgl.hpp | 1 | ||||
-rw-r--r-- | platform/qt/src/qmapboxgl.cpp | 1 | ||||
-rw-r--r-- | platform/qt/src/qmapboxgl_map_observer.cpp | 7 | ||||
-rw-r--r-- | platform/qt/src/qmapboxgl_map_observer.hpp | 1 |
4 files changed, 9 insertions, 1 deletions
diff --git a/platform/qt/include/qmapboxgl.hpp b/platform/qt/include/qmapboxgl.hpp index bc18eaba59..7b07a0dff6 100644 --- a/platform/qt/include/qmapboxgl.hpp +++ b/platform/qt/include/qmapboxgl.hpp @@ -251,6 +251,7 @@ public slots: signals: void needsRendering(); void mapChanged(QMapboxGL::MapChange); + void mapLoadingFailed(const QString &reason); void copyrightsChanged(const QString ©rightsHtml); void staticRenderFinished(const QString &error); diff --git a/platform/qt/src/qmapboxgl.cpp b/platform/qt/src/qmapboxgl.cpp index 982f4b3b35..5430af30e2 100644 --- a/platform/qt/src/qmapboxgl.cpp +++ b/platform/qt/src/qmapboxgl.cpp @@ -1649,6 +1649,7 @@ QMapboxGLPrivate::QMapboxGLPrivate(QMapboxGL *q, const QMapboxGLSettings &settin qRegisterMetaType<QMapboxGL::MapChange>("QMapboxGL::MapChange"); connect(m_mapObserver.get(), SIGNAL(mapChanged(QMapboxGL::MapChange)), q, SIGNAL(mapChanged(QMapboxGL::MapChange))); + connect(m_mapObserver.get(), SIGNAL(mapLoadingFailed(QString)), q, SIGNAL(mapLoadingFailed(QString))); connect(m_mapObserver.get(), SIGNAL(copyrightsChanged(QString)), q, SIGNAL(copyrightsChanged(QString))); // Setup the Map object diff --git a/platform/qt/src/qmapboxgl_map_observer.cpp b/platform/qt/src/qmapboxgl_map_observer.cpp index 60c6b81841..43b4162eb4 100644 --- a/platform/qt/src/qmapboxgl_map_observer.cpp +++ b/platform/qt/src/qmapboxgl_map_observer.cpp @@ -2,6 +2,10 @@ #include "qmapboxgl_p.hpp" +#include <mbgl/util/string.hpp> + +#include <exception> + QMapboxGLMapObserver::QMapboxGLMapObserver(QMapboxGLPrivate *d) : d_ptr(d) { @@ -44,9 +48,10 @@ void QMapboxGLMapObserver::onDidFinishLoadingMap() emit mapChanged(QMapboxGL::MapChangeDidFinishLoadingMap); } -void QMapboxGLMapObserver::onDidFailLoadingMap(std::exception_ptr) +void QMapboxGLMapObserver::onDidFailLoadingMap(std::exception_ptr exception) { emit mapChanged(QMapboxGL::MapChangeDidFailLoadingMap); + emit mapLoadingFailed(QString::fromStdString(mbgl::util::toString(exception))); } void QMapboxGLMapObserver::onWillStartRenderingFrame() diff --git a/platform/qt/src/qmapboxgl_map_observer.hpp b/platform/qt/src/qmapboxgl_map_observer.hpp index c9d0581a90..7c272c39ae 100644 --- a/platform/qt/src/qmapboxgl_map_observer.hpp +++ b/platform/qt/src/qmapboxgl_map_observer.hpp @@ -36,6 +36,7 @@ public: signals: void mapChanged(QMapboxGL::MapChange); + void mapLoadingFailed(const QString &reason); void copyrightsChanged(const QString ©rightsHtml); private: |