Class: QgsCalloutWidget

Base class for widgets which allow control over the properties of callouts.

Added in version 3.10.

Class Hierarchy

Inheritance diagram of qgis.gui.QgsCalloutWidget

Base classes

QWidget

QObject

QPaintDevice

Methods

callout

Returns the callout defined by the current settings in the widget.

context

Returns the context in which the symbol widget is shown, e.g., the associated map canvas and expression contexts.

createExpressionContext

layer

Returns the vector layer associated with the widget.

registerDataDefinedButton

Registers a data defined override button.

setCallout

Sets the callout to show in the widget.

setContext

Sets the context in which the symbol widget is shown, e.g., the associated map canvas and expression contexts.

setGeometryType

Sets the geometry type of the features to customize the widget accordingly.

vectorLayer

Returns the vector layer associated with the widget.

Signals

changed

Should be emitted whenever configuration changes happened on this symbol layer configuration.

class qgis.gui.QgsCalloutWidget[source]

Bases: QWidget

__init__(parent: QWidget | None, vl: QgsMapLayer | None = None)

Constructor for QgsCalloutWidget.

Parameters:
  • vl (Optional[QgsMapLayer] = None) – associated map layer

  • parent (Optional[QWidget]) – parent widget

callout(self) QgsCallout | None[source]

Returns the callout defined by the current settings in the widget. Ownership is not transferred, and the caller should clone the returned value.

See also

setCallout()

Return type:

Optional[QgsCallout]

signal changed[source]

Should be emitted whenever configuration changes happened on this symbol layer configuration. If the subsymbol is changed, symbolChanged() should be emitted instead.

context(self) QgsSymbolWidgetContext[source]

Returns the context in which the symbol widget is shown, e.g., the associated map canvas and expression contexts.

See also

setContext()

Return type:

QgsSymbolWidgetContext

createExpressionContext(self) QgsExpressionContext[source]
Return type:

QgsExpressionContext

layer(self) QgsMapLayer | None[source]

Returns the vector layer associated with the widget.

Added in version 3.40.

Return type:

Optional[QgsMapLayer]

registerDataDefinedButton(self, button: QgsPropertyOverrideButton | None, key: QgsCallout.Property)[source]

Registers a data defined override button. Handles setting up connections for the button and initializing the button to show the correct descriptions and help text for the associated property.

Parameters:
setCallout(self, callout: QgsCallout | None)[source]

Sets the callout to show in the widget. Ownership is not transferred.

See also

callout()

Parameters:

callout (Optional[QgsCallout])

setContext(self, context: QgsSymbolWidgetContext)[source]

Sets the context in which the symbol widget is shown, e.g., the associated map canvas and expression contexts.

Parameters:

context (QgsSymbolWidgetContext) – symbol widget context

See also

context()

setGeometryType(self, type: Qgis.GeometryType)[source]

Sets the geometry type of the features to customize the widget accordingly.

Parameters:

type (Qgis.GeometryType)

vectorLayer(self) QgsVectorLayer | None[source]

Returns the vector layer associated with the widget.

Deprecated since version 3.40: Use layer() instead.

Return type:

Optional[QgsVectorLayer]