Canvas Scene (scene
)¶
Canvas Graphics Scene¶
- class orangecanvas.canvas.scene.CanvasScene(*args, **kwargs)[source]¶
Bases:
PyQt5.QtWidgets.QGraphicsScene
A Graphics Scene for displaying an
Scheme
instance.- node_item_added(NodeItem)¶
Signal emitted when a
NodeItem
has been added to the scene.
- node_item_removed(NodeItem)¶
Signal emitted when a
NodeItem
has been removed from the scene.
- link_item_added(LinkItem)¶
Signal emitted when a new
LinkItem
has been added to the scene.
- link_item_removed(LinkItem)¶
Signal emitted when a
LinkItem
has been removed.
- annotation_added(Annotation)¶
Signal emitted when a
Annotation
item has been added.
- annotation_removed(Annotation)¶
Signal emitted when a
Annotation
item has been removed.
- node_item_position_changed(NodeItem, QPointF)¶
Signal emitted when the position of a
NodeItem
has changed.
- node_item_double_clicked(NodeItem)¶
Signal emitted when an
NodeItem
has been double clicked.
- node_item_activated(NodeItem)¶
An node item has been activated (double-clicked)
- node_item_hovered(NodeItem)¶
An node item has been hovered
- link_item_hovered(LinkItem)¶
Link item has been hovered
- link_item_activated¶
Link item has been activated (double-clicked)
- set_scheme(scheme)[source]¶
Set the scheme to display. Populates the scene with nodes and links already in the scheme. Any further change to the scheme will be reflected in the scene.
- Parameters
scheme (
Scheme
) –
- add_node(node)[source]¶
Add and return a default constructed
NodeItem
for aSchemeNode
instance node. If the node is already in the scene do nothing and just return its item.
- new_node_item(widget_desc, category_desc=None)[source]¶
Construct an new
NodeItem
from a WidgetDescription. Optionally also set CategoryDescription.
- remove_node(node)[source]¶
Remove the
NodeItem
instance that was previously constructed for aSchemeNode
node using the add_node method.
- add_link(scheme_link)[source]¶
Create and add a
LinkItem
instance for aSchemeLink
instance. If the link is already in the scene do nothing and just return itsLinkItem
.
- new_link_item(source_item, source_channel, sink_item, sink_channel)[source]¶
Construct and return a new
LinkItem
- remove_link(scheme_link)[source]¶
Remove a
LinkItem
instance that was previously constructed for aSchemeLink
instance link using the add_link method.
- add_annotation_item(annotation)[source]¶
Add an
Annotation
item to the scene.
- add_annotation(scheme_annot)[source]¶
Create a new item for
SchemeAnnotation
and add it to the scene. If the scheme_annot is already in the scene do nothing and just return its item.
- remove_annotation_item(annotation)[source]¶
Remove an
Annotation
instance from the scene.
- remove_annotation(scheme_annotation)[source]¶
Remove an
Annotation
instance that was previously added usingadd_anotation()
.
- annotation_items()[source]¶
Return all
Annotation
items in the scene.
- orangecanvas.canvas.scene.grab_svg(scene)[source]¶
Return a SVG rendering of the scene contents.
- Parameters
scene (
CanvasScene
) –