63 mPageSizes.append( size );
68 QList< QgsPageSize > result;
69 QList< QgsPageSize >::const_iterator it = mPageSizes.constBegin();
70 for ( ; it != mPageSizes.constEnd(); ++it )
72 result.push_back( *it );
79 QList< QgsPageSize > result;
80 QList< QgsPageSize >::const_iterator it = mPageSizes.constBegin();
81 for ( ; it != mPageSizes.constEnd(); ++it )
83 if ( ( *it ).name.compare( name, Qt::CaseInsensitive ) == 0 )
85 result.push_back( *it );
95 const auto constMPageSizes = mPageSizes;
96 for (
const QgsPageSize &pageSize : constMPageSizes )
105 return pageSize.name;
113 const QList< QgsPageSize > matches =
find( pageSizeName.trimmed() );
114 if ( matches.length() > 0 )
116 pageSize = matches.at( 0 );
134 , displayName( displayName )
151 return ( !
operator==( other ) );
This class provides a method of converting QgsLayoutMeasurements from one unit to another.
QgsLayoutMeasurement convert(QgsLayoutMeasurement measurement, QgsUnitTypes::LayoutUnit targetUnits) const
Converts a measurement from one unit to another.
This class provides a method of storing sizes, consisting of a width and height, for use in QGIS layo...
QgsUnitTypes::LayoutUnit units() const
Returns the units for the size.
double height() const
Returns the height of the size.
double width() const
Returns the width of the size.
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)
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.
bool operator==(const QgsPageSize &other) const
bool operator!=(const QgsPageSize &other) const
QString name
Name of page size.
QgsLayoutSize size
Page size.
bool qgsDoubleNear(double a, double b, double epsilon=4 *std::numeric_limits< double >::epsilon())
Compare two doubles (but allow some difference)