spinetoolbox.widgets.toolbars

Functions to make and handle QToolBars.

author:
  1. Savolainen (VTT)
date:

19.1.2018

Module Contents

class spinetoolbox.widgets.toolbars.ItemToolBar(parent)[source]

Bases: PySide2.QtWidgets.QToolBar

A toolbar to add items using drag and drop actions.

Parameters:parent (ToolboxUI) – QMainWindow instance
add_draggable_widgets(self, category_icon)[source]

Adds draggable widgets from the given list.

Parameters:category_icon (list) – List of tuples (item_type (str), item category (str), icon path (str))
remove_all(self, checked=False)[source]

Slot for handling the remove all tool button clicked signal. Calls ToolboxUI remove_all_items() method.

execute_project(self, checked=False)[source]

Slot for handling the Execute project tool button clicked signal.

execute_selected(self, checked=False)[source]

Slot for handling the Execute selected tool button clicked signal.

stop_execution(self, checked=False)[source]

Slot for handling the Stop execution tool button clicked signal.

class spinetoolbox.widgets.toolbars.DraggableWidget(parent, pixmap, item_type, category)[source]

Bases: PySide2.QtWidgets.QLabel

A draggable QLabel.

Parameters:
  • parent (QWidget) – Parent widget
  • pixmap (QPixMap) – Picture for the label
  • item_type (str) – Item type (e.g. Data Store, Data Connection, etc…)
  • category (str) – Item category (e.g. Data Stores, Data Connetions, etc…)
mousePressEvent(self, event)[source]

Register drag start position

mouseMoveEvent(self, event)[source]

Start dragging action if needed

mouseReleaseEvent(self, event)[source]

Forget drag start position

class spinetoolbox.widgets.toolbars.ParameterTagToolBar(parent, db_mngr, *db_maps)[source]

Bases: PySide2.QtWidgets.QToolBar

A toolbar to add items using drag and drop actions.

Parameters:
  • parent (DataStoreForm) – tree or graph view form
  • db_mngr (SpineDBManager) – the DB manager for interacting with the db
  • db_maps (iter) – DiffDatabaseMapping instances
tag_button_toggled[source]
manage_tags_action_triggered[source]
init_toolbar(self)[source]
receive_parameter_tags_added(self, db_map_data)[source]
_add_db_map_tag_actions(self, db_map, parameter_tags)[source]
receive_parameter_tags_removed(self, db_map_data)[source]
_remove_db_map_tag_actions(self, db_map, parameter_tag_ids)[source]
receive_parameter_tags_updated(self, db_map_data)[source]
_update_db_map_tag_actions(self, db_map, parameter_tags)[source]