QGIS API Documentation
4.3.0-Master (52aa6503bed)
Toggle main menu visibility
Loading...
Searching...
No Matches
src
core
layout
qgsreport.cpp
Go to the documentation of this file.
1
/***************************************************************************
2
qgsreport.cpp
3
--------------------
4
begin : December 2017
5
copyright : (C) 2017 by Nyall Dawson
6
email : nyall dot dawson at gmail dot com
7
***************************************************************************/
8
/***************************************************************************
9
* *
10
* This program is free software; you can redistribute it and/or modify *
11
* it under the terms of the GNU General Public License as published by *
12
* the Free Software Foundation; either version 2 of the License, or *
13
* (at your option) any later version. *
14
* *
15
***************************************************************************/
16
17
#include "
qgsreport.h
"
18
19
#include "
qgslayout.h
"
20
21
#include <QString>
22
23
#include "moc_qgsreport.cpp"
24
25
using namespace
Qt::StringLiterals;
26
28
29
QgsReport::QgsReport(
QgsProject
*project )
30
: QgsAbstractReportSection( nullptr )
31
, mProject( project )
32
{}
33
34
QIcon QgsReport::icon()
const
35
{
36
return
QgsApplication::getThemeIcon
( u
"mIconReport.svg"
_s );
37
}
38
39
QgsReport *QgsReport::clone()
const
40
{
41
auto
copy = std::make_unique< QgsReport >( mProject );
42
copyCommonProperties( copy.get() );
43
return
copy.release();
44
}
45
46
void
QgsReport::setName(
const
QString &name )
47
{
48
mName = name;
49
emit nameChanged( mName );
50
}
51
52
QDomElement QgsReport::writeLayoutXml( QDomDocument &document,
const
QgsReadWriteContext
&context )
const
53
{
54
QDomElement element = document.createElement( u
"Report"
_s );
55
writeXml( element, document, context );
56
element.setAttribute( u
"name"
_s, mName );
57
return
element;
58
}
59
60
bool
QgsReport::readLayoutXml(
const
QDomElement &layoutElement,
const
QDomDocument &document,
const
QgsReadWriteContext
&context )
61
{
62
const
QDomNodeList sectionList = layoutElement.elementsByTagName( u
"Section"
_s );
63
if
( sectionList.count() > 0 )
64
{
65
readXml( sectionList.at( 0 ).toElement(), document, context );
66
}
67
setName( layoutElement.attribute( u
"name"
_s ) );
68
return
true
;
69
}
70
71
void
QgsReport::updateSettings()
72
{
73
reloadSettings();
74
}
75
76
bool
QgsReport::layoutAccept(
QgsStyleEntityVisitorInterface
*visitor )
const
77
{
78
return
accept( visitor );
79
}
80
81
QgsMasterLayoutInterface::Type
QgsReport::layoutType()
const
82
{
83
return
QgsMasterLayoutInterface::Report
;
84
}
85
QgsApplication::getThemeIcon
static QIcon getThemeIcon(const QString &name, const QColor &fillColor=QColor(), const QColor &strokeColor=QColor())
Helper to get a theme icon.
Definition
qgsapplication.cpp:904
QgsMasterLayoutInterface::Type
Type
Master layout type.
Definition
qgsmasterlayoutinterface.h:68
QgsMasterLayoutInterface::Report
@ Report
Report (QgsReport).
Definition
qgsmasterlayoutinterface.h:70
QgsProject
Encapsulates a QGIS project, including sets of map layers and their styles, layouts,...
Definition
qgsproject.h:114
QgsReadWriteContext
A container for the context for various read/write operations on objects.
Definition
qgsreadwritecontext.h:38
QgsStyleEntityVisitorInterface
An interface for classes which can visit style entity (e.g.
Definition
qgsstyleentityvisitor.h:34
qgslayout.h
qgsreport.h
Generated on
for QGIS API Documentation by
1.17.0