Class: QgsSimpleLineCallout¶
A simple direct line callout style.
Added in version 3.10.
Class Hierarchy¶
Base classes¶
Abstract base class for callout renderers.  | 
Subclasses¶
Draws curved lines as callouts.  | 
|
Draws straight (right angled) lines as callouts.  | 
Methods
Creates a callout line between start and end in the desired style.  | 
|
Returns   | 
|
Returns the line symbol used to render the callout line.  | 
|
Returns the minimum length of callout lines.  | 
|
Returns the map unit scale for the minimum callout length.  | 
|
Returns the units for the minimum length of callout lines.  | 
|
Returns the offset distance from the anchor point at which to start the line.  | 
|
Returns the map unit scale for the offset from anchor.  | 
|
Returns the units for the offset from anchor point.  | 
|
Returns the offset distance from label area at which to end the line.  | 
|
Returns the map unit scale for the minimum callout length.  | 
|
Returns the units for the offset from label area.  | 
|
Sets whether callout lines should be drawn to all feature parts.  | 
|
Sets the line symbol used to render the callout line.  | 
|
Sets the minimum length of callout lines.  | 
|
Sets the map unit scale for the minimum callout length.  | 
|
Sets the unit for the minimum length of callout lines.  | 
|
Sets the offset distance from the anchor point at which to start the line.  | 
|
Sets the map unit scale for the offset from anchor.  | 
|
Sets the unit for the offset from anchor distance.  | 
|
Sets the offset distance from label area at which to end the line.  | 
|
Sets the map unit scale for the offset from label area.  | 
|
Sets the unit for the offset from label area distance.  | 
Static Methods
Creates a new   | 
- class qgis.core.QgsSimpleLineCallout[source]¶
 Bases:
QgsCallout- static create(properties: Dict[str, Any] = {}, context: QgsReadWriteContext = QgsReadWriteContext()) QgsCallout | None[source]¶
 Creates a new
QgsSimpleLineCallout, using the settings serialized in thepropertiesmap (corresponding to the output fromQgsSimpleLineCallout.properties()).- Parameters:
 properties (Dict[str, Any] = {})
context (
QgsReadWriteContext= QgsReadWriteContext())
- Return type:
 Optional[QgsCallout]
- createCalloutLine(self, start: QgsPoint, end: QgsPoint, context: QgsRenderContext, bodyBoundingBox: QRectF, angle: float, anchor: QgsGeometry, calloutContext: QgsCallout.QgsCalloutContext) QgsCurve | None[source]¶
 Creates a callout line between
startandendin the desired style.The base class method returns a straight line.
Added in version 3.20.
- Parameters:
 start (QgsPoint)
end (QgsPoint)
context (QgsRenderContext)
bodyBoundingBox (QRectF)
angle (float)
anchor (QgsGeometry)
calloutContext (QgsCallout.QgsCalloutContext)
- Return type:
 Optional[QgsCurve]
- drawCalloutToAllParts(self) bool[source]¶
 Returns
Trueif callout lines should be drawn to all feature parts.See also
- Return type:
 bool
- lineSymbol(self) QgsLineSymbol | None[source]¶
 Returns the line symbol used to render the callout line.
Ownership is not transferred.
See also
- Return type:
 Optional[QgsLineSymbol]
- minimumLength(self) float[source]¶
 Returns the minimum length of callout lines. Units are specified through
minimumLengthUnits().See also
See also
- Return type:
 float
- minimumLengthMapUnitScale(self) QgsMapUnitScale¶
 Returns the map unit scale for the minimum callout length.
See also
See also
See also
- Return type:
 
- minimumLengthUnit(self) Qgis.RenderUnit[source]¶
 Returns the units for the minimum length of callout lines.
See also
See also
- Return type:
 
- offsetFromAnchor(self) float[source]¶
 Returns the offset distance from the anchor point at which to start the line. Units are specified through
offsetFromAnchorUnit().See also
See also
- Return type:
 float
- offsetFromAnchorMapUnitScale(self) QgsMapUnitScale¶
 Returns the map unit scale for the offset from anchor.
See also
See also
See also
- Return type:
 
- offsetFromAnchorUnit(self) Qgis.RenderUnit[source]¶
 Returns the units for the offset from anchor point.
See also
See also
- Return type:
 
- offsetFromLabel(self) float[source]¶
 Returns the offset distance from label area at which to end the line. Units are specified through
offsetFromLabelUnit().See also
See also
- Return type:
 float
- offsetFromLabelMapUnitScale(self) QgsMapUnitScale¶
 Returns the map unit scale for the minimum callout length.
See also
See also
See also
- Return type:
 
- offsetFromLabelUnit(self) Qgis.RenderUnit[source]¶
 Returns the units for the offset from label area.
See also
See also
- Return type:
 
- setDrawCalloutToAllParts(self, drawToAllParts: bool)[source]¶
 Sets whether callout lines should be drawn to all feature parts.
See also
- Parameters:
 drawToAllParts (bool)
- setLineSymbol(self, symbol: QgsLineSymbol | None)[source]¶
 Sets the line
symbolused to render the callout line. Ownership ofsymbolis transferred to the callout.See also
- Parameters:
 symbol (Optional[QgsLineSymbol])
- setMinimumLength(self, length: float)[source]¶
 Sets the minimum
lengthof callout lines. Units are specified throughsetMinimumLengthUnit().See also
See also
- Parameters:
 length (float)
- setMinimumLengthMapUnitScale(self, scale: QgsMapUnitScale)[source]¶
 Sets the map unit
scalefor the minimum callout length.See also
See also
See also
- Parameters:
 scale (QgsMapUnitScale)
- setMinimumLengthUnit(self, unit: Qgis.RenderUnit)[source]¶
 Sets the
unitfor the minimum length of callout lines.See also
See also
- Parameters:
 unit (Qgis.RenderUnit)
- setOffsetFromAnchor(self, distance: float)[source]¶
 Sets the offset
distancefrom the anchor point at which to start the line. Units are specified throughsetOffsetFromAnchorUnit().See also
See also
- Parameters:
 distance (float)
- setOffsetFromAnchorMapUnitScale(self, scale: QgsMapUnitScale)[source]¶
 Sets the map unit
scalefor the offset from anchor.See also
See also
See also
- Parameters:
 scale (QgsMapUnitScale)
- setOffsetFromAnchorUnit(self, unit: Qgis.RenderUnit)[source]¶
 Sets the
unitfor the offset from anchor distance.See also
See also
- Parameters:
 unit (Qgis.RenderUnit)
- setOffsetFromLabel(self, distance: float)[source]¶
 Sets the offset
distancefrom label area at which to end the line. Units are specified throughsetOffsetFromLabelUnit().See also
See also
- Parameters:
 distance (float)
- setOffsetFromLabelMapUnitScale(self, scale: QgsMapUnitScale)[source]¶
 Sets the map unit
scalefor the offset from label area.See also
See also
See also
- Parameters:
 scale (QgsMapUnitScale)
- setOffsetFromLabelUnit(self, unit: Qgis.RenderUnit)[source]¶
 Sets the
unitfor the offset from label area distance.See also
See also
- Parameters:
 unit (Qgis.RenderUnit)