Class: QgsLayoutMeasurement¶
-
class
qgis.core.
QgsLayoutMeasurement
(length: float, units: QgsUnitTypes.LayoutUnit = QgsUnitTypes.LayoutMillimeters)¶ Bases:
sip.wrapper
Constructor for QgsLayoutMeasurement.
- Parameters
length – measurement length
units – measurement units
QgsLayoutMeasurement(QgsLayoutMeasurement)
This class provides a method of storing measurements for use in QGIS layouts using a variety of different measurement units.
See also
New in version 3.0: Enums
Methods
Decodes a measurement from a
string
.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.
Signals
Attributes
-
decodeMeasurement
(string: str) → QgsLayoutMeasurement¶ Decodes a measurement from a
string
.See also
-
encodeMeasurement
(self) → str¶ Encodes the layout measurement to a string
See also
-
length
(self) → float¶ Returns the length of the measurement.
See also
-
setUnits
(self, units: QgsUnitTypes.LayoutUnit)¶ Sets the
units
for the measurement. Does not alter the stored length, ie. no length conversion is done.See also
-
units
(self) → QgsUnitTypes.LayoutUnit¶ Returns the units for the measurement.
See also