Annotation Items (annotationitem
)
-
class
orangecanvas.canvas.items.annotationitem.
Annotation
(parent=None, **kwargs) Bases:
PyQt5.QtWidgets.QGraphicsWidget
Base class for annotations in the canvas scheme.
-
class
orangecanvas.canvas.items.annotationitem.
TextAnnotation
(parent=None, **kwargs) Bases:
orangecanvas.canvas.items.annotationitem.Annotation
Text annotation item for the canvas scheme.
Text interaction (if enabled) is started by double clicking the item.
-
editingFinished
Emitted when the editing is finished (i.e. the item loses edit focus).
-
textEdited
Emitted when the text content changes on user interaction.
-
contentChanged
Emitted when the text annotation’s contents change (content or contentType changed)
-
ContentRenderer
= OrderedDict([('text/plain', <function render_plain>), ('text/rst', <function render_rst>), ('text/markdown', <function render_markdown>), ('text/html', <function render_html>)]) Mapping of supported content types to corresponding content -> html transformer.
-
adjustSize
() Resize to a reasonable size.
-
setFramePen
(pen) Set the frame pen. By default Qt.NoPen is used (i.e. the frame is not shown).
-
framePen
() Return the frame pen.
-
setFrameBrush
(brush) Set the frame brush.
-
frameBrush
() Return the frame brush.
-
setPlainText
(text) Set the annotation text as plain text.
-
setHtml
(text) Set the annotation text as html.
-
setDefaultTextColor
(color) Set the default text color.
-
setTextMargins
(left, top, right, bottom) Set the text margins.
-
textMargins
() Return the text margins.
-
document
() Return the QTextDocument instance used internally.
-
startEdit
() Start the annotation text edit process.
-
endEdit
() End the annotation edit.
-
-
class
orangecanvas.canvas.items.annotationitem.
ArrowAnnotation
(parent=None, line=None, **kwargs) Bases:
orangecanvas.canvas.items.annotationitem.Annotation
-
setAutoAdjustGeometry
(autoAdjust) If set to True then the geometry will be adjusted whenever the arrow is changed with setLine. Otherwise the geometry of the item is only updated so the line lies within the geometry() rect (i.e. it only grows). True by default
-
autoAdjustGeometry
() Should the geometry of the item be adjusted automatically when setLine is called.
-
setLine
(line) Set the arrow base line (a QLineF in object coordinates).
-
line
() Return the arrow base line (QLineF in object coordinates).
-
setColor
(color) Set arrow brush color.
-
color
() Return the arrow brush color.
-
setLineWidth
(lineWidth) Set the arrow line width.
-
lineWidth
() Return the arrow line width.
-
adjustGeometry
() Adjust the widget geometry to exactly fit the arrow inside while preserving the arrow path scene geometry.
-