spinetoolbox.spine_db_editor.graphics_items
Classes for drawing graphics items on graph view’s QGraphicsScene.
Module Contents
Classes
|
|
Connects two EntityItems. |
|
Creates new relationships directly in the graph. |
|
Represents the relationship that's being created using the CrossHairsItem. |
|
Connects a CrossHairsEntityItem with the CrossHairsItem, |
|
Provides a label for EntityItem. |
|
- class spinetoolbox.spine_db_editor.graphics_items.EntityItem(spine_db_editor, x, y, extent, db_map_ids, offset=None)[source]
Bases:
PySide6.QtWidgets.QGraphicsRectItem
- Parameters
spine_db_editor (SpineDBEditor) – ‘owner’
x (float) – x-coordinate of central point
y (float) – y-coordinate of central point
extent (int) – Preferred extent
db_map_ids (tuple) – tuple of (db_map, id) tuples
- has_unique_key()[source]
Returns whether or not the item still has a single key in all the databases it represents.
- Returns
bool
- default_parameter_data()[source]
Return data to put as default in a parameter table when this item is selected.
- shape()[source]
Returns a shape containing the entire bounding rect, to work better with icon transparency.
- apply_rotation(angle, center)[source]
Applies rotation.
- Parameters
angle (float) – The angle in degrees.
center (QPointF) – Rotates around this point.
- mouseMoveEvent(event)[source]
Moves the item and all connected arcs.
- Parameters
event (QGraphicsSceneMouseEvent) –
- itemChange(change, value)[source]
Keeps track of item’s movements on the scene. Rotates svg item if the relationship is 2D. This makes it possible to define e.g. an arow icon for relationships that express direction.
- Parameters
change (GraphicsItemChange) – a flag signalling the type of the change
value – a value related to the change
- Returns
the same value given as input
- setVisible(on)[source]
Sets visibility status for this item and all arc items.
- Parameters
on (bool) –
- contextMenuEvent(e)[source]
Shows context menu.
- Parameters
e (QGraphicsSceneMouseEvent) – Mouse event
Populates the ‘Expand’ or ‘Collapse’ menu.
- Parameters
menu (QMenu) –
Populates the ‘Add relationships’ menu.
- Parameters
menu (QMenu) –
- class spinetoolbox.spine_db_editor.graphics_items.ArcItem(ent_item, el_item, width)[source]
Bases:
PySide6.QtWidgets.QGraphicsPathItem
Connects two EntityItems.
- Parameters
ent_item (spinetoolbox.widgets.graph_view_graphics_items.EntityItem) – entity item
el_item (spinetoolbox.widgets.graph_view_graphics_items.EntityItem) – element item
width (float) – Preferred line width
- class spinetoolbox.spine_db_editor.graphics_items.CrossHairsItem(*args, **kwargs)[source]
Bases:
EntityItem
Creates new relationships directly in the graph.
- Parameters
spine_db_editor (SpineDBEditor) – ‘owner’
x (float) – x-coordinate of central point
y (float) – y-coordinate of central point
extent (int) – Preferred extent
db_map_ids (tuple) – tuple of (db_map, id) tuples
- class spinetoolbox.spine_db_editor.graphics_items.CrossHairsEntityItem(*args, **kwargs)[source]
Bases:
EntityItem
Represents the relationship that’s being created using the CrossHairsItem.
- Parameters
spine_db_editor (SpineDBEditor) – ‘owner’
x (float) – x-coordinate of central point
y (float) – y-coordinate of central point
extent (int) – Preferred extent
db_map_ids (tuple) – tuple of (db_map, id) tuples
- class spinetoolbox.spine_db_editor.graphics_items.CrossHairsArcItem(ent_item, el_item, width)[source]
Bases:
ArcItem
Connects a CrossHairsEntityItem with the CrossHairsItem, and with all the EntityItem’s in the relationship so far.
- Parameters
ent_item (spinetoolbox.widgets.graph_view_graphics_items.EntityItem) – entity item
el_item (spinetoolbox.widgets.graph_view_graphics_items.EntityItem) – element item
width (float) – Preferred line width
- class spinetoolbox.spine_db_editor.graphics_items.EntityLabelItem(entity_item)[source]
Bases:
PySide6.QtWidgets.QGraphicsTextItem
Provides a label for EntityItem.
Initializes item.
- Parameters
entity_item (spinetoolbox.widgets.graph_view_graphics_items.EntityItem) – The parent item.
- class spinetoolbox.spine_db_editor.graphics_items.BgItem(svg, parent=None)[source]
Bases:
PySide6.QtWidgets.QGraphicsRectItem
- class spinetoolbox.spine_db_editor.graphics_items._ResizableQGraphicsSvgItem(*args, **kwargs)[source]
Bases:
PySide6.QtSvgWidgets.QGraphicsSvgItem