widgets.custom_qdialog

Classes for custom QDialogs to add and edit database items.

author:
  1. Marin (KTH)
date:

13.5.2018

Module Contents

class widgets.custom_qdialog.ManageItemsDialog(parent)[source]

Bases: PySide2.QtWidgets.QDialog

A dialog with a CopyPasteTableView and a QDialogButtonBox, to be extended into dialogs to query user’s preferences for adding/editing/managing data items

parent

data store widget

Type:TreeViewForm
connect_signals(self)[source]

Connect signals to slots.

resize_window_to_columns(self)[source]
_handle_model_data_changed(self, top_left, bottom_right, roles)[source]

Reimplement in subclasses to handle changes in model data.

set_model_data(self, index, data)[source]

Update model data.

_handle_model_reset(self)[source]

Resize columns and form.

class widgets.custom_qdialog.AddItemsDialog(parent)[source]

Bases: widgets.custom_qdialog.ManageItemsDialog

connect_signals(self)[source]
remove_selected_rows(self, checked=True)[source]
all_databases(self, row)[source]

Returns a list of db names available for a given row. Used by delegates.

class widgets.custom_qdialog.GetObjectClassesMixin[source]

Provides a method to retrieve object classes for AddObjectsDialog and AddRelationshipClassesDialog.

object_class_name_list(self, row)[source]

Return a list of object class names present in all databases selected for given row. Used by ManageObjectsDelegate.

class widgets.custom_qdialog.GetObjectsMixin[source]

Provides a method to retrieve objects for AddRelationshipsDialog and EditRelationshipsDialog.

object_name_list(self, row, column)[source]

Return a list of object names present in all databases selected for given row. Used by ManageRelationshipsDelegate.

class widgets.custom_qdialog.ShowIconColorEditorMixin[source]

Provides methods to show an IconColorEditor upon request.

create_object_pixmap(self, display_icon)[source]
show_icon_color_editor(self, index)[source]
class widgets.custom_qdialog.AddObjectClassesDialog(parent)[source]

Bases: widgets.custom_qdialog.AddItemsDialog, widgets.custom_qdialog.ShowIconColorEditorMixin

A dialog to query user’s preferences for new object classes.

parent

data store widget

Type:DataStoreForm
connect_signals(self)[source]
accept(self)[source]

Collect info from dialog and try to add items.

class widgets.custom_qdialog.AddObjectsDialog(parent, class_name=None, force_default=False)[source]

Bases: widgets.custom_qdialog.AddItemsDialog, widgets.custom_qdialog.GetObjectClassesMixin

A dialog to query user’s preferences for new objects.

parent

data store widget

Type:DataStoreForm
class_name

default object class name

Type:str
force_default

if True, defaults are non-editable

Type:bool
_handle_model_data_changed(self, top_left, bottom_right, roles)[source]

Set decoration role data.

accept(self)[source]

Collect info from dialog and try to add items.

class widgets.custom_qdialog.AddRelationshipClassesDialog(parent, object_class_one_name=None, force_default=False)[source]

Bases: widgets.custom_qdialog.AddItemsDialog, widgets.custom_qdialog.GetObjectClassesMixin

A dialog to query user’s preferences for new relationship classes.

parent

data store widget

Type:DataStoreForm
object_class_one_name

default object class name to put in first dimension

Type:str
force_default

if True, defaults are non-editable

Type:bool
connect_signals(self)[source]

Connect signals to slots.

_handle_spin_box_value_changed(self, i)[source]
insert_column(self)[source]
remove_column(self)[source]
_handle_model_data_changed(self, top_left, bottom_right, roles)[source]
accept(self)[source]

Collect info from dialog and try to add items.

class widgets.custom_qdialog.AddRelationshipsDialog(parent, relationship_class_key=None, object_class_name=None, object_name=None, force_default=False)[source]

Bases: widgets.custom_qdialog.AddItemsDialog, widgets.custom_qdialog.GetObjectsMixin

A dialog to query user’s preferences for new relationships.

parent

data store widget

Type:DataStoreForm
relationship_class_key

(class_name, object_class_name_list) for identifying the relationship class

Type:tuple
object_name

default object name

Type:str
object_class_name

default object class name

Type:str
force_default

if True, defaults are non-editable

Type:bool
connect_signals(self)[source]

Connect signals to slots.

call_reset_model(self, text)[source]

Called when relationship class’s combobox’s index changes. Update relationship_class attribute accordingly and reset model.

reset_model(self)[source]

Setup model according to current relationship class selected in combobox.

_handle_model_data_changed(self, top_left, bottom_right, roles)[source]
accept(self)[source]

Collect info from dialog and try to add items.

class widgets.custom_qdialog.EditOrRemoveItemsDialog(parent)[source]

Bases: widgets.custom_qdialog.ManageItemsDialog

all_databases(self, row)[source]

Returns a list of db names available for a given row. Used by delegates.

class widgets.custom_qdialog.EditObjectClassesDialog(parent, db_map_dicts)[source]

Bases: widgets.custom_qdialog.EditOrRemoveItemsDialog, widgets.custom_qdialog.ShowIconColorEditorMixin

A dialog to query user’s preferences for updating object classes.

parent

data store widget

Type:DataStoreForm
db_map_dicts

list of dictionaries mapping dbs to object classes for editing

Type:list
connect_signals(self)[source]
accept(self)[source]

Collect info from dialog and try to update items.

class widgets.custom_qdialog.EditObjectsDialog(parent, db_map_dicts)[source]

Bases: widgets.custom_qdialog.EditOrRemoveItemsDialog

A dialog to query user’s preferences for updating objects.

parent

data store widget

Type:DataStoreForm
db_map_dicts

list of dictionaries mapping dbs to objects for editing

Type:list
accept(self)[source]

Collect info from dialog and try to update items.

class widgets.custom_qdialog.EditRelationshipClassesDialog(parent, db_map_dicts)[source]

Bases: widgets.custom_qdialog.EditOrRemoveItemsDialog

A dialog to query user’s preferences for updating relationship classes.

parent

data store widget

Type:DataStoreForm
db_map_dicts

list of dictionaries mapping dbs to relationship classes for editing

Type:list
accept(self)[source]

Collect info from dialog and try to update items.

class widgets.custom_qdialog.EditRelationshipsDialog(parent, db_map_dicts, ref_class_key)[source]

Bases: widgets.custom_qdialog.EditOrRemoveItemsDialog, widgets.custom_qdialog.GetObjectsMixin

A dialog to query user’s preferences for updating relationships.

parent

data store widget

Type:DataStoreForm
db_map_dicts

list of dictionaries mapping dbs to relationships for editing

Type:list
ref_class_key

(class_name, object_class_name_list) for identifying the relationship class

Type:tuple
accept(self)[source]

Collect info from dialog and try to update items.

class widgets.custom_qdialog.RemoveTreeItemsDialog(parent, **kwargs)[source]

Bases: widgets.custom_qdialog.EditOrRemoveItemsDialog

A dialog to query user’s preferences for removing tree items.

parent

data store widget

Type:TreeViewForm
accept(self)[source]

Collect info from dialog and try to remove items.

class widgets.custom_qdialog.ManageParameterTagsDialog(parent)[source]

Bases: widgets.custom_qdialog.ManageItemsDialog

A dialog to query user’s preferences for managing parameter tags.

parent

data store widget

Type:TreeViewForm
create_check_boxes(self, start, stop)[source]

Create check boxes in remove column.

all_databases(self, row)[source]

Returns a list of db names available for a given row. Used by delegates.

accept(self)[source]

Collect info from dialog and try to update, remove, add items.

class widgets.custom_qdialog.CommitDialog(parent, *db_names)[source]

Bases: PySide2.QtWidgets.QDialog

A dialog to query user’s preferences for new commit.

parent

data store widget

Type:TreeViewForm
db_names

database names

Type:Iterable
receive_text_changed(self)[source]

Called when text changes in the commit msg text edit. Enable/disable commit button accordingly.