widgets.custom_delegates

Custom item delegates.

author:
  1. Marin (KTH)
date:

1.9.2018

Module Contents

class widgets.custom_delegates.ComboBoxDelegate(parent, choices)[source]

Bases: PySide2.QtWidgets.QItemDelegate

createEditor(self, parent, option, index)[source]
paint(self, painter, option, index)[source]
setEditorData(self, editor, index)[source]
setModelData(self, editor, model, index)[source]
updateEditorGeometry(self, editor, option, index)[source]
currentItemChanged(self)[source]
class widgets.custom_delegates.LineEditDelegate[source]

Bases: PySide2.QtWidgets.QItemDelegate

A delegate that places a fully functioning QLineEdit.

parent

either data store or spine datapackage widget

Type:QMainWindow
data_committed[source]
createEditor(self, parent, option, index)[source]

Return CustomLineEditor. Set up a validator depending on datatype.

setEditorData(self, editor, index)[source]

Init the line editor with previous data from the index.

setModelData(self, editor, model, index)[source]

Send signal.

class widgets.custom_delegates.CheckBoxDelegate(parent, centered=True)[source]

Bases: PySide2.QtWidgets.QItemDelegate

A delegate that places a fully functioning QCheckBox.

parent

either toolbox or spine datapackage widget

Type:QMainWindow
centered

whether or not the checkbox should be center-aligned in the widget

Type:bool
data_committed[source]
createEditor(self, parent, option, index)[source]

Important, otherwise an editor is created if the user clicks in this cell. ** Need to hook up a signal to the model.

paint(self, painter, option, index)[source]

Paint a checkbox without the label.

editorEvent(self, event, model, option, index)[source]

Change the data in the model and the state of the checkbox when user presses left mouse button and this cell is editable. Otherwise do nothing.

setModelData(self, editor, model, index)[source]

Do nothing. Model data is updated by handling the data_committed signal.

get_checkbox_rect(self, option)[source]
class widgets.custom_delegates.ParameterDelegate(parent)[source]

Bases: PySide2.QtWidgets.QItemDelegate

A custom delegate for the parameter models and views in TreeViewForm.

parent

tree or graph view form

Type:DataStoreForm
data_committed[source]
parameter_value_editor_requested[source]
setModelData(self, editor, model, index)[source]

Send signal.

close_editor(self, editor, index, model)[source]
updateEditorGeometry(self, editor, option, index)[source]
create_parameter_value_editor(self, parent, index)[source]

Returns a CustomLineEditor if the data from index is not of special type. Otherwise, emit the signal to request a standalone ParameterValueEditor from parent widget.

connect_editor_signals(self, editor, index)[source]

Connect editor signals if necessary.

class widgets.custom_delegates.ObjectParameterValueDelegate[source]

Bases: widgets.custom_delegates.ParameterDelegate

A delegate for the object parameter value model and view in TreeViewForm.

parent

tree or graph view form

Type:DataStoreForm
createEditor(self, parent, option, index)[source]

Return editor.

class widgets.custom_delegates.ObjectParameterDefinitionDelegate[source]

Bases: widgets.custom_delegates.ParameterDelegate

A delegate for the object parameter definition model and view in TreeViewForm.

parent

tree or graph view form

Type:DataStoreForm
createEditor(self, parent, option, index)[source]

Return editor.

class widgets.custom_delegates.RelationshipParameterValueDelegate[source]

Bases: widgets.custom_delegates.ParameterDelegate

A delegate for the relationship parameter value model and view in TreeViewForm.

parent

tree or graph view form

Type:DataStoreForm
createEditor(self, parent, option, index)[source]

Return editor.

class widgets.custom_delegates.RelationshipParameterDefinitionDelegate[source]

Bases: widgets.custom_delegates.ParameterDelegate

A delegate for the object parameter definition model and view in TreeViewForm.

parent

tree or graph view form

Type:DataStoreForm
createEditor(self, parent, option, index)[source]

Return editor.

class widgets.custom_delegates.ManageItemsDelegate(parent)[source]

Bases: PySide2.QtWidgets.QItemDelegate

A custom delegate for the model in {Add/Edit}ItemDialogs.

parent

parent dialog

Type:ManageItemsDialog
data_committed[source]
setModelData(self, editor, model, index)[source]

Send signal.

close_editor(self, editor, index, model)[source]
updateEditorGeometry(self, editor, option, index)[source]
connect_editor_signals(self, editor, index)[source]

Connect editor signals if necessary.

class widgets.custom_delegates.ManageObjectClassesDelegate(parent)[source]

Bases: widgets.custom_delegates.ManageItemsDelegate

A delegate for the model and view in {Add/Edit}ObjectClassesDialog.

parent

parent dialog

Type:ManageItemsDialog
icon_color_editor_requested[source]
createEditor(self, parent, option, index)[source]

Return editor.

paint(self, painter, option, index)[source]

Get a pixmap from the index data and paint it in the middle of the cell.

class widgets.custom_delegates.ManageObjectsDelegate[source]

Bases: widgets.custom_delegates.ManageItemsDelegate

A delegate for the model and view in {Add/Edit}ObjectsDialog.

parent

parent dialog

Type:ManageItemsDialog
createEditor(self, parent, option, index)[source]

Return editor.

class widgets.custom_delegates.ManageRelationshipClassesDelegate[source]

Bases: widgets.custom_delegates.ManageItemsDelegate

A delegate for the model and view in {Add/Edit}RelationshipClassesDialog.

parent

parent dialog

Type:ManageItemsDialog
createEditor(self, parent, option, index)[source]

Return editor.

class widgets.custom_delegates.ManageRelationshipsDelegate[source]

Bases: widgets.custom_delegates.ManageItemsDelegate

A delegate for the model and view in {Add/Edit}RelationshipsDialog.

parent

parent dialog

Type:ManageItemsDialog
createEditor(self, parent, option, index)[source]

Return editor.

class widgets.custom_delegates.RemoveTreeItemsDelegate[source]

Bases: widgets.custom_delegates.ManageItemsDelegate

A delegate for the model and view in RemoveTreeItemsDialog.

parent

parent dialog

Type:ManageItemsDialog
createEditor(self, parent, option, index)[source]

Return editor.

class widgets.custom_delegates.ManageParameterTagsDelegate[source]

Bases: widgets.custom_delegates.ManageItemsDelegate

A delegate for the model and view in ManageParameterTagsDialog.

parent

parent dialog

Type:ManageItemsDialog
createEditor(self, parent, option, index)[source]

Return editor.

class widgets.custom_delegates.ForeignKeysDelegate(parent)[source]

Bases: PySide2.QtWidgets.QItemDelegate

A QComboBox delegate with checkboxes.

parent

spine datapackage widget

Type:SpineDatapackageWidget
data_committed[source]
close_field_name_list_editor(self, editor, index, model)[source]
createEditor(self, parent, option, index)[source]

Return editor.

setEditorData(self, editor, index)[source]

Set editor data.

setModelData(self, editor, model, index)[source]

Send signal.