spinetoolbox.widgets.project_item_drag

Classes for custom QListView.

author
  1. Marin (KTH)

date

14.11.2018

Module Contents

Classes

ProjectItemDragMixin

Custom class with dragging support.

ProjectItemButtonBase

Custom class with dragging support.

ProjectItemButton

Custom class with dragging support.

ProjectItemSpecButton

Custom class with dragging support.

ShadeMixin

ShadeProjectItemSpecButton

Custom class with dragging support.

ShadeButton

_ChoppedIcon

_ChoppedIconEngine

ProjectItemSpecArray

An array of ProjectItemSpecButton that can be expanded/collapsed.

class spinetoolbox.widgets.project_item_drag.ProjectItemDragMixin(*args, **kwargs)[source]

Custom class with dragging support.

drag_about_to_start[source]
mouseMoveEvent(self, event)[source]

Start dragging action if needed

mouseReleaseEvent(self, event)[source]

Forget drag start position

class spinetoolbox.widgets.project_item_drag.ProjectItemButtonBase(toolbox, item_type, icon, parent=None)[source]

Bases: ProjectItemDragMixin, PySide2.QtWidgets.QToolButton

Custom class with dragging support.

set_colored_icons(self, colored)[source]
_handle_drag_about_to_start(self)[source]
mousePressEvent(self, event)[source]

Register drag start position

abstract _make_mime_data_text(self)[source]
class spinetoolbox.widgets.project_item_drag.ProjectItemButton(toolbox, item_type, icon, parent=None)[source]

Bases: ProjectItemButtonBase

Custom class with dragging support.

double_clicked[source]
_make_mime_data_text(self)[source]
mouseDoubleClickEvent(self, event)[source]
class spinetoolbox.widgets.project_item_drag.ProjectItemSpecButton(toolbox, item_type, icon, spec_name='', parent=None)[source]

Bases: ProjectItemButtonBase

Custom class with dragging support.

set_orientation(self, orientation)[source]
property spec_name(self)[source]
_make_mime_data_text(self)[source]
contextMenuEvent(self, event)[source]
mouseDoubleClickEvent(self, event)[source]
class spinetoolbox.widgets.project_item_drag.ShadeMixin[source]
paintEvent(self, ev)[source]
class spinetoolbox.widgets.project_item_drag.ShadeProjectItemSpecButton(toolbox, item_type, icon, spec_name='', parent=None)[source]

Bases: ShadeMixin, ProjectItemSpecButton

Custom class with dragging support.

clone(self)[source]
class spinetoolbox.widgets.project_item_drag.ShadeButton[source]

Bases: ShadeMixin, PySide2.QtWidgets.QToolButton

class spinetoolbox.widgets.project_item_drag._ChoppedIcon(icon, size)[source]

Bases: PySide2.QtGui.QIcon

update(self)[source]
class spinetoolbox.widgets.project_item_drag._ChoppedIconEngine(icon, size)[source]

Bases: PySide2.QtGui.QIconEngine

update(self)[source]
pixmap(self, size, mode, state)[source]
class spinetoolbox.widgets.project_item_drag.ProjectItemSpecArray(toolbox, model, item_type, icon)[source]

Bases: PySide2.QtWidgets.QToolBar

An array of ProjectItemSpecButton that can be expanded/collapsed.

Parameters
set_colored_icons(self, colored)[source]
_update_button_visible_icon_color(self)[source]
set_color(self, color)[source]
paintEvent(self, ev)[source]
_get_first_chopped_index(self)[source]

Returns the index of the first chopped action (chopped = not drawn because of space).

Returns

list(QAction) int or NoneType

_add_filling(self, actions, ind)[source]

Adds a button to fill empty space after the last visible action.

Parameters
  • actions (list(QAction)) – actions

  • ind (int or NoneType) – index of the first chopped one or None if all are visible

_get_filling(self, previous)[source]

Returns the position and size of the filling widget.

Parameters

previous (QWidget) – last visible widget

Returns

position x int: position y int: width int: height

Return type

int

_populate_extension_menu(self, actions, ind)[source]

Populates extension menu with chopped actions.

Parameters
  • actions (list(QAction)) – actions

  • ind (int or NoneType) – index of the first chopped one or None if all are visible

showEvent(self, ev)[source]
_update_button_geom(self, orientation=None)[source]

Updates geometry of buttons given the orientation

Parameters

orientation (Qt.Orientation) –

_show_spec_form(self, _checked=False)[source]
toggle_visibility(self, _checked=False)[source]
set_visible(self, visible)[source]
_insert_specs(self, parent, first, last)[source]
_remove_specs(self, parent, first, last)[source]
_reset_specs(self)[source]
_add_spec(self, row)[source]