diff options
author | Liang Qi <liang.qi@qt.io> | 2017-07-06 13:54:57 +0200 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2017-07-06 13:55:56 +0200 |
commit | 40b8d8f0b1c4d3dfdb63994f1c5d9e16760496f7 (patch) | |
tree | 0ad7002074b2996460d72722435c97d76ddc6466 /src/location/declarativemaps/qdeclarativegeomapcopyrightsnotice.cpp | |
parent | 420139a36dace3bb8f78f2d65b30f7657668d888 (diff) | |
parent | 5542c721af400750b13bd411dfbb13891f49618e (diff) | |
download | qtlocation-40b8d8f0b1c4d3dfdb63994f1c5d9e16760496f7.tar.gz |
Merge remote-tracking branch 'origin/5.9' into dev
Conflicts:
.qmake.conf
Change-Id: I3241efba9c3a32a4a097a67fd6432c45aad8e6ef
Diffstat (limited to 'src/location/declarativemaps/qdeclarativegeomapcopyrightsnotice.cpp')
-rw-r--r-- | src/location/declarativemaps/qdeclarativegeomapcopyrightsnotice.cpp | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/src/location/declarativemaps/qdeclarativegeomapcopyrightsnotice.cpp b/src/location/declarativemaps/qdeclarativegeomapcopyrightsnotice.cpp index 1101eb18..1a8489eb 100644 --- a/src/location/declarativemaps/qdeclarativegeomapcopyrightsnotice.cpp +++ b/src/location/declarativemaps/qdeclarativegeomapcopyrightsnotice.cpp @@ -129,20 +129,29 @@ void QDeclarativeGeoMapCopyrightNotice::setMapSource(QDeclarativeGeoMap *mapSour if (mapSource) { m_mapSource = mapSource; // First update the copyright. Only Image will do here, no need to store HTML right away. - if (!mapSource->m_copyrights->m_copyrightsImage.isNull()) + if (mapSource->m_copyrights && !mapSource->m_copyrights->m_copyrightsImage.isNull()) m_copyrightsImage = mapSource->m_copyrights->m_copyrightsImage; connect(m_mapSource, SIGNAL(copyrightsChanged(QImage)), this, SLOT(copyrightsChanged(QImage))); connect(m_mapSource, SIGNAL(copyrightsChanged(QString)), this, SLOT(copyrightsChanged(QString))); - connect(m_mapSource->m_map, SIGNAL(copyrightsStyleSheetChanged(QString)), - this, SLOT(onCopyrightsStyleSheetChanged(QString))); - connect(this, SIGNAL(linkActivated(QString)), - m_mapSource, SIGNAL(copyrightLinkActivated(QString))); - onCopyrightsStyleSheetChanged(m_mapSource->m_map->copyrightsStyleSheet()); + if (m_mapSource->m_map) + connectMap(); + else + connect(m_mapSource, &QDeclarativeGeoMap::mapReadyChanged, this, &QDeclarativeGeoMapCopyrightNotice::connectMap); } +} + +void QDeclarativeGeoMapCopyrightNotice::connectMap() +{ + connect(m_mapSource->m_map, SIGNAL(copyrightsStyleSheetChanged(QString)), + this, SLOT(onCopyrightsStyleSheetChanged(QString))); + connect(this, SIGNAL(linkActivated(QString)), + m_mapSource, SIGNAL(copyrightLinkActivated(QString))); + + onCopyrightsStyleSheetChanged(m_mapSource->m_map->copyrightsStyleSheet()); update(); emit mapSourceChanged(); |