Subgroup: Layout
Class: QgsLayoutMeasurementConverter¶
-
class
qgis.core.
QgsLayoutMeasurementConverter
¶ Bases:
sip.wrapper
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
New in version 3.0: Methods
convert
Converts a measurement from one unit to another. dpi
Returns the Dots per inch (DPI) of the measurement converter. setDpi
Sets the dots per inch ( dpi
) for the measurement converter.Attributes
-
convert
(self, measurement: QgsLayoutMeasurement, targetUnits: QgsUnitTypes.LayoutUnit) → QgsLayoutMeasurement¶ Converts a measurement from one unit to another.
Parameters: - measurement – measurement to convert
- targetUnits – 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
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
-