A widget displaying a combobox allowing the user to choose between various display units, such as millimeters or map unit.
More...
#include <qgsunitselectionwidget.h>
A widget displaying a combobox allowing the user to choose between various display units, such as millimeters or map unit.
If the user chooses map units, a button appears allowing adjustment of minimum and maximum scaling.
- See also
- QgsMapUnitScaleWidget
-
QgsMapUnitScaleDialog
Definition at line 165 of file qgsunitselectionwidget.h.
◆ QgsUnitSelectionWidget()
QgsUnitSelectionWidget::QgsUnitSelectionWidget |
( |
QWidget * |
parent = nullptr | ) |
|
◆ changed
void QgsUnitSelectionWidget::changed |
( |
| ) |
|
|
signal |
◆ getMapUnitScale()
◆ getUnit()
int QgsUnitSelectionWidget::getUnit |
( |
| ) |
const |
|
inline |
◆ setMapCanvas()
void QgsUnitSelectionWidget::setMapCanvas |
( |
QgsMapCanvas * |
canvas | ) |
|
Sets the map canvas associated with the widget.
This allows the widget to retrieve the current map scale from the canvas.
- Parameters
-
- Since
- QGIS 2.12
Definition at line 219 of file qgsunitselectionwidget.cpp.
◆ setMapUnitScale()
void QgsUnitSelectionWidget::setMapUnitScale |
( |
const QgsMapUnitScale & |
scale | ) |
|
|
inline |
◆ setShowMapScaleButton()
void QgsUnitSelectionWidget::setShowMapScaleButton |
( |
bool |
show | ) |
|
◆ setUnit() [1/2]
void QgsUnitSelectionWidget::setUnit |
( |
int |
unitIndex | ) |
|
Sets the selected unit index.
- Parameters
-
unitIndex | index of unit to set as current |
- Note
- available in Python bindings as setUnitIndex
Definition at line 206 of file qgsunitselectionwidget.cpp.
◆ setUnit() [2/2]
◆ setUnits() [1/2]
Sets the units which the user can choose from in the combobox.
Clears any existing units.
- Parameters
-
- Since
- QGIS 2.9
Definition at line 152 of file qgsunitselectionwidget.cpp.
◆ setUnits() [2/2]
void QgsUnitSelectionWidget::setUnits |
( |
const QStringList & |
units, |
|
|
int |
mapUnitIdx |
|
) |
| |
Sets the units which the user can choose from in the combobox.
- Parameters
-
units | list of strings for custom units to display in the widget |
mapUnitIdx | specifies which entry corresponds to the map units, or -1 if none |
Definition at line 144 of file qgsunitselectionwidget.cpp.
◆ showMapScaleButton()
bool QgsUnitSelectionWidget::showMapScaleButton |
( |
| ) |
const |
◆ unit()
The documentation for this class was generated from the following files: