QGIS API Documentation 3.40.0-Bratislava (b56115d8743)
|
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. | |
QString | encodeMeasurement () const |
Encodes the layout measurement to a string. | |
double | length () const |
Returns the length of the measurement. | |
bool | operator!= (QgsLayoutMeasurement other) const |
QgsLayoutMeasurement | operator* (double v) const |
Multiplies the measurement by a scalar value. | |
QgsLayoutMeasurement | operator*= (double v) |
Multiplies the measurement by a scalar value. | |
QgsLayoutMeasurement | operator+ (double v) const |
Adds a scalar value to the measurement. | |
QgsLayoutMeasurement | operator+= (double v) |
Adds a scalar value to the measurement. | |
QgsLayoutMeasurement | operator- (double v) const |
Subtracts a scalar value from the measurement. | |
QgsLayoutMeasurement | operator-= (double v) |
Subtracts a scalar value from the measurement. | |
QgsLayoutMeasurement | operator/ (double v) const |
Divides the measurement by a scalar value. | |
QgsLayoutMeasurement | operator/= (double v) |
Divides the measurement by a scalar value. | |
bool | operator== (QgsLayoutMeasurement other) const |
void | setLength (const double length) |
Sets the length of the measurement. | |
void | setUnits (const Qgis::LayoutUnit units) |
Sets the units for the measurement. | |
Qgis::LayoutUnit | units () const |
Returns the units for the measurement. | |
Static Public Member Functions | |
static QgsLayoutMeasurement | decodeMeasurement (const QString &string) |
Decodes a measurement from a string. | |
This class provides a method of storing measurements for use in QGIS layouts using a variety of different measurement units.
Definition at line 32 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 47 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 53 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 66 of file qgslayoutmeasurement.h.
|
inline |
Returns the units for the measurement.
Definition at line 59 of file qgslayoutmeasurement.h.