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