62 mPageSizes.append( size );
67 QList< QgsPageSize > result;
68 QList< QgsPageSize >::const_iterator it = mPageSizes.constBegin();
69 for ( ; it != mPageSizes.constEnd(); ++it )
71 result.push_back( *it );
78 QList< QgsPageSize > result;
79 QList< QgsPageSize >::const_iterator it = mPageSizes.constBegin();
80 for ( ; it != mPageSizes.constEnd(); ++it )
82 if ( ( *it ).name.compare( name, Qt::CaseInsensitive ) == 0 )
84 result.push_back( *it );
94 Q_FOREACH (
const QgsPageSize &pageSize, mPageSizes )
103 return pageSize.
name;
111 QList< QgsPageSize > matches =
find( pageSizeName.trimmed() );
112 if ( matches.length() > 0 )
114 pageSize = matches.at( 0 );
132 , displayName( displayName )
149 return ( !
operator==( other ) );
QList< QgsPageSize > find(const QString &name) const
Finds matching page sizes from the registry, using a case insensitive match on the page size name...
QgsUnitTypes::LayoutUnit units() const
Returns the units for the size.
bool qgsDoubleNear(double a, double b, double epsilon=4 *std::numeric_limits< double >::epsilon())
Compare two doubles (but allow some difference)
double height() const
Returns the height of the size.
bool operator!=(const QgsPageSize &other) const
double width() const
Returns the width of the size.
QgsLayoutMeasurement convert(QgsLayoutMeasurement measurement, QgsUnitTypes::LayoutUnit targetUnits) const
Converts a measurement from one unit to another.
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.
QString name
Name of page size.
QList< QgsPageSize > entries() const
Returns a list of page sizes in the registry.
A named page size for layouts.
void add(const QgsPageSize &size)
Adds a page size to the registry.
This class provides a method of converting QgsLayoutMeasurements from one unit to another...
bool operator==(const QgsPageSize &other) const
This class provides a method of storing sizes, consisting of a width and height, for use in QGIS layo...
QgsLayoutSize size
Page size.
QString displayName
Translated page name.