Link Item (linkitem)
Link Item
- class orangecanvas.canvas.items.linkitem.LinkItem(parent: Optional[PyQt5.QtWidgets.QGraphicsItem] = None, **kwargs: Any)[source]
Bases:
PyQt5.QtWidgets.QGraphicsWidgetA Link item in the canvas that connects two
NodeItems in the canvas.The link curve connects two Anchor items (see
setSourceItem()andsetSinkItem()). Once the anchors are set the curve automatically adjusts its end points whenever the anchors move.An optional source/sink text item can be displayed above the curve’s central point (
setSourceName(),setSinkName())- activated
Signal emitted when the item has been activated (double-click)
- selectedChanged
Signal emitted the the item’s selection state changes.
- Z_VALUE = 0
Z value of the item
- class State(value)
Bases:
enum.IntEnumFlags indicating the runtime state of a link
- NoState = 0
The link has no associated state.
- Empty = 1
Link is empty; the source node does not have any value on output
- Active = 2
Link is active; the source node has a valid value on output
- Pending = 4
The link is pending; the sink node is scheduled for update
- Invalidated = 8
The link’s input is marked as invalidated (not yet available).
- setSourceItem(item: Optional[NodeItem], signal: Optional[OutputSignal] = None, anchor: Optional[AnchorPoint] = None) None[source]
Set the source item (
NodeItem). Use anchor (AnchorPoint) as the curve start point (ifNonea new output anchor will be created usingitem.newOutputAnchor()).Setting item to
Noneand a valid anchor is a valid operation (for instance while mouse dragging one end of the link).
- setSinkItem(item: Optional[NodeItem], signal: Optional[InputSignal] = None, anchor: Optional[AnchorPoint] = None) None[source]
Set the sink item (
NodeItem). Use anchor (AnchorPoint) as the curve end point (ifNonea new input anchor will be created usingitem.newInputAnchor()).Setting item to
Noneand a valid anchor is a valid operation (for instance while mouse dragging one and of the link).
- setEnabled(enabled: bool) None[source]
Reimplemented from
QGraphicWidgetSet link enabled state. When disabled the link is rendered with a dashed line.
- setDynamicEnabled(enabled: bool) None[source]
Set the link’s dynamic enabled state.
If the link is dynamic it will be rendered in red/green color respectively depending on the state of the dynamic enabled state.
- setDynamic(dynamic: bool) None[source]
Mark the link as dynamic (i.e. it responds to
setDynamicEnabled()).
- setRuntimeState(state: orangecanvas.scheme.link.SchemeLink.State) None[source]
Style the link appropriate to the LinkItem.State
- Parameters
state (LinkItem.State) –