QGIS API Documentation
3.26.3-Buenos Aires (65e4edfdad)
|
Go to the documentation of this file.
20 #include <QStringList>
30 : mWidth( size.width() )
31 , mHeight( size.height() )
49 return QSizeF( mWidth, mHeight );
59 QStringList parts =
string.split(
',' );
60 if ( parts.count() != 3 )
75 return ( !
operator==( other ) );
double width() const
Returns the width of the size.
QgsUnitTypes::LayoutUnit units() const
Returns the units for the size.
LayoutUnit
Layout measurement units.
bool isEmpty() const
Tests whether the size is empty, ie both its width and height are zero.
static QgsLayoutSize decodeSize(const QString &string)
Decodes a size from a string.
bool operator==(const QgsLayoutSize &other) const
QString encodeSize() const
Encodes the layout size to a string.
static Q_INVOKABLE QString encodeUnit(QgsUnitTypes::DistanceUnit unit)
Encodes a distance unit to a string.
QgsLayoutSize operator/=(double v)
Divides the width and height by a scalar value.
QSizeF toQSizeF() const
Converts the layout size to a QSizeF.
bool qgsDoubleNear(double a, double b, double epsilon=4 *std::numeric_limits< double >::epsilon())
Compare two doubles (but allow some difference)
QgsLayoutSize(double width, double height, QgsUnitTypes::LayoutUnit units=QgsUnitTypes::LayoutMillimeters)
Constructor for QgsLayoutSize.
QgsLayoutSize operator*(double v) const
Multiplies the width and height by a scalar value.
QgsLayoutSize operator/(double v) const
Divides the width and height by a scalar value.
double height() const
Returns the height of the size.
This class provides a method of storing sizes, consisting of a width and height, for use in QGIS layo...
QgsLayoutSize operator*=(double v)
Multiplies the width and height by a scalar value.
static Q_INVOKABLE QgsUnitTypes::LayoutUnit decodeLayoutUnit(const QString &string, bool *ok=nullptr)
Decodes a layout unit from a string.
bool operator!=(const QgsLayoutSize &other) const