Class: QgsLayoutMeasurement¶
Provides a method of storing measurements for use in QGIS layouts using a variety of different measurement units.
See also
Methods
Encodes the layout measurement to a string |
|
Returns the length of the measurement. |
|
Sets the length of the measurement. |
|
Sets the units for the measurement. |
|
Returns the units for the measurement. |
Static Methods
Decodes a measurement from a string. |
- class qgis.core.QgsLayoutMeasurement[source]¶
Bases:
object
- __init__(length: float, units: Qgis.LayoutUnit = Qgis.LayoutUnit.Millimeters)
Constructor for QgsLayoutMeasurement.
- Parameters:
length (float) – measurement length
units (Qgis.LayoutUnit = Qgis.LayoutUnit.Millimeters) – measurement units
- __init__(a0: QgsLayoutMeasurement)
- Parameters:
a0 (QgsLayoutMeasurement)
- static decodeMeasurement(string: str | None) QgsLayoutMeasurement [source]¶
Decodes a measurement from a
string
.See also
- Parameters:
string (Optional[str])
- Return type:
- encodeMeasurement(self) str [source]¶
Encodes the layout measurement to a string
See also
- Return type:
str
- setLength(self, length: float)[source]¶
Sets the
length
of the measurement.See also
- Parameters:
length (float)
- setUnits(self, units: Qgis.LayoutUnit)[source]¶
Sets the
units
for the measurement. Does not alter the stored length, ie. no length conversion is done.See also
- Parameters:
units (Qgis.LayoutUnit)
- units(self) Qgis.LayoutUnit [source]¶
Returns the units for the measurement.
See also
- Return type: