Class: QgsLayoutMeasurementConverter¶
-
class
qgis.core.
QgsLayoutMeasurementConverter
¶ Bases:
sip.wrapper
Constructor for QgsLayoutMeasurementConverter.
QgsLayoutMeasurementConverter(
QgsLayoutMeasurementConverter
)This class provides a method of converting
QgsLayoutMeasurements
from one unit to another. Conversion to or from pixel units utilizes a specified dots per inch (DPI) property for the converter. Converters default to using 300 DPI.See also
Methods
Converts a measurement from one unit to another.
Returns the Dots per inch (DPI) of the measurement converter.
Sets the dots per inch (
dpi
) for the measurement converter.-
convert
(self, measurement: QgsLayoutMeasurement, targetUnits: QgsUnitTypes.LayoutUnit) → QgsLayoutMeasurement¶ Converts a measurement from one unit to another.
- Parameters
measurement (QgsLayoutMeasurement) – measurement to convert
targetUnits (QgsUnitTypes.LayoutUnit) – units to convert measurement into
- Returns
measurement converted to target units
convert(self, size:
QgsLayoutSize
, targetUnits: QgsUnitTypes.LayoutUnit) -> QgsLayoutSize Converts a layout size from one unit to another.- Parameters
size – layout size to convert
targetUnits – units to convert size into
- Returns
size converted to target units
convert(self, point:
QgsLayoutPoint
, targetUnits: QgsUnitTypes.LayoutUnit) -> QgsLayoutPoint Converts a layout point from one unit to another.- Parameters
point – layout point to convert
targetUnits – units to convert point into
- Return type
- Returns
point converted to target units
-
dpi
(self) → float¶ Returns the Dots per inch (DPI) of the measurement converter. This is used when converting measurements to and from pixels.
See also
- Return type
float
-