QGIS API Documentation 3.99.0-Master (2fe06baccd8)
Loading...
Searching...
No Matches
qgsprintlayout.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsprintlayout.h
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#ifndef QGSPRINTLAYOUT_H
17#define QGSPRINTLAYOUT_H
18
19#include "qgis_core.h"
20#include "qgslayout.h"
21
22class QgsLayoutAtlas;
23
29class CORE_EXPORT QgsPrintLayout : public QgsLayout, public QgsMasterLayoutInterface
30{
31 Q_OBJECT
32 Q_PROPERTY( QString name READ name WRITE setName NOTIFY nameChanged )
33
34 public:
35
40
41 QgsPrintLayout *clone() const override SIP_FACTORY;
42 QgsProject *layoutProject() const override;
44 QIcon icon() const override;
45
50
51 QString name() const override { return mName; }
52 void setName( const QString &name ) override;
53
54 QDomElement writeXml( QDomDocument &document, const QgsReadWriteContext &context ) const override;
55 bool readXml( const QDomElement &layoutElement, const QDomDocument &document, const QgsReadWriteContext &context ) override;
56
57 // QgsLayoutInterface
58 QDomElement writeLayoutXml( QDomDocument &document, const QgsReadWriteContext &context ) const override;
59 bool readLayoutXml( const QDomElement &layoutElement, const QDomDocument &document, const QgsReadWriteContext &context ) override;
61 void updateSettings() override;
62
63 bool layoutAccept( QgsStyleEntityVisitorInterface *visitor ) const override;
64
65 signals:
66
71 void nameChanged( const QString &name );
72
73 private:
74
75 QString mName;
76 QgsLayoutAtlas *mAtlas = nullptr;
77
78 QgsPrintLayout( const QgsPrintLayout & ) = delete;
79 QgsPrintLayout &operator=( const QgsPrintLayout & ) = delete;
80};
81
82#endif //QGSPRINTLAYOUT_H
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
Used to render QgsLayout as an atlas, by iterating over the features from an associated vector layer.
virtual bool readXml(const QDomElement &layoutElement, const QDomDocument &document, const QgsReadWriteContext &context)
Sets the collection's state from a DOM element.
QgsLayout * clone() const
Creates a clone of the layout.
Definition qgslayout.cpp:97
QgsExpressionContext createExpressionContext() const override
Creates an expression context relating to the layout's current state.
virtual QDomElement writeXml(QDomDocument &document, const QgsReadWriteContext &context) const
Returns the layout's state encapsulated in a DOM element.
QgsProject * project() const
The project associated with the layout.
QgsLayout(QgsProject *project)
Construct a new layout linked to the specified project.
Definition qgslayout.cpp:50
Interface for master layout type objects, such as print layouts and reports.
virtual QDomElement writeLayoutXml(QDomDocument &document, const QgsReadWriteContext &context) const =0
Returns the layout's state encapsulated in a DOM element.
virtual void updateSettings()=0
Refreshes the layout when global layout related options change.
virtual bool layoutAccept(QgsStyleEntityVisitorInterface *visitor) const
Accepts the specified style entity visitor, causing it to visit all style entities associated with th...
virtual void setName(const QString &name)=0
Sets the layout's name.
virtual bool readLayoutXml(const QDomElement &layoutElement, const QDomDocument &document, const QgsReadWriteContext &context)=0
Sets the layout's state from a DOM element.
QgsProject * layoutProject() const override
The project associated with the layout.
QgsLayoutAtlas * atlas()
Returns the print layout's atlas.
QgsPrintLayout(QgsProject *project)
Constructor for QgsPrintLayout.
QIcon icon() const override
Returns an icon for the layout.
void setName(const QString &name) override
Sets the layout's name.
QgsMasterLayoutInterface::Type layoutType() const override
Returns the master layout type.
void nameChanged(const QString &name)
Emitted when the layout's name is changed.
Encapsulates a QGIS project, including sets of map layers and their styles, layouts,...
Definition qgsproject.h:109
A container for the context for various read/write operations on objects.
An interface for classes which can visit style entity (e.g.
#define SIP_FACTORY
Definition qgis_sip.h:84