From 92c97cda0496e0770488dc069c665248159f7230 Mon Sep 17 00:00:00 2001 From: Paolo Angelelli Date: Sat, 28 Jan 2017 14:52:08 +0100 Subject: 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 tags. Change-Id: I776f78f4b26b5b2cf04510a9fbc6302334b09c61 Reviewed-by: Eskil Abrahamsen Blomfeldt --- src/plugins/geoservices/osm/qgeotiledmaposm.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src/plugins/geoservices/osm') 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("") + html + QStringLiteral(""); +} + 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("
"); + copyRights += QStringLiteral(" | "); copyRights += QStringLiteral("Data © "); copyRights += dataCopy; } if (!styleCopy.isEmpty()) { if (!copyRights.isEmpty()) - copyRights += QStringLiteral("
"); + copyRights += QStringLiteral(" | "); copyRights += QStringLiteral("Style © "); 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 -- cgit v1.2.1