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)

graph_selection_changed[source]
property entity_items(self)[source]
setScene(self, scene)[source]

Sets a new scene to this view.

Parameters

scene (ShrinkingScene) – a new scene

_handle_scene_selection_changed(self)[source]

Filters parameters by selected objects in the graph.

connect_spine_db_editor(self, spine_db_editor)[source]
populate_context_menu(self)[source]
increase_arc_length(self)[source]
decrease_arc_length(self)[source]
_update_actions_visibility(self)[source]

Enables or disables actions according to current selection in the graph.

make_items_menu(self)[source]
set_auto_expand_objects(self, checked=False)[source]
add_objects_at_position(self, checked=False)[source]
edit_selected(self, _=False)[source]

Edits selected items.

remove_selected(self, _=False)[source]

Removes selected items.

hide_selected_items(self, checked=False)[source]

Hides selected items.

show_hidden_items(self, checked=False)[source]

Shows hidden items.

_get_selected_entity_names(self)[source]
_get_selected_class_names(self)[source]
prune_selected_entities(self, checked=False)[source]

Prunes selected items.

prune_selected_classes(self, checked=False)[source]

Prunes selected items.

restore_all_pruned_items(self, checked=False)[source]

Reinstates all pruned items.

restore_pruned_items(self, action)[source]

Reinstates last pruned items.

select_position_parameters(self, checked=False)[source]
_set_position_parameters(self, parameter_pos_x, parameter_pos_y)[source]
save_positions(self, checked=False)[source]
clear_saved_positions(self, checked=False)[source]
export_as_pdf(self, checked=False)[source]
_populate_add_heat_map_menu(self)[source]

Populates the menu ‘Add heat map’ with parameters for currently shown items in the graph.

add_heat_map(self, action)[source]

Adds heat map for the parameter in the action text.

_clean_up_heat_map_items(self)[source]
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]
_cross_hairs_has_valid_taget(self)[source]
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.

_scroll_scene_by(self, dx, dy)[source]
keyPressEvent(self, event)[source]

Aborts relationship creation if user presses ESC.

contextMenuEvent(self, e)[source]

Shows context menu.

Parameters

e (QContextMenuEvent) – Context menu event

_compute_max_zoom(self)[source]
_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.