Scheme Annotations (annotations
)
Scheme Annotations
- class orangecanvas.scheme.annotations.BaseSchemeAnnotation[source]
Bases:
QObject
Base class for scheme annotations.
- geometry_changed
int = …, arguments: Sequence = …) -> PYQT_SIGNAL
types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.
- Type:
pyqtSignal(*types, name
- Type:
str = …, revision
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).
- 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)
int = …, arguments: Sequence = …) -> PYQT_SIGNAL
types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.
- Type:
pyqtSignal(*types, name
- Type:
str = …, revision
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.