QGIS API Documentation 4.3.0-Master (0cef2469b72)
Loading...
Searching...
No Matches
qgshtmlrendersettings.cpp
Go to the documentation of this file.
1/***************************************************************************
2 qgshtmlrendersettings.h
3 -------------------
4 begin : November 2026
5 copyright : (C) 2026 by Nyall Dawson
6 email : nyall dot dawson at gmail dot com
7 ***************************************************************************/
8
9/***************************************************************************
10 * *
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
15 * *
16 ***************************************************************************/
17
19
20#include <QJsonValue>
21#include <QString>
22
23using namespace Qt::StringLiterals;
24
26{
27 return mBaseUrl.isEmpty() && mUserStylesheet.isEmpty() && mFeatureJson.isEmpty();
28}
29
31{
32 QVariantMap res;
33 if ( !baseUrl().isEmpty() )
34 {
35 res.insert( u"baseUrl"_s, baseUrl() );
36 }
37 if ( !userStylesheet().isEmpty() )
38 {
39 res.insert( u"userStylesheet"_s, userStylesheet() );
40 }
41 if ( !featureJson().isEmpty() )
42 {
43 res.insert( u"feature"_s, featureJson() );
44 }
45 return res;
46}
QString userStylesheet() const
Returns the user stylesheet CSS rules used while rendering the HTML content.
QUrl baseUrl() const
Returns the base URL used when resolving relative links.
QVariantMap featureJson() const
Returns the feature json (as a variant map).
bool isEmpty() const
Returns true no settings are set.
QVariantMap asMap() const
Returns the settings encapsulated in a variantmap, for passing to the qgis_html_to_pdf utility.