QGIS API Documentation 3.32.0-Lima (311a8cb8a6)
|
This class provides a method of storing measurements for use in QGIS layouts using a variety of different measurement units. More...
#include <qgslayoutmeasurement.h>
Public Member Functions | |
QgsLayoutMeasurement (double length, Qgis::LayoutUnit units=Qgis::LayoutUnit::Millimeters) | |
Constructor for QgsLayoutMeasurement. More... | |
QString | encodeMeasurement () const |
Encodes the layout measurement to a string. More... | |
double | length () const |
Returns the length of the measurement. More... | |
bool | operator!= (QgsLayoutMeasurement other) const |
QgsLayoutMeasurement | operator* (double v) const |
Multiplies the measurement by a scalar value. More... | |
QgsLayoutMeasurement | operator*= (double v) |
Multiplies the measurement by a scalar value. More... | |
QgsLayoutMeasurement | operator+ (double v) const |
Adds a scalar value to the measurement. More... | |
QgsLayoutMeasurement | operator+= (double v) |
Adds a scalar value to the measurement. More... | |
QgsLayoutMeasurement | operator- (double v) const |
Subtracts a scalar value from the measurement. More... | |
QgsLayoutMeasurement | operator-= (double v) |
Subtracts a scalar value from the measurement. More... | |
QgsLayoutMeasurement | operator/ (double v) const |
Divides the measurement by a scalar value. More... | |
QgsLayoutMeasurement | operator/= (double v) |
Divides the measurement by a scalar value. More... | |
bool | operator== (QgsLayoutMeasurement other) const |
void | setLength (const double length) |
Sets the length of the measurement. More... | |
void | setUnits (const Qgis::LayoutUnit units) |
Sets the units for the measurement. More... | |
Qgis::LayoutUnit | units () const |
Returns the units for the measurement. More... | |
Static Public Member Functions | |
static QgsLayoutMeasurement | decodeMeasurement (const QString &string) |
Decodes a measurement from a string. More... | |
This class provides a method of storing measurements for use in QGIS layouts using a variety of different measurement units.
Definition at line 33 of file qgslayoutmeasurement.h.
|
explicit |
Constructor for QgsLayoutMeasurement.
length | measurement length |
units | measurement units |
Definition at line 24 of file qgslayoutmeasurement.cpp.
|
static |
Decodes a measurement from a string.
Definition at line 35 of file qgslayoutmeasurement.cpp.
QString QgsLayoutMeasurement::encodeMeasurement | ( | ) | const |
Encodes the layout measurement to a string.
Definition at line 30 of file qgslayoutmeasurement.cpp.
|
inline |
Returns the length of the measurement.
Definition at line 48 of file qgslayoutmeasurement.h.
bool QgsLayoutMeasurement::operator!= | ( | QgsLayoutMeasurement | other | ) | const |
Definition at line 50 of file qgslayoutmeasurement.cpp.
QgsLayoutMeasurement QgsLayoutMeasurement::operator* | ( | double | v | ) | const |
Multiplies the measurement by a scalar value.
Definition at line 77 of file qgslayoutmeasurement.cpp.
QgsLayoutMeasurement QgsLayoutMeasurement::operator*= | ( | double | v | ) |
Multiplies the measurement by a scalar value.
Definition at line 82 of file qgslayoutmeasurement.cpp.
QgsLayoutMeasurement QgsLayoutMeasurement::operator+ | ( | double | v | ) | const |
Adds a scalar value to the measurement.
Definition at line 55 of file qgslayoutmeasurement.cpp.
QgsLayoutMeasurement QgsLayoutMeasurement::operator+= | ( | double | v | ) |
Adds a scalar value to the measurement.
Definition at line 60 of file qgslayoutmeasurement.cpp.
QgsLayoutMeasurement QgsLayoutMeasurement::operator- | ( | double | v | ) | const |
Subtracts a scalar value from the measurement.
Definition at line 66 of file qgslayoutmeasurement.cpp.
QgsLayoutMeasurement QgsLayoutMeasurement::operator-= | ( | double | v | ) |
Subtracts a scalar value from the measurement.
Definition at line 71 of file qgslayoutmeasurement.cpp.
QgsLayoutMeasurement QgsLayoutMeasurement::operator/ | ( | double | v | ) | const |
Divides the measurement by a scalar value.
Definition at line 88 of file qgslayoutmeasurement.cpp.
QgsLayoutMeasurement QgsLayoutMeasurement::operator/= | ( | double | v | ) |
Divides the measurement by a scalar value.
Definition at line 93 of file qgslayoutmeasurement.cpp.
bool QgsLayoutMeasurement::operator== | ( | QgsLayoutMeasurement | other | ) | const |
Definition at line 45 of file qgslayoutmeasurement.cpp.
|
inline |
Sets the length of the measurement.
Definition at line 54 of file qgslayoutmeasurement.h.
|
inline |
Sets the units for the measurement.
Does not alter the stored length, ie. no length conversion is done.
Definition at line 67 of file qgslayoutmeasurement.h.
|
inline |
Returns the units for the measurement.
Definition at line 60 of file qgslayoutmeasurement.h.