Subgroup: other
Class: QgsUnitSelectionWidget¶
-
class
qgis.gui.
QgsUnitSelectionWidget
(parent: QWidget = None)¶ Bases:
PyQt5.QtWidgets.QWidget
Constructor for QgsUnitSelectionWidget.
Parameters: parent – parent widget 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
See also
Methods
actionEvent
changeEvent
childEvent
closeEvent
connectNotify
contextMenuEvent
create
customEvent
destroy
disconnectNotify
dragEnterEvent
dragLeaveEvent
dragMoveEvent
dropEvent
enterEvent
event
focusInEvent
focusNextChild
focusNextPrevChild
focusOutEvent
focusPreviousChild
getMapUnitScale
Returns the map unit scale getUnit
Gets the selected unit index hideEvent
initPainter
inputMethodEvent
isSignalConnected
keyPressEvent
keyReleaseEvent
leaveEvent
metric
mouseDoubleClickEvent
mouseMoveEvent
mousePressEvent
mouseReleaseEvent
moveEvent
nativeEvent
paintEvent
receivers
resizeEvent
sender
senderSignalIndex
setMapCanvas
Sets the map canvas associated with the widget. setMapUnitScale
Sets the map unit scale setUnit
Sets the selected unit setUnitIndex
Sets the selected unit index setUnits
Sets the units which the user can choose from in the combobox. sharedPainter
showEvent
tabletEvent
timerEvent
unit
Returns the current predefined selected unit (if applicable). updateMicroFocus
wheelEvent
Signals
changed
changed(self) [signal] Attributes
-
actionEvent
()¶
-
changeEvent
()¶
-
changed
¶ changed(self) [signal]
-
childEvent
()¶
-
closeEvent
()¶
-
connectNotify
()¶
-
contextMenuEvent
()¶
-
create
()¶
-
customEvent
()¶
-
destroy
()¶
-
disconnectNotify
()¶
-
dragEnterEvent
()¶
-
dragLeaveEvent
()¶
-
dragMoveEvent
()¶
-
dropEvent
()¶
-
enterEvent
()¶
-
event
()¶
-
focusInEvent
()¶
-
focusNextChild
()¶
-
focusNextPrevChild
()¶
-
focusOutEvent
()¶
-
focusPreviousChild
()¶
-
getMapUnitScale
(self) → QgsMapUnitScale¶ Returns the map unit scale
-
getUnit
(self) → int¶ Gets the selected unit index
-
hideEvent
()¶
-
initPainter
()¶
-
inputMethodEvent
()¶
-
isSignalConnected
()¶
-
keyPressEvent
()¶
-
keyReleaseEvent
()¶
-
leaveEvent
()¶
-
metric
()¶
-
mouseDoubleClickEvent
()¶
-
mouseMoveEvent
()¶
-
mousePressEvent
()¶
-
mouseReleaseEvent
()¶
-
moveEvent
()¶
-
nativeEvent
()¶
-
paintEvent
()¶
-
receivers
()¶
-
resizeEvent
()¶
-
sender
()¶
-
senderSignalIndex
()¶
-
setMapCanvas
(self, canvas: QgsMapCanvas)¶ Sets the map canvas associated with the widget. This allows the widget to retrieve the current map scale from the canvas.
Parameters: canvas – map canvas New in version 2.12.
-
setMapUnitScale
(self, scale: QgsMapUnitScale)¶ Sets the map unit scale
-
setUnit
(self, unit: QgsUnitTypes.RenderUnit)¶ Sets the selected unit
Parameters: unit – predefined unit to set as current
-
setUnitIndex
(self, unitIndex: int)¶ Sets the selected unit index
Parameters: unitIndex – index of unit to set as current Note
available in Python bindings as setUnitIndex
-
setUnits
(self, units: Iterable[str], mapUnitIdx: int)¶ 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
setUnits(self, units: object) Sets the units which the user can choose from in the combobox. Clears any existing units.
Parameters: units – list of valid units New in version 2.9.
-
showEvent
()¶
-
tabletEvent
()¶
-
timerEvent
()¶
-
unit
(self) → QgsUnitTypes.RenderUnit¶ Returns the current predefined selected unit (if applicable).
Returns: selected output unit, or QgsUnitTypes.RenderUnknownUnit if the widget was populated with custom unit types New in version 2.9.
-
updateMicroFocus
()¶
-
wheelEvent
()¶
-