Annotation Items (annotationitem)

class orangecanvas.canvas.items.annotationitem.Annotation[source]

Bases: PyQt5.QtWidgets.QGraphicsWidget

Base class for annotations in the canvas scheme.

class orangecanvas.canvas.items.annotationitem.TextAnnotation(parent=None, **kwargs)[source]

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)

itemChange(self, QGraphicsItem.GraphicsItemChange, Any) Any[source]
adjustSize()[source]

Resize to a reasonable size.

setFramePen(pen)[source]

Set the frame pen. By default Qt.NoPen is used (i.e. the frame is not shown).

framePen()[source]

Return the frame pen.

setFrameBrush(brush)[source]

Set the frame brush.

frameBrush()[source]

Return the frame brush.

setPlainText(text)[source]

Set the annotation text as plain text.

setHtml(text)[source]

Set the annotation text as html.

setDefaultTextColor(color)[source]

Set the default text color.

setTextMargins(left, top, right, bottom)[source]

Set the text margins.

textMargins()[source]

Return the text margins.

document()[source]

Return the QTextDocument instance used internally.

mouseDoubleClickEvent(self, QGraphicsSceneMouseEvent)[source]
startEdit()[source]

Start the annotation text edit process.

endEdit()[source]

End the annotation edit.

resizeEvent(self, QGraphicsSceneResizeEvent)[source]
sceneEventFilter(self, QGraphicsItem, QEvent) bool[source]
changeEvent(self, QEvent)[source]
contextMenuEvent(self, QGraphicsSceneContextMenuEvent)[source]
class orangecanvas.canvas.items.annotationitem.ArrowAnnotation(parent=None, line=None, **kwargs)[source]

Bases: orangecanvas.canvas.items.annotationitem.Annotation

setAutoAdjustGeometry(autoAdjust)[source]

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()[source]

Should the geometry of the item be adjusted automatically when setLine is called.

setLine(line)[source]

Set the arrow base line (a QLineF in object coordinates).

line()[source]

Return the arrow base line (QLineF in object coordinates).

setColor(color)[source]

Set arrow brush color.

color()[source]

Return the arrow brush color.

setLineWidth(lineWidth)[source]

Set the arrow line width.

lineWidth()[source]

Return the arrow line width.

adjustGeometry()[source]

Adjust the widget geometry to exactly fit the arrow inside while preserving the arrow path scene geometry.

shape(self) QPainterPath[source]
itemChange(self, QGraphicsItem.GraphicsItemChange, Any) Any[source]