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 Q_FOREACH (
const QgsPageSize &pageSize, mPageSizes )
104 return pageSize.
name;
112 QList< QgsPageSize > matches =
find( pageSizeName.trimmed() );
113 if ( matches.length() > 0 )
115 pageSize = matches.at( 0 );
133 , displayName( displayName )
150 return ( !
operator==( other ) );
QgsLayoutMeasurement convert(QgsLayoutMeasurement measurement, QgsUnitTypes::LayoutUnit targetUnits) const
Converts a measurement from one unit to another.
bool qgsDoubleNear(double a, double b, double epsilon=4 *std::numeric_limits< double >::epsilon())
Compare two doubles (but allow some difference)
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.
QString name
Name of page size.
QgsUnitTypes::LayoutUnit units() const
Returns the units for the size.
bool operator!=(const QgsPageSize &other) const
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.
double height() const
Returns the height of the size.
double width() const
Returns the width of the size.