diff options
Diffstat (limited to 'src/location/declarativemaps/qdeclarativegeomapcopyrightsnotice.cpp')
-rw-r--r-- | src/location/declarativemaps/qdeclarativegeomapcopyrightsnotice.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/location/declarativemaps/qdeclarativegeomapcopyrightsnotice.cpp b/src/location/declarativemaps/qdeclarativegeomapcopyrightsnotice.cpp index fdfb645a..1101eb18 100644 --- a/src/location/declarativemaps/qdeclarativegeomapcopyrightsnotice.cpp +++ b/src/location/declarativemaps/qdeclarativegeomapcopyrightsnotice.cpp @@ -169,7 +169,11 @@ void QDeclarativeGeoMapCopyrightNotice::setStyleSheet(const QString &styleSheet) if (!m_html.isEmpty() && m_copyrightsHtml) { delete m_copyrightsHtml; createCopyright(); +#if QT_CONFIG(texthtmlparser) m_copyrightsHtml->setHtml(m_html); +#else + m_copyrightsHtml->setPlainText(m_html); +#endif } rasterizeHtmlAndUpdate(); emit styleSheetChanged(m_styleSheet); @@ -231,8 +235,10 @@ void QDeclarativeGeoMapCopyrightNotice::rasterizeHtmlAndUpdate() void QDeclarativeGeoMapCopyrightNotice::createCopyright() { m_copyrightsHtml = new QTextDocument(this); +#if QT_CONFIG(cssparser) if (!m_styleSheet.isEmpty()) m_copyrightsHtml->setDefaultStyleSheet(m_styleSheet); +#endif // The default 4 makes the copyright too wide and tall. m_copyrightsHtml->setDocumentMargin(0); @@ -289,12 +295,20 @@ void QDeclarativeGeoMapCopyrightNotice::copyrightsChanged(const QString ©rig // Divfy, so we can style the background. The extra <span> is a // workaround to QTBUG-58838 and should be removed when it gets fixed. +#if QT_CONFIG(texthtmlparser) m_html = QStringLiteral("<div id='copyright-root'><span>") + copyrightsHtml + QStringLiteral("</span></div>"); +#else + m_html = copyrightsHtml; +#endif if (!m_copyrightsHtml) createCopyright(); +#if QT_CONFIG(texthtmlparser) m_copyrightsHtml->setHtml(m_html); +#else + m_copyrightsHtml->setPlainText(m_html); +#endif rasterizeHtmlAndUpdate(); } @@ -307,7 +321,11 @@ void QDeclarativeGeoMapCopyrightNotice::onCopyrightsStyleSheetChanged(const QStr if (!m_html.isEmpty() && m_copyrightsHtml) { delete m_copyrightsHtml; createCopyright(); +#if QT_CONFIG(texthtmlparser) m_copyrightsHtml->setHtml(m_html); +#else + m_copyrightsHtml->setPlainText(m_html); +#endif } rasterizeHtmlAndUpdate(); emit styleSheetChanged(m_styleSheet); |