spinetoolbox.spine_db_editor.widgets.custom_qgraphicsviews

Classes for custom QGraphicsViews for the Entity graph view.

Module Contents

Classes

_GraphProperty

_GraphBoolProperty

_GraphIntProperty

EntityQGraphicsView

QGraphicsView for the Entity Graph View.

class spinetoolbox.spine_db_editor.widgets.custom_qgraphicsviews._GraphProperty(name, settings_name)[source]
property value[source]
connect_spine_db_editor(spine_db_editor)[source]
class spinetoolbox.spine_db_editor.widgets.custom_qgraphicsviews._GraphBoolProperty(*args, **kwargs)[source]

Bases: _GraphProperty

_set_value(_checked=False, save_setting=True)[source]
set_value(checked)[source]
update(menu)[source]
class spinetoolbox.spine_db_editor.widgets.custom_qgraphicsviews._GraphIntProperty(min_value, max_value, default_value, *args, **kwargs)[source]

Bases: _GraphProperty

_set_value(_value=None, save_setting=True)[source]
set_value(value)[source]
update(menu)[source]
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)

property _qsettings[source]
property db_mngr[source]
property entity_items[source]
graph_selection_changed[source]
get_property(name)[source]
set_property(name, value)[source]
get_all_properties()[source]
set_many_properties(props)[source]
handle_scene_selection_changed()[source]

Filters parameters by selected objects in the graph.

connect_spine_db_editor(spine_db_editor)[source]
populate_context_menu()[source]
_update_actions_visibility()[source]

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

make_items_menu()[source]
_save_state()[source]
_load_state(action)[source]
_remove_state(action)[source]
_find()[source]
increase_arc_length()[source]
decrease_arc_length()[source]
add_entities_at_position(checked=False)[source]
edit_selected(_=False)[source]

Edits selected items.

remove_selected(_=False)[source]

Removes selected items.

_get_selected_entity_names()[source]
hide_selected_items(checked=False)[source]

Hides selected items.

_hide_class(action)[source]

Hides some class.

show_all_hidden_items(checked=False)[source]

Shows all hidden items.

show_hidden_items(action)[source]

Shows some hidden items.

prune_selected_items(checked=False)[source]

Prunes selected items.

_prune_class(action)[source]

Prunnes some class.

restore_all_pruned_items(checked=False)[source]

Reinstates all pruned items.

restore_pruned_items(action)[source]

Reinstates some pruned items.

select_graph_parameters(checked=False)[source]
_set_graph_parameters(parameters)[source]
_save_selected_positions(checked=False)[source]
_save_all_positions(checked=False)[source]
_save_positions(items)[source]
_clear_selected_positions(checked=False)[source]
_clear_all_positions(checked=False)[source]
_clear_positions(items)[source]
_select_bg_image(_checked=False)[source]
set_bg_svg(svg)[source]
get_bg_svg()[source]
set_bg_rect(rect)[source]
get_bg_rect()[source]
clear_scene()[source]
_no_zoom()[source]
export_as_image(_=False)[source]
_do_export_as_image(file_path)[source]
_get_print_source(scene=None)[source]
_print_scene(printer, source, size, index=None, scene=None)[source]
_clone_scene()[source]
_frames(start, stop, step_len, buffer_path, cv2)[source]
export_as_video()[source]
_do_export_as_video(file_path, start, stop, step_len, fps, cv2)[source]
set_cross_hairs_items(entity_class, cross_hairs_items)[source]

Sets ‘cross_hairs’ items for connecting entities.

Parameters
  • entity_class (dict) –

  • cross_hairs_items (list(QGraphicsItems)) –

clear_cross_hairs_items()[source]
_cross_hairs_has_valid_target()[source]
mousePressEvent(event)[source]

Handles relationship creation if one it’s in process.

mouseMoveEvent(event)[source]

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

_update_cross_hairs_pos(pos)[source]

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

Parameters

pos (QPoint) – the desired position in view coordinates

mouseReleaseEvent(event)[source]

Reestablish scroll hand drag mode.

keyPressEvent(event)[source]

Aborts relationship creation if user presses ESC.

contextMenuEvent(e)[source]

Shows context menu.

Parameters

e (QContextMenuEvent) – Context menu event

_compute_max_zoom()[source]
_use_smooth_zoom()[source]
_zoom(factor)[source]
apply_zoom()[source]
wheelEvent(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(pos)[source]

Performs rotation whenever the smooth rotation time line advances.

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

Performs a rotate clockwise with fixed angle.

rotate_anticlockwise()[source]

Performs a rotate anticlockwise with fixed angle.