QGIS API Documentation
3.14.0-Pi (9f7028fd23)
|
Go to the documentation of this file.
23 QList< QgsUnitTypes::LayoutUnit > units;
33 const auto constUnits = units;
39 connect(
this,
static_cast<void (
QgsLayoutUnitsComboBox::* )(
int )
>( &QgsLayoutUnitsComboBox::currentIndexChanged ),
this, &QgsLayoutUnitsComboBox::indexChanged );
49 setCurrentIndex( findData(
unit ) );
54 mLinkedSpinBoxes << widget;
57 void QgsLayoutUnitsComboBox::indexChanged(
int )
62 const auto constMLinkedSpinBoxes = mLinkedSpinBoxes;
63 for (
const QPointer< QDoubleSpinBox > &widget : constMLinkedSpinBoxes )
QgsLayoutUnitsComboBox(QWidget *parent=nullptr)
Constructor for QgsLayoutUnitsComboBox.
void changed(QgsUnitTypes::LayoutUnit unit)
Emitted when the unit is changed.
double length() const
Returns the length of the measurement.
static Q_INVOKABLE QString toAbbreviatedString(QgsUnitTypes::DistanceUnit unit)
Returns a translated abbreviation representing a distance unit.
LayoutUnit
Layout measurement units.
@ LayoutCentimeters
Centimeters.
QgsLayoutMeasurement convert(QgsLayoutMeasurement measurement, QgsUnitTypes::LayoutUnit targetUnits) const
Converts a measurement from one unit to another.
void setConverter(QgsLayoutMeasurementConverter *converter)
Sets a converter to use when automatically converting units for linked widgets.
QgsLayoutMeasurementConverter * converter() const
Returns the converter used when automatically converting units for linked widgets.
QgsUnitTypes::LayoutUnit unit
QgsSignalBlocker< Object > whileBlocking(Object *object)
Temporarily blocks signals from a QObject while calling a single method from the object.
static Q_INVOKABLE QString toString(QgsUnitTypes::DistanceUnit unit)
Returns a translated string representing a distance unit.
@ LayoutPicas
Typographic picas.
This class provides a method of converting QgsLayoutMeasurements from one unit to another....
void setUnit(QgsUnitTypes::LayoutUnit unit)
Sets the unit currently selected in the combo box.
@ LayoutMillimeters
Millimeters.
void linkToWidget(QDoubleSpinBox *widget)
Registers a spin box widget as linked with the combo box.
@ LayoutPoints
Typographic points.
This class provides a method of storing measurements for use in QGIS layouts using a variety of diffe...