spinetoolbox.spine_db_editor.widgets.custom_menus
¶
Classes for custom context menus and pop-up menus.
- author
Marin (KTH)
- date
13.5.2020
Module Contents¶
Classes¶
Filter menu. |
|
Filter menu to use together with FilterWidget in TabularViewMixin. |
- class spinetoolbox.spine_db_editor.widgets.custom_menus.MainMenu[source]¶
Bases:
PySide2.QtWidgets.QMenu
- class spinetoolbox.spine_db_editor.widgets.custom_menus.ParameterViewFilterMenu(parent, source_model, field, show_empty=True)[source]¶
Bases:
spinetoolbox.widgets.custom_menus.FilterMenuBase
Filter menu.
- Parameters
parent (SpineDBEditor) –
source_model (CompoundParameterModel) – a model to lazily get data from
field (str) – the field name
- _handle_source_model_refreshed(self)[source]¶
Updates the menu to only present values that are actually shown in the source model.
- modify_menu_data(self, action, db_map, db_items)[source]¶
Modifies data in the menu.
- Parameters
action (str) – either ‘add’, ‘remove’, or ‘update’
db_map (DiffDatabaseMapping) –
db_items (list(dict)) –
- class spinetoolbox.spine_db_editor.widgets.custom_menus.TabularViewFilterMenu(parent, identifier, data_to_value, show_empty=True)[source]¶
Bases:
spinetoolbox.widgets.custom_menus.FilterMenuBase
Filter menu to use together with FilterWidget in TabularViewMixin.
- Parameters
parent (SpineDBEditor) –
identifier (int) – index identifier
data_to_value (method) – a method to translate item data to a value for display role