spinetoolbox.widgets.custom_qtreeview

Classes for custom QTreeView.

author:
  1. Marin (KTH)
date:

25.4.2018

Module Contents

class spinetoolbox.widgets.custom_qtreeview.CopyTreeView(parent)[source]

Bases: PySide2.QtWidgets.QTreeView

Custom QTreeView class with copy support.

Initialize the view.

copy(self)[source]

Copy current selection to clipboard in excel format.

class spinetoolbox.widgets.custom_qtreeview.EntityTreeView(parent)[source]

Bases: spinetoolbox.widgets.custom_qtreeview.CopyTreeView

Custom QTreeView class for object tree in DataStoreForm.

parent

The parent of this view

Type:QWidget

Initialize the view.

edit_key_pressed[source]
edit(self, index, trigger, event)[source]

Send signal instead of editing item, so DataStoreForm can catch this signal and open a custom QDialog for edition.

class spinetoolbox.widgets.custom_qtreeview.StickySelectionEntityTreeView[source]

Bases: spinetoolbox.widgets.custom_qtreeview.EntityTreeView

Custom QTreeView class for object tree in DataStoreForm.

parent

The parent of this view

Type:QWidget
mousePressEvent(self, event)[source]

Overrides selection behaviour if the user has selected sticky selection in Settings. If sticky selection is enabled, multi-selection is enabled when selecting items in the Object tree. Pressing the Ctrl-button down, enables single selection. If sticky selection is disabled, single selection is enabled and pressing the Ctrl-button down enables multi-selection.

Parameters:event (QMouseEvent) –
class spinetoolbox.widgets.custom_qtreeview.ReferencesTreeView(parent)[source]

Bases: PySide2.QtWidgets.QTreeView

Custom QTreeView class for ‘References’ in Data Connection properties.

parent

The parent of this view

Type:QWidget

Initialize the view.

files_dropped[source]
del_key_pressed[source]
dragEnterEvent(self, event)[source]

Accept file drops from the filesystem.

dragMoveEvent(self, event)[source]

Accept event.

dropEvent(self, event)[source]

Emit files_dropped signal with a list of files for each dropped url.

keyPressEvent(self, event)[source]

Overridden method to make the view support deleting items with a delete key.

class spinetoolbox.widgets.custom_qtreeview.DataTreeView(parent)[source]

Bases: PySide2.QtWidgets.QTreeView

Custom QTreeView class for ‘Data’ in Data Connection properties.

parent

The parent of this view

Type:QWidget

Initialize the view.

files_dropped[source]
del_key_pressed[source]
dragEnterEvent(self, event)[source]

Accept file drops from the filesystem.

dragMoveEvent(self, event)[source]

Accept event.

dropEvent(self, event)[source]

Emit files_dropped signal with a list of files for each dropped url.

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

keyPressEvent(self, event)[source]

Overridden method to make the view support deleting items with a delete key.

class spinetoolbox.widgets.custom_qtreeview.SourcesTreeView(parent)[source]

Bases: PySide2.QtWidgets.QTreeView

Custom QTreeView class for ‘Sources’ in Tool specification editor widget.

parent

The parent of this view

Type:QWidget

Initialize the view.

files_dropped[source]
del_key_pressed[source]
dragEnterEvent(self, event)[source]

Accept file and folder drops from the filesystem.

dragMoveEvent(self, event)[source]

Accept event.

dropEvent(self, event)[source]

Emit files_dropped signal with a list of files for each dropped url.

keyPressEvent(self, event)[source]

Overridden method to make the view support deleting items with a delete key.

class spinetoolbox.widgets.custom_qtreeview.CustomTreeView(parent)[source]

Bases: PySide2.QtWidgets.QTreeView

Custom QTreeView class for Tool specification editor form to enable keyPressEvent.

parent

The parent of this view

Type:QWidget

Initialize the view.

del_key_pressed[source]
keyPressEvent(self, event)[source]

Overridden method to make the view support deleting items with a delete key.