Class: QgsCalloutWidget¶
Base class for widgets which allow control over the properties of callouts.
Added in version 3.10.
Note
This is an abstract class, with methods which must be implemented by a subclass.
The following methods must be implemented: callout()
, setCallout()
, setGeometryType()
Class Hierarchy¶
Base classes¶
Abstract Methods
Returns the callout defined by the current settings in the widget. |
|
Sets the callout to show in the widget. |
|
Sets the geometry type of the features to customize the widget accordingly. |
Methods
Returns the context in which the symbol widget is shown, e.g., the associated map canvas and expression contexts. |
|
Returns the vector layer associated with the widget. |
|
Registers a data defined override button. |
|
Returns the vector layer associated with the widget. |
Virtual Methods
In PyQGIS, only methods marked as virtual
can be safely overridden in a Python subclass of QgsCalloutWidget. See the FAQ for more details.
Sets the context in which the symbol widget is shown, e.g., the associated map canvas and expression contexts. |
Signals
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
- abstract 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
- 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
- Return type:
- virtual createExpressionContext(self) QgsExpressionContext [source]¶
- Return type:
- 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:
button (Optional[QgsPropertyOverrideButton])
key (QgsCallout.Property)
- abstract setCallout(self, callout: QgsCallout | None)[source]¶
Sets the
callout
to show in the widget. Ownership is not transferred.See also
- Parameters:
callout (Optional[QgsCallout])
- virtual 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
- abstract 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]