summaryrefslogtreecommitdiff
path: root/src/plugins/geoservices/osm
diff options
context:
space:
mode:
authorPaolo Angelelli <paolo.angelelli@qt.io>2017-01-28 14:52:08 +0100
committerPaolo Angelelli <paolo.angelelli@qt.io>2017-01-31 12:26:16 +0000
commit92c97cda0496e0770488dc069c665248159f7230 (patch)
treec6c9c2487def3da3bfd9cc395fab92882c624862 /src/plugins/geoservices/osm
parentfa58926f51b532bd82baf9cd9f1e75548139235a (diff)
downloadqtlocation-92c97cda0496e0770488dc069c665248159f7230.tar.gz
Add color and style properties to QDeclarativeGeoMapCopyrightNotice
This patch adds two new properties to the MapCopyrightNotice element to allow changing the background color and content style of the notice. backgroundColor controls the color of the background of the element. styleSheet, on the other hand, sets a stylesheet to the html, which allows to change color, font and size of the html. To make this work, the html output from the plugins has to be properly enclosed in <body></body> tags. Change-Id: I776f78f4b26b5b2cf04510a9fbc6302334b09c61 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Diffstat (limited to 'src/plugins/geoservices/osm')
-rw-r--r--src/plugins/geoservices/osm/qgeotiledmaposm.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/plugins/geoservices/osm/qgeotiledmaposm.cpp b/src/plugins/geoservices/osm/qgeotiledmaposm.cpp
index d94a40a6..e1383afb 100644
--- a/src/plugins/geoservices/osm/qgeotiledmaposm.cpp
+++ b/src/plugins/geoservices/osm/qgeotiledmaposm.cpp
@@ -45,6 +45,11 @@
QT_BEGIN_NAMESPACE
+static QString bodify(const QString &html)
+{
+ return QStringLiteral("<body>") + html + QStringLiteral("</body>");
+}
+
QGeoTiledMapOsm::QGeoTiledMapOsm(QGeoTiledMappingManagerEngineOsm *engine, QObject *parent)
: QGeoTiledMap(engine, parent), m_mapId(-1), m_engine(engine)
{
@@ -95,13 +100,13 @@ void QGeoTiledMapOsm::onProviderDataUpdated(const QGeoTileProviderOsm *provider)
}
if (!dataCopy.isEmpty()) {
if (!copyRights.isEmpty())
- copyRights += QStringLiteral("<br/>");
+ copyRights += QStringLiteral(" | ");
copyRights += QStringLiteral("Data &copy; ");
copyRights += dataCopy;
}
if (!styleCopy.isEmpty()) {
if (!copyRights.isEmpty())
- copyRights += QStringLiteral("<br/>");
+ copyRights += QStringLiteral(" | ");
copyRights += QStringLiteral("Style &copy; ");
copyRights += styleCopy;
}
@@ -109,7 +114,7 @@ void QGeoTiledMapOsm::onProviderDataUpdated(const QGeoTileProviderOsm *provider)
if (copyRights.isEmpty() && provider->mapType().style() == QGeoMapType::CustomMap)
copyRights = m_engine->customCopyright();
- emit copyrightsChanged(copyRights);
+ emit copyrightsChanged(bodify(copyRights));
}
QT_END_NAMESPACE