QGIS API Documentation 3.99.0-Master (2fe06baccd8)
Loading...
Searching...
No Matches
qgspagesizeregistry.h
Go to the documentation of this file.
1/***************************************************************************
2 qgspagesizeregistry.h
3 --------------------
4 begin : June 2017
5 copyright : (C) 2017 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
18#ifndef QGSPAGESIZEREGISTRY_H
19#define QGSPAGESIZEREGISTRY_H
20
21#include "qgslayoutsize.h"
22
23#include <QList>
24#include <QSizeF>
25#include <QString>
26
32class CORE_EXPORT QgsPageSize
33{
34
35 public:
36
38
43 QgsPageSize( const QString &name, const QgsLayoutSize &size, const QString &displayName = QString() );
44
49
51 QString name;
52
55
57 QString displayName;
58
59 bool operator==( const QgsPageSize &other ) const;
60 bool operator!=( const QgsPageSize &other ) const;
61};
62
72class CORE_EXPORT QgsPageSizeRegistry
73{
74 public:
75
80
84 void add( const QgsPageSize &size );
85
89 QList< QgsPageSize > entries() const;
90
95 QList< QgsPageSize > find( const QString &name ) const;
96
104 QString find( const QgsLayoutSize &size ) const;
105
111 bool decodePageSize( const QString &string, QgsPageSize &size ) const;
112
113 private:
114
115 QList< QgsPageSize > mPageSizes;
116};
117
118#endif //QGSPAGESIZEREGISTRY_H
Provides a method of storing sizes, consisting of a width and height, for use in QGIS layouts.
QList< QgsPageSize > entries() const
Returns a list of page sizes in the registry.
QList< QgsPageSize > find(const QString &name) const
Finds matching page sizes from the registry, using a case insensitive match on the page size name.
bool decodePageSize(const QString &string, QgsPageSize &size) const
Decodes a string representing a preset page size.
QgsPageSizeRegistry()
Creates a registry and populates it with known sizes.
void add(const QgsPageSize &size)
Adds a page size to the registry.
A named page size for layouts.
QString displayName
Translated page name.
QString name
Name of page size.
QgsLayoutSize size
Page size.
bool operator==(const QgsFeatureIterator &fi1, const QgsFeatureIterator &fi2)
bool operator!=(const QgsFeatureIterator &fi1, const QgsFeatureIterator &fi2)