Link Item (linkitem
)
Link Item
- class orangecanvas.canvas.items.linkitem.LinkItem(parent=None, **kwargs)[source]
Bases:
PyQt5.QtWidgets.QGraphicsWidget
A Link item in the canvas that connects two
NodeItem
s 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.IntEnum
Flags 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, signal=None, anchor=None)[source]
Set the source item (
NodeItem
). Use anchor (AnchorPoint
) as the curve start point (ifNone
a new output anchor will be created usingitem.newOutputAnchor()
).Setting item to
None
and a valid anchor is a valid operation (for instance while mouse dragging one end of the link).
- setSinkItem(item, signal=None, anchor=None)[source]
Set the sink item (
NodeItem
). Use anchor (AnchorPoint
) as the curve end point (ifNone
a new input anchor will be created usingitem.newInputAnchor()
).Setting item to
None
and a valid anchor is a valid operation (for instance while mouse dragging one and of the link).
- setEnabled(enabled)[source]
Reimplemented from
QGraphicWidget
Set link enabled state. When disabled the link is rendered with a dashed line.
- setDynamicEnabled(enabled)[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)[source]
Mark the link as dynamic (i.e. it responds to
setDynamicEnabled()
).
- setRuntimeState(state)[source]
Style the link appropriate to the LinkItem.State
- Parameters
state (LinkItem.State) –