QGIS API Documentation 3.36.0-Maidenhead (09951dc0acf)
Loading...
Searching...
No Matches
Public Member Functions | List of all members
QgsPageSizeRegistry Class Reference

A registry for known page sizes. More...

#include <qgspagesizeregistry.h>

Public Member Functions

 QgsPageSizeRegistry ()
 Creates a registry and populates it with known sizes.
 
void add (const QgsPageSize &size)
 Adds a page size to the registry.
 
bool decodePageSize (const QString &string, QgsPageSize &size) const
 Decodes a string representing a preset page size.
 
QList< QgsPageSizeentries () const
 Returns a list of page sizes in the registry.
 
QString find (const QgsLayoutSize &size) const
 Finds a matching page size from the registry.
 
QList< QgsPageSizefind (const QString &name) const
 Finds matching page sizes from the registry, using a case insensitive match on the page size name.
 

Detailed Description

A registry for known page sizes.

QgsPageSizeRegistry is not usually directly created, but rather accessed through QgsApplication::pageSizeRegistry().

Definition at line 71 of file qgspagesizeregistry.h.

Constructor & Destructor Documentation

◆ QgsPageSizeRegistry()

QgsPageSizeRegistry::QgsPageSizeRegistry ( )

Creates a registry and populates it with known sizes.

Definition at line 25 of file qgspagesizeregistry.cpp.

Member Function Documentation

◆ add()

void QgsPageSizeRegistry::add ( const QgsPageSize size)

Adds a page size to the registry.

Definition at line 61 of file qgspagesizeregistry.cpp.

◆ decodePageSize()

bool QgsPageSizeRegistry::decodePageSize ( const QString &  string,
QgsPageSize size 
) const

Decodes a string representing a preset page size.

The decoded page size will be stored in the size argument.

Returns
true if string was successfully decoded

Definition at line 111 of file qgspagesizeregistry.cpp.

◆ entries()

QList< QgsPageSize > QgsPageSizeRegistry::entries ( ) const

Returns a list of page sizes in the registry.

Definition at line 66 of file qgspagesizeregistry.cpp.

◆ find() [1/2]

QString QgsPageSizeRegistry::find ( const QgsLayoutSize size) const

Finds a matching page size from the registry.

Returns the page size name, or an empty string if no matching size could be found.

Orientation is ignored when matching page sizes, so a landscape A4 page will match to the portrait A4 size in the registry.

Definition at line 91 of file qgspagesizeregistry.cpp.

◆ find() [2/2]

QList< QgsPageSize > QgsPageSizeRegistry::find ( const QString &  name) const

Finds matching page sizes from the registry, using a case insensitive match on the page size name.

Definition at line 77 of file qgspagesizeregistry.cpp.


The documentation for this class was generated from the following files: