Scheme Annotations (annotations
)
Scheme Annotations
- class orangecanvas.scheme.annotations.BaseSchemeAnnotation[source]
Bases:
QObject
Base class for scheme annotations.
- geometry_changed
Signal emitted when the geometry of the annotation changes
- class orangecanvas.scheme.annotations.SchemeArrowAnnotation(start_pos: Tuple[float, float], end_pos: Tuple[float, float], color: str = 'red', anchor: Any | None = None, parent: QObject | None = None)[source]
Bases:
BaseSchemeAnnotation
An arrow annotation in the scheme.
- set_line(start_pos: Tuple[float, float], end_pos: Tuple[float, float]) None [source]
Set arrow lines start and end position (
(x, y)
tuples).
- set_geometry(geometry: Tuple[Tuple[float, float], Tuple[float, float]]) None [source]
Set the geometry of the arrow as a start and end position tuples (e.g.
set_geometry(((0, 0), (100, 0))
).
- geometry: Tuple[Tuple[float, float], Tuple[float, float]]
Return the start and end positions of the arrow.
- class orangecanvas.scheme.annotations.SchemeTextAnnotation(rect: Tuple[float, float, float, float], text: str = '', content_type: str = 'text/plain', font: dict | None = None, anchor: Any | None = None, parent: QObject | None = None)[source]
Bases:
BaseSchemeAnnotation
Text annotation in the scheme.
- text_changed(str)
Signal emitted when the annotation text changes.
- set_rect(rect: Tuple[float, float, float, float]) None [source]
Set the text geometry bounding rectangle (
(x, y, width, height)
tuple).
- set_geometry(rect: Tuple[float, float, float, float]) None [source]
Set the text geometry (same as
set_rect
)
- property content_type: str
Return the annotations’ content type.
Currently this will be ‘text/plain’, ‘text/html’ or ‘text/rst’.
- property content: str
The annotation content.
How the content is interpreted/displayed depends on content_type.
- set_content(content: str, content_type: str = 'text/plain') None [source]
Set the annotation content.