29  Q_ASSERT_X( !std::isnan( 
width ) && !std::isnan( 
height ), 
"QgsLayoutSize", 
"Layout size with NaN dimensions created" );
 
 
   34  : mWidth( size.width() )
 
   35  , mHeight( size.height() )
 
 
   53  return QSizeF( mWidth, mHeight );
 
 
   63  QStringList parts = 
string.split( 
',' );
 
   64  if ( parts.count() != 3 )
 
   69  const double width = parts[0].toDouble();
 
   70  const double height = parts[1].toDouble();
 
 
   84  return ( ! 
operator==( other ) );
 
 
LayoutUnit
Layout measurement units.
 
Provides a method of storing sizes, consisting of a width and height, for use in QGIS layouts.
 
static QgsLayoutSize decodeSize(const QString &string)
Decodes a size from a string.
 
double height() const
Returns the height of the size.
 
bool operator==(const QgsLayoutSize &other) const
 
QgsLayoutSize operator/=(double v)
Divides the width and height by a scalar value.
 
Qgis::LayoutUnit units() const
Returns the units for the size.
 
double width() const
Returns the width of the size.
 
bool operator!=(const QgsLayoutSize &other) const
 
QgsLayoutSize operator/(double v) const
Divides the width and height by a scalar value.
 
QString encodeSize() const
Encodes the layout size to a string.
 
bool isEmpty() const
Tests whether the size is empty, ie both its width and height are zero.
 
QgsLayoutSize operator*=(double v)
Multiplies the width and height by a scalar value.
 
QgsLayoutSize(double width, double height, Qgis::LayoutUnit units=Qgis::LayoutUnit::Millimeters)
Constructor for QgsLayoutSize.
 
QSizeF toQSizeF() const
Converts the layout size to a QSizeF.
 
QgsLayoutSize operator*(double v) const
Multiplies the width and height by a scalar value.
 
static Q_INVOKABLE Qgis::LayoutUnit decodeLayoutUnit(const QString &string, bool *ok=nullptr)
Decodes a layout unit from a string.
 
static Q_INVOKABLE QString encodeUnit(Qgis::DistanceUnit unit)
Encodes a distance unit to a string.
 
bool qgsDoubleNear(double a, double b, double epsilon=4 *std::numeric_limits< double >::epsilon())
Compare two doubles (but allow some difference)