spinetoolbox.spine_db_editor.widgets.custom_qgraphicsviews

Classes for custom QGraphicsViews for the Entity graph view.

authors:
  1. Savolainen (VTT), M. Marin (KTH)
date:

6.2.2018

Module Contents

Classes

EntityQGraphicsView QGraphicsView for the Entity Graph View.
class spinetoolbox.spine_db_editor.widgets.custom_qgraphicsviews.EntityQGraphicsView(parent)[source]

Bases: spinetoolbox.widgets.custom_qgraphicsviews.CustomQGraphicsView

QGraphicsView for the Entity Graph View.

Parameters:parent (QWidget) – Graph View Form’s (QMainWindow) central widget (self.centralwidget)
set_cross_hairs_items(self, relationship_class, cross_hairs_items)[source]

Sets ‘cross_hairs’ items for relationship creation.

Parameters:
  • relationship_class (dict) –
  • cross_hairs_items (list(QGraphicsItems)) –
clear_cross_hairs_items(self)[source]
connect_data_store_form(self, spine_db_editor)[source]
create_context_menu(self)[source]
edit_selected(self)[source]

Edits selected items using the connected Spine db editor.

remove_selected(self)[source]

Removes selected items using the connected Spine db editor.

mousePressEvent(self, event)[source]

Handles relationship creation if one it’s in process.

mouseMoveEvent(self, event)[source]

Updates the hovered object item if we’re in relationship creation mode.

_update_cross_hairs_pos(self, pos)[source]

Updates the hovered object item and sets the ‘cross_hairs’ icon accordingly.

Parameters:pos (QPoint) – the desired position in view coordinates
mouseReleaseEvent(self, event)[source]

Reestablish scroll hand drag mode.

keyPressEvent(self, event)[source]

Aborts relationship creation if user presses ESC.

contextMenuEvent(self, e)[source]

Shows context menu.

Parameters:e (QContextMenuEvent) – Context menu event
_use_smooth_zoom(self)[source]
_zoom(self, factor)[source]
apply_zoom(self)[source]
wheelEvent(self, event)[source]

Zooms in/out. If user has pressed the shift key, rotates instead.

Parameters:event (QWheelEvent) – Mouse wheel event
_handle_rotation_time_line_advanced(self, pos)[source]

Performs rotation whenever the smooth rotation time line advances.

_rotate(self, angle)[source]
rotate_clockwise(self)[source]

Performs a rotate clockwise with fixed angle.

rotate_anticlockwise(self)[source]

Performs a rotate anticlockwise with fixed angle.