QGIS API Documentation  3.4.15-Madeira (e83d02e274)
Signals | Public Member Functions | Properties | List of all members
QgsLayoutUnitsComboBox Class Reference

A custom combo box for selecting units for layout settings. More...

#include <qgslayoutunitscombobox.h>

Inheritance diagram for QgsLayoutUnitsComboBox:
Inheritance graph
[legend]

Signals

void changed (QgsUnitTypes::LayoutUnit unit)
 Emitted when the unit is changed. More...
 

Public Member Functions

 QgsLayoutUnitsComboBox (QWidget *parent=nullptr)
 Constructor for QgsLayoutUnitsComboBox. More...
 
QgsLayoutMeasurementConverterconverter () const
 Returns the converter used when automatically converting units for linked widgets. More...
 
void linkToWidget (QDoubleSpinBox *widget)
 Registers a spin box widget as linked with the combo box. More...
 
void setConverter (QgsLayoutMeasurementConverter *converter)
 Sets a converter to use when automatically converting units for linked widgets. More...
 
void setUnit (QgsUnitTypes::LayoutUnit unit)
 Sets the unit currently selected in the combo box. More...
 
QgsUnitTypes::LayoutUnit unit () const
 Returns the unit currently selected in the combo box. More...
 

Properties

QgsUnitTypes::LayoutUnit unit
 

Detailed Description

A custom combo box for selecting units for layout settings.

Since
QGIS 3.0

Definition at line 33 of file qgslayoutunitscombobox.h.

Constructor & Destructor Documentation

QgsLayoutUnitsComboBox::QgsLayoutUnitsComboBox ( QWidget *  parent = nullptr)

Constructor for QgsLayoutUnitsComboBox.

Definition at line 19 of file qgslayoutunitscombobox.cpp.

Member Function Documentation

void QgsLayoutUnitsComboBox::changed ( QgsUnitTypes::LayoutUnit  unit)
signal

Emitted when the unit is changed.

QgsLayoutMeasurementConverter * QgsLayoutUnitsComboBox::converter ( ) const

Returns the converter used when automatically converting units for linked widgets.

See also
setConverter()

Definition at line 70 of file qgslayoutunitscombobox.cpp.

void QgsLayoutUnitsComboBox::linkToWidget ( QDoubleSpinBox *  widget)

Registers a spin box widget as linked with the combo box.

Registered spin boxes will automatically be upodated whenever the unit is changed. I.e. a spin box with a value of 100 will be set to 1 when the unit is changed from centimeters to meters.

A measurement converter() must be set in order for the automatic unit conversion to occur.

See also
setConverter()

Definition at line 50 of file qgslayoutunitscombobox.cpp.

void QgsLayoutUnitsComboBox::setConverter ( QgsLayoutMeasurementConverter converter)

Sets a converter to use when automatically converting units for linked widgets.

The ownership of converter is not transferred, and converter must exist for the life of the combo box.

See also
converter()

Definition at line 75 of file qgslayoutunitscombobox.cpp.

void QgsLayoutUnitsComboBox::setUnit ( QgsUnitTypes::LayoutUnit  unit)

Sets the unit currently selected in the combo box.

See also
unit()

Definition at line 45 of file qgslayoutunitscombobox.cpp.

QgsUnitTypes::LayoutUnit QgsLayoutUnitsComboBox::unit ( ) const

Returns the unit currently selected in the combo box.

See also
setUnit()

Property Documentation

QgsUnitTypes::LayoutUnit QgsLayoutUnitsComboBox::unit
readwrite

Definition at line 36 of file qgslayoutunitscombobox.h.


The documentation for this class was generated from the following files: