spinetoolbox.link
Classes for drawing graphics items on QGraphicsScene.
Module Contents
Classes
Base class for Link and LinkDrawer. |
|
Base class for icons to show over a Link. |
|
An SVG icon to show over a Link. |
|
A font awesome icon to show over a Link. |
|
A font awesome icon to show over a Link. |
|
Base class for Jump and Link. |
|
A graphics item to represent the connection between two project items. |
|
A graphics icon to represent a jump connection between items. |
|
A base class for items intended for drawing links between project items. |
|
An item for drawing connection links between project items. |
|
An item for drawing jump connections between project items. |
Functions
|
Attributes
- class spinetoolbox.link.LinkBase(toolbox, src_connector, dst_connector)[source]
Bases:
PySide6.QtWidgets.QGraphicsPathItem
Base class for Link and LinkDrawer.
Mainly provides the
update_geometry
method for ‘drawing’ the link on the scene.- Parameters
toolbox (ToolboxUI) – main UI class instance
src_connector (ConnectorButton, optional) – Source connector button
dst_connector (ConnectorButton) – Destination connector button
- moveBy(_dx, _dy)[source]
Does nothing. This item is not moved the regular way, but follows the ConnectorButtons it connects.
- _find_new_point(points, target)[source]
Finds a new point that approximates points to target in a smooth trajectory. Returns the new point, or None if no need for approximation.
- Parameters
points (list(QPointF)) –
target (QPointF) –
- Returns
QPointF or None
- class spinetoolbox.link._IconBase(x, y, w, h, parent, tooltip=None, active=True)[source]
Bases:
PySide6.QtWidgets.QGraphicsEllipseItem
Base class for icons to show over a Link.
- class spinetoolbox.link._SvgIcon(parent, extent, path, tooltip=None, active=False)[source]
Bases:
_IconBase
An SVG icon to show over a Link.
- class spinetoolbox.link._TextIcon(parent, extent, char, tooltip=None, active=False)[source]
Bases:
_IconBase
A font awesome icon to show over a Link.
- class spinetoolbox.link._WarningTextIcon(parent, extent, char, tooltip)[source]
Bases:
_TextIcon
A font awesome icon to show over a Link.
- class spinetoolbox.link.JumpOrLink(toolbox, src_connector, dst_connector)[source]
Bases:
LinkBase
Base class for Jump and Link.
- Parameters
toolbox (ToolboxUI) – main UI class instance
src_connector (ConnectorButton, optional) – Source connector button
dst_connector (ConnectorButton) – Destination connector button
- mousePressEvent(e)[source]
Ignores event if there’s a connector button underneath, to allow creation of new links.
- Parameters
e (QGraphicsSceneMouseEvent) – Mouse event
- contextMenuEvent(e)[source]
Selects the link and shows context menu.
- Parameters
e (QGraphicsSceneMouseEvent) – Mouse event
- class spinetoolbox.link.Link(toolbox, src_connector, dst_connector, connection)[source]
Bases:
JumpOrLink
A graphics item to represent the connection between two project items.
- Parameters
toolbox (ToolboxUI) – main UI class instance
src_connector (ConnectorButton) – Source connector button
dst_connector (ConnectorButton) – Destination connector button
connection (LoggingConnection) – connection this link represents
- class spinetoolbox.link.JumpLink(toolbox, src_connector, dst_connector, jump)[source]
Bases:
JumpOrLink
A graphics icon to represent a jump connection between items.
- Parameters
toolbox (ToolboxUI) – main UI class instance
src_connector (ConnectorButton) – Source connector button
dst_connector (ConnectorButton) – Destination connector button
jump (spine_engine.project_item.connection.Jump) – connection this link represents
- class spinetoolbox.link.LinkDrawerBase(toolbox)[source]
Bases:
LinkBase
A base class for items intended for drawing links between project items.
- Parameters
toolbox (ToolboxUI) – main UI class instance
- wake_up(src_connector)[source]
Sets the source connector, shows this item and adds it to the scene. After calling this, the scene is in link drawing mode.
- Parameters
src_connector (ConnectorButton) – source connector
- class spinetoolbox.link.ConnectionLinkDrawer(toolbox)[source]
Bases:
LinkDrawerBase
An item for drawing connection links between project items.
- Parameters
toolbox (ToolboxUI) – main UI class instance
- wake_up(src_connector)[source]
Sets the source connector, shows this item and adds it to the scene. After calling this, the scene is in link drawing mode.
- Parameters
src_connector (ConnectorButton) – source connector
- class spinetoolbox.link.JumpLinkDrawer(toolbox)[source]
Bases:
LinkDrawerBase
An item for drawing jump connections between project items.
- Parameters
toolbox (ToolboxUI) – main UI class instance