Class: QgsMapLayerProxyModel¶
-
class
qgis.core.
QgsMapLayerProxyModel
(parent: QObject = None)¶ Bases:
PyQt5.QtCore.QSortFilterProxyModel
QgsMapLayerProxModel creates a proxy model with a QgsMapLayerModel as source model. It can be used to filter the layers list in a widget.
The QgsMapLayerProxyModel class provides an easy to use model to display the list of layers in widgets.
New in version 2.3: Enums
Methods
Returns the blacklist of layer IDs which are excluded from the model.
Returns the blacklist of layers which are excluded from the model.
Returns the blacklist of data providers which are excluded from the model.
Returns the current filter string, if set.
Returns the filter flags which affect how layers are filtered within the model.
Returns the list of layers which are excluded from the model.
Sets a blacklist of layers (by layer ID) to exclude from the model.
Sets a blacklist of layers to exclude from the model.
Sets a blacklist of data providers which should be excluded from the model.
Sets a
filter
string, such that only layers with names matching the specified string will be shown.Sets
filter
flags which affect how layers are filtered within the model.Sets a whitelist of
layers
to include within the model.layerModel returns the QgsMapLayerModel used in this QSortFilterProxyModel
Signals
Attributes
-
All
= 191¶
-
class
Filter
¶ Bases:
int
-
class
Filters
¶ Bases:
sip.wrapper
QgsMapLayerProxyModel.Filters(Union[QgsMapLayerProxyModel.Filters, QgsMapLayerProxyModel.Filter]) QgsMapLayerProxyModel.Filters(QgsMapLayerProxyModel.Filters)
-
baseClass
¶ alias of
QgsMapLayerProxyModel
-
-
HasGeometry
= 28¶
-
LineLayer
= 8¶
-
MeshLayer
= 128¶
-
NoGeometry
= 2¶
-
PluginLayer
= 32¶
-
PointLayer
= 4¶
-
PolygonLayer
= 16¶
-
RasterLayer
= 1¶
-
VectorLayer
= 30¶
-
WritableLayer
= 64¶
-
beginInsertColumns
()¶
-
beginInsertRows
()¶
-
beginMoveColumns
()¶
-
beginMoveRows
()¶
-
beginRemoveColumns
()¶
-
beginRemoveRows
()¶
-
beginResetModel
()¶
-
changePersistentIndex
()¶
-
changePersistentIndexList
()¶
-
childEvent
()¶
-
connectNotify
()¶
-
createIndex
()¶
-
customEvent
()¶
-
decodeData
()¶
-
disconnectNotify
()¶
-
encodeData
()¶
-
endInsertColumns
()¶
-
endInsertRows
()¶
-
endMoveColumns
()¶
-
endMoveRows
()¶
-
endRemoveColumns
()¶
-
endRemoveRows
()¶
-
endResetModel
()¶
-
exceptedLayerIds
(self) → List[str]¶ Returns the blacklist of layer IDs which are excluded from the model.
See also
See also
-
exceptedLayerList
(self) → List[QgsMapLayer]¶ Returns the blacklist of layers which are excluded from the model.
See also
See also
See also
-
excludedProviders
(self) → List[str]¶ Returns the blacklist of data providers which are excluded from the model.
See also
New in version 3.0.
-
filterAcceptsColumn
()¶
-
filterAcceptsRow
(self, source_row: int, source_parent: QModelIndex) → bool¶
-
filterString
(self) → str¶ Returns the current filter string, if set.
See also
New in version 3.4.
-
filters
(self) → QgsMapLayerProxyModel.Filters¶ Returns the filter flags which affect how layers are filtered within the model.
See also
New in version 2.3.
-
invalidateFilter
()¶
-
isSignalConnected
()¶
-
layerWhitelist
(self) → List[QgsMapLayer]¶ Returns the list of layers which are excluded from the model.
An empty list indicates that no whitelisting should be performed.
See also
See also
New in version 3.4.
-
lessThan
(self, left: QModelIndex, right: QModelIndex) → bool¶
-
persistentIndexList
()¶
-
receivers
()¶
-
resetInternalData
()¶
-
sender
()¶
-
senderSignalIndex
()¶
-
setExceptedLayerIds
(self, ids: Iterable[str])¶ Sets a blacklist of layers (by layer ID) to exclude from the model.
See also
See also
-
setExceptedLayerList
(self, exceptList: Iterable[QgsMapLayer])¶ Sets a blacklist of layers to exclude from the model.
See also
See also
See also
-
setExcludedProviders
(self, providers: Iterable[str])¶ Sets a blacklist of data providers which should be excluded from the model.
See also
New in version 3.0.
-
setFilterString
(self, filter: str)¶ Sets a
filter
string, such that only layers with names matching the specified string will be shown.See also
New in version 3.4.
-
setFilters
(self, filters: Union[QgsMapLayerProxyModel.Filters, QgsMapLayerProxyModel.Filter]) → QgsMapLayerProxyModel¶ Sets
filter
flags which affect how layers are filtered within the model.See also
New in version 2.3.
-
setLayerWhitelist
(self, layers: Iterable[QgsMapLayer])¶ Sets a whitelist of
layers
to include within the model. Only layers from this list will be shown.An empty list indicates that no whitelisting should be performed.
See also
See also
New in version 3.4.
-
sourceLayerModel
(self) → QgsMapLayerModel¶ layerModel returns the QgsMapLayerModel used in this QSortFilterProxyModel
-
timerEvent
()¶
-