Class: QgsVectorLayerSelectionProperties

Implementation of layer selection properties for vector layers.

Added in version 3.34.

Class Hierarchy

Inheritance diagram of qgis.core.QgsVectorLayerSelectionProperties

Base classes

QgsMapLayerSelectionProperties

Base class for storage of map layer selection properties.

QObject

Methods

selectionColor

Returns the color to use for rendering selected features in the layer.

selectionRenderingMode

Returns the selection rendering mode to use for selected features in the layer.

selectionSymbol

Returns the symbol used to render selected features in the layer.

setSelectionColor

Sets the color to use for rendering selected features in the layer.

setSelectionRenderingMode

Sets the selection rendering mode to use for selected features in the layer.

setSelectionSymbol

Sets the symbol used to render selected features in the layer.

class qgis.core.QgsVectorLayerSelectionProperties[source]

Bases: QgsMapLayerSelectionProperties

__init__(parent: QObject | None = None)

Constructor for QgsVectorLayerSelectionProperties, with the specified parent object.

Parameters:

parent (Optional[QObject] = None)

selectionColor(self) QColor[source]

Returns the color to use for rendering selected features in the layer.

An invalid color indicates that the default (i.e. project level) selection color should be used instead.

Return type:

QColor

selectionRenderingMode(self) Qgis.SelectionRenderingMode[source]

Returns the selection rendering mode to use for selected features in the layer.

Return type:

Qgis.SelectionRenderingMode

selectionSymbol(self) QgsSymbol | None[source]

Returns the symbol used to render selected features in the layer.

May be None if the default symbol should be used instead.

Return type:

Optional[QgsSymbol]

setSelectionColor(self, color: QColor | Qt.GlobalColor)[source]

Sets the color to use for rendering selected features in the layer.

An invalid color indicates that the default (i.e. project level) selection color should be used instead.

See also

selectionColor()

Parameters:

color (Union[QColor, Qt.GlobalColor])

setSelectionRenderingMode(self, mode: Qgis.SelectionRenderingMode)[source]

Sets the selection rendering mode to use for selected features in the layer.

Parameters:

mode (Qgis.SelectionRenderingMode)

setSelectionSymbol(self, symbol: QgsSymbol | None)[source]

Sets the symbol used to render selected features in the layer.

Ownership of symbol is transferred to the plot. If symbol is None then the default symbol will be used instead.

Parameters:

symbol (Optional[QgsSymbol])