QGIS API Documentation 3.41.0-Master (3440c17df1d)
Loading...
Searching...
No Matches
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 (int unit)
 Emitted when the unit is changed.
 
void unitChanged (Qgis::LayoutUnit unit)
 Emitted when the unit is changed.
 

Public Member Functions

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

Properties

Qgis::LayoutUnit unit
 

Detailed Description

A custom combo box for selecting units for layout settings.

Definition at line 32 of file qgslayoutunitscombobox.h.

Constructor & Destructor Documentation

◆ QgsLayoutUnitsComboBox()

QgsLayoutUnitsComboBox::QgsLayoutUnitsComboBox ( QWidget *  parent = nullptr)

Constructor for QgsLayoutUnitsComboBox.

Definition at line 22 of file qgslayoutunitscombobox.cpp.

Member Function Documentation

◆ changed

void QgsLayoutUnitsComboBox::changed ( int  unit)
signal

Emitted when the unit is changed.

◆ converter()

QgsLayoutMeasurementConverter * QgsLayoutUnitsComboBox::converter ( ) const

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

See also
setConverter()

Definition at line 76 of file qgslayoutunitscombobox.cpp.

◆ linkToWidget()

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 54 of file qgslayoutunitscombobox.cpp.

◆ setConverter()

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 81 of file qgslayoutunitscombobox.cpp.

◆ setUnit()

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

Sets the unit currently selected in the combo box.

See also
unit()

Definition at line 49 of file qgslayoutunitscombobox.cpp.

◆ unit()

Qgis::LayoutUnit QgsLayoutUnitsComboBox::unit ( ) const

Returns the unit currently selected in the combo box.

See also
setUnit()

Definition at line 44 of file qgslayoutunitscombobox.cpp.

◆ unitChanged

void QgsLayoutUnitsComboBox::unitChanged ( Qgis::LayoutUnit  unit)
signal

Emitted when the unit is changed.

Property Documentation

◆ unit

Qgis::LayoutUnit QgsLayoutUnitsComboBox::unit
readwrite

Definition at line 35 of file qgslayoutunitscombobox.h.


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