Class: QgsLayerItem

class qgis.core.QgsLayerItem

Bases: qgis._core.QgsDataItem

Item that represents a layer that can be opened with one of the providers

Methods

childEvent
comments Returns comments of the layer
connectNotify
customEvent
deferredDelete
deleteLayer Delete this layer item
disconnectNotify
equal
hasDragEnabled
iconDefault
iconLine
iconMesh Returns icon for mesh layer type
iconName Returns the icon name of the given layerType
iconPoint
iconPolygon
iconRaster
iconTable
isSignalConnected
layerName
return:the layer name
layerTypeAsString Returns the string representation of the given layerType
mapLayerType Returns QgsMapLayer.LayerType
mimeUri
populate
providerKey Returns provider key
receivers
refresh
sender
senderSignalIndex
supportedCrs Returns the supported CRS
supportedFormats Returns the supported formats
timerEvent
typeFromMapLayer Returns the layer item type corresponding to a QgsMapLayer layer.
updateIcon
uri Returns layer uri or empty string if layer cannot be created

Signals

Attributes

Database
Line
Mesh
NoType
Plugin
Point
Polygon
Raster
Table
TableLayer
Vector
Database = 7
class LayerType

Bases: int

baseClass

alias of QgsLayerItem

Line = 4
Mesh = 10
NoType = 0
Plugin = 9
Point = 3
Polygon = 5
Raster = 2
Table = 8
TableLayer = 6
Vector = 1
childEvent()
comments(self) → str

Returns comments of the layer

New in version 2.12.

connectNotify()
customEvent()
deferredDelete()
deleteLayer(self) → bool

Delete this layer item

disconnectNotify()
equal(self, other: QgsDataItem) → bool
hasDragEnabled(self) → bool
iconDefault() → QIcon
iconLine() → QIcon
iconMesh() → QIcon

Returns icon for mesh layer type

iconName(layerType: QgsLayerItem.LayerType) → str

Returns the icon name of the given layerType

New in version 3.

iconPoint() → QIcon
iconPolygon() → QIcon
iconRaster() → QIcon
iconTable() → QIcon
isSignalConnected()
layerName(self) → str
Returns:the layer name
layerTypeAsString(layerType: QgsLayerItem.LayerType) → str

Returns the string representation of the given layerType

New in version 3.

mapLayerType(self) → QgsMapLayer.LayerType

Returns QgsMapLayer.LayerType

mimeUri(self) → QgsMimeDataUtils.Uri
populate()
providerKey(self) → str

Returns provider key

receivers()
refresh()
sender()
senderSignalIndex()
supportedCrs(self) → List[str]

Returns the supported CRS

New in version 2.8.

supportedFormats(self) → List[str]

Returns the supported formats

New in version 2.8.

timerEvent()
typeFromMapLayer(layer: QgsMapLayer) → QgsLayerItem.LayerType

Returns the layer item type corresponding to a QgsMapLayer layer.

New in version 3.6.

updateIcon()
uri(self) → str

Returns layer uri or empty string if layer cannot be created