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 ) );
QgsLayoutMeasurement convert(const QgsLayoutMeasurement &measurement, const QgsUnitTypes::LayoutUnit targetUnits) const
Converts a measurement from one unit to another.
bool qgsDoubleNear(double a, double b, double epsilon=4 *DBL_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.