20 #include <QStringList> 35 QStringList parts =
string.split(
',' );
36 if ( parts.count() != 2 )
50 return ( !
operator==( other ) );
QgsUnitTypes::LayoutUnit units() const
Returns the units for the measurement.
QgsLayoutMeasurement operator/(double v) const
Divides the measurement by a scalar value.
bool qgsDoubleNear(double a, double b, double epsilon=4 *std::numeric_limits< double >::epsilon())
Compare two doubles (but allow some difference)
QgsLayoutMeasurement operator*=(double v)
Multiplies the measurement by a scalar value.
QgsLayoutMeasurement operator-=(double v)
Subtracts a scalar value from the measurement.
QgsLayoutMeasurement(double length, QgsUnitTypes::LayoutUnit units=QgsUnitTypes::LayoutMillimeters)
Constructor for QgsLayoutMeasurement.
bool operator!=(QgsLayoutMeasurement other) const
This class provides a method of storing measurements for use in QGIS layouts using a variety of diffe...
static Q_INVOKABLE QgsUnitTypes::LayoutUnit decodeLayoutUnit(const QString &string, bool *ok=nullptr)
Decodes a layout unit from a string.
QgsLayoutMeasurement operator*(double v) const
Multiplies the measurement by a scalar value.
static Q_INVOKABLE QString encodeUnit(QgsUnitTypes::DistanceUnit unit)
Encodes a distance unit to a string.
QgsLayoutMeasurement operator+=(double v)
Adds a scalar value to the measurement.
static QgsLayoutMeasurement decodeMeasurement(const QString &string)
Decodes a measurement from a string.
double length() const
Returns the length of the measurement.
QgsLayoutMeasurement operator/=(double v)
Divides the measurement by a scalar value.
LayoutUnit
Layout measurement units.
QgsLayoutMeasurement operator+(double v) const
Adds a scalar value to the measurement.
bool operator==(QgsLayoutMeasurement other) const
QString encodeMeasurement() const
Encodes the layout measurement to a string.
QgsLayoutMeasurement operator-(double v) const
Subtracts a scalar value from the measurement.