QGIS API Documentation
3.16.0-Hannover (43b64b13f3)
|
Go to the documentation of this file.
20 #include <QStringList>
35 QStringList parts =
string.split(
',' );
36 if ( parts.count() != 2 )
50 return ( !
operator==( other ) );
QgsLayoutMeasurement operator+=(double v)
Adds a scalar value to the measurement.
double length() const
Returns the length of the measurement.
LayoutUnit
Layout measurement units.
QString encodeMeasurement() const
Encodes the layout measurement to a string.
bool operator==(QgsLayoutMeasurement other) const
QgsLayoutMeasurement operator/=(double v)
Divides the measurement by a scalar value.
QgsLayoutMeasurement operator+(double v) const
Adds a scalar value to the measurement.
static Q_INVOKABLE QString encodeUnit(QgsUnitTypes::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)
QgsLayoutMeasurement operator-(double v) const
Subtracts a scalar value from the measurement.
QgsUnitTypes::LayoutUnit units() const
Returns the units for the measurement.
QgsLayoutMeasurement operator/(double v) const
Divides the measurement by a scalar value.
QgsLayoutMeasurement operator*=(double v)
Multiplies the measurement by a scalar value.
QgsLayoutMeasurement operator-=(double v)
Subtracts a scalar value from the measurement.
QgsLayoutMeasurement operator*(double v) const
Multiplies the measurement by a scalar value.
static Q_INVOKABLE QgsUnitTypes::LayoutUnit decodeLayoutUnit(const QString &string, bool *ok=nullptr)
Decodes a layout unit from a string.
QgsLayoutMeasurement(double length, QgsUnitTypes::LayoutUnit units=QgsUnitTypes::LayoutMillimeters)
Constructor for QgsLayoutMeasurement.
This class provides a method of storing measurements for use in QGIS layouts using a variety of diffe...
bool operator!=(QgsLayoutMeasurement other) const
static QgsLayoutMeasurement decodeMeasurement(const QString &string)
Decodes a measurement from a string.