Subgroup: Map
Class: QgsMapLayerComboBox¶
-
class
qgis.gui.
QgsMapLayerComboBox
(parent: QWidget = None)¶ Bases:
PyQt5.QtWidgets.QComboBox
QgsMapLayerComboBox creates a combo box to dislpay the list of layers (currently in the registry). The layers can be filtered and/or ordered.
The QgsMapLayerComboBox class is a combo box which displays the list of layersNew in version 2.3: Methods
actionEvent
additionalItems
Return the list of additional (non map layer) items included at the end of the combo box. allowEmptyLayer
Returns true if the combo box allows the empty layer (“not set”) choice. changeEvent
childEvent
closeEvent
connectNotify
contextMenuEvent
create
currentLayer
Returns the current layer selected in the combo box. customEvent
destroy
disconnectNotify
dragEnterEvent
dragLeaveEvent
dragMoveEvent
dropEvent
enterEvent
exceptedLayerList
returns the list of excepted layers excludedProviders
Returns the list of data providers which are excluded from the combobox. filters
currently used filter on list layers focusInEvent
focusNextChild
focusNextPrevChild
focusOutEvent
focusPreviousChild
hideEvent
indexChanged
initPainter
initStyleOption
inputMethodEvent
isSignalConnected
keyPressEvent
keyReleaseEvent
layer
Return the layer currently shown at the specified index within the combo box. leaveEvent
metric
mouseDoubleClickEvent
mouseMoveEvent
mousePressEvent
mouseReleaseEvent
moveEvent
nativeEvent
paintEvent
receivers
resizeEvent
rowsChanged
sender
senderSignalIndex
setAdditionalItems
Sets a list of additional (non map layer) items to include at the end of the combobox. setAllowEmptyLayer
Sets whether an optional empty layer (“not set”) option is shown in the combo box. setExceptedLayerList
except a list of layers not to be listed setExcludedProviders
Sets a list of data providers which should be excluded from the combobox. setFilters
setFilters allows fitering according to layer type and/or geometry type. setLayer
setLayer set the current layer selected in the combo setShowCrs
Sets whether the CRS of layers is also included in the combo box text. sharedPainter
showCrs
Returns true if the combo box shows the layer’s CRS. showEvent
tabletEvent
timerEvent
updateMicroFocus
wheelEvent
Signals
layerChanged
layerChanged this signal is emitted whenever the currently selected layer changes [signal] Attributes
-
actionEvent
()¶
-
additionalItems
(self) → List[str]¶ Return the list of additional (non map layer) items included at the end of the combo box.
See also
New in version 3.0.
-
allowEmptyLayer
(self) → bool¶ Returns true if the combo box allows the empty layer (“not set”) choice.
See also
New in version 3.0.
-
changeEvent
()¶
-
childEvent
()¶
-
closeEvent
()¶
-
connectNotify
()¶
-
contextMenuEvent
()¶
-
create
()¶
-
currentLayer
(self) → QgsMapLayer¶ Returns the current layer selected in the combo box.
See also
-
customEvent
()¶
-
destroy
()¶
-
disconnectNotify
()¶
-
dragEnterEvent
()¶
-
dragLeaveEvent
()¶
-
dragMoveEvent
()¶
-
dropEvent
()¶
-
enterEvent
()¶
-
exceptedLayerList
(self) → List[QgsMapLayer]¶ returns the list of excepted layers
-
excludedProviders
(self) → List[str]¶ Returns the list of data providers which are excluded from the combobox.
See also
New in version 3.0.
-
filters
(self) → QgsMapLayerProxyModel.Filters¶ currently used filter on list layers
-
focusInEvent
()¶
-
focusNextChild
()¶
-
focusNextPrevChild
()¶
-
focusOutEvent
()¶
-
focusPreviousChild
()¶
-
hideEvent
()¶
-
indexChanged
(self, i: int)¶
-
initPainter
()¶
-
initStyleOption
()¶
-
inputMethodEvent
()¶
-
isSignalConnected
()¶
-
keyPressEvent
()¶
-
keyReleaseEvent
()¶
-
layer
(self, layerIndex: int) → QgsMapLayer¶ Return the layer currently shown at the specified index within the combo box.
Parameters: layerIndex – position of layer to return New in version 2.10.
See also
-
layerChanged
¶ layerChanged this signal is emitted whenever the currently selected layer changes [signal]
-
leaveEvent
()¶
-
metric
()¶
-
mouseDoubleClickEvent
()¶
-
mouseMoveEvent
()¶
-
mousePressEvent
()¶
-
mouseReleaseEvent
()¶
-
moveEvent
()¶
-
nativeEvent
()¶
-
paintEvent
()¶
-
receivers
()¶
-
resizeEvent
()¶
-
rowsChanged
(self)¶
-
sender
()¶
-
senderSignalIndex
()¶
-
setAdditionalItems
(self, items: Iterable[str])¶ Sets a list of additional (non map layer) items to include at the end of the combobox. These may represent additional layers such as layers which are not included in the map layer registry, or paths to layers which have not yet been loaded into QGIS.
See also
New in version 3.0.
-
setAllowEmptyLayer
(self, allowEmpty: bool)¶ Sets whether an optional empty layer (“not set”) option is shown in the combo box.
See also
New in version 3.0.
-
setExceptedLayerList
(self, layerList: Iterable[QgsMapLayer])¶ except a list of layers not to be listed
-
setExcludedProviders
(self, providers: Iterable[str])¶ Sets a list of data providers which should be excluded from the combobox.
New in version 3.0.
See also
-
setFilters
(self, filters: Union[QgsMapLayerProxyModel.Filters, QgsMapLayerProxyModel.Filter])¶ setFilters allows fitering according to layer type and/or geometry type.
-
setLayer
(self, layer: QgsMapLayer)¶ setLayer set the current layer selected in the combo
-
setShowCrs
(self, showCrs: bool)¶ Sets whether the CRS of layers is also included in the combo box text.
See also
New in version 3.0.
-
showCrs
(self) → bool¶ Returns true if the combo box shows the layer’s CRS.
See also
New in version 3.0.
-
showEvent
()¶
-
tabletEvent
()¶
-
timerEvent
()¶
-
updateMicroFocus
()¶
-
wheelEvent
()¶
-