QGIS API Documentation 3.41.0-Master (3440c17df1d)
|
This class provides a method of converting QgsLayoutMeasurements from one unit to another. More...
#include <qgslayoutmeasurementconverter.h>
Public Member Functions | |
QgsLayoutMeasurementConverter ()=default | |
QgsLayoutPoint | convert (const QgsLayoutPoint &point, Qgis::LayoutUnit targetUnits) const |
Converts a layout point from one unit to another. | |
QgsLayoutSize | convert (const QgsLayoutSize &size, Qgis::LayoutUnit targetUnits) const |
Converts a layout size from one unit to another. | |
QgsLayoutMeasurement | convert (QgsLayoutMeasurement measurement, Qgis::LayoutUnit targetUnits) const |
Converts a measurement from one unit to another. | |
double | dpi () const |
Returns the Dots per inch (DPI) of the measurement converter. | |
void | setDpi (const double dpi) |
Sets the dots per inch (dpi) for the measurement converter. | |
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.
Definition at line 41 of file qgslayoutmeasurementconverter.h.
|
default |
QgsLayoutPoint QgsLayoutMeasurementConverter::convert | ( | const QgsLayoutPoint & | point, |
Qgis::LayoutUnit | targetUnits | ||
) | const |
Converts a layout point from one unit to another.
point | layout point to convert |
targetUnits | units to convert point into |
Definition at line 93 of file qgslayoutmeasurementconverter.cpp.
QgsLayoutSize QgsLayoutMeasurementConverter::convert | ( | const QgsLayoutSize & | size, |
Qgis::LayoutUnit | targetUnits | ||
) | const |
Converts a layout size from one unit to another.
size | layout size to convert |
targetUnits | units to convert size into |
Definition at line 52 of file qgslayoutmeasurementconverter.cpp.
QgsLayoutMeasurement QgsLayoutMeasurementConverter::convert | ( | QgsLayoutMeasurement | measurement, |
Qgis::LayoutUnit | targetUnits | ||
) | const |
Converts a measurement from one unit to another.
measurement | measurement to convert |
targetUnits | units to convert measurement into |
Definition at line 21 of file qgslayoutmeasurementconverter.cpp.
|
inline |
Returns the Dots per inch (DPI) of the measurement converter.
This is used when converting measurements to and from pixels.
Definition at line 59 of file qgslayoutmeasurementconverter.h.
|
inline |
Sets the dots per inch (dpi) for the measurement converter.
This is used when converting measurements to and from pixels.
Definition at line 52 of file qgslayoutmeasurementconverter.h.