spinetoolbox.widgets.custom_qwidgets

Custom QWidgets for Filtering and Zooming.

author:
  1. Vennström (VTT)
date:

4.12.2018

Module Contents

Classes

FilterWidgetBase Filter widget class.
SimpleFilterWidget Filter widget class.
CustomWidgetAction Class constructor.
TitleWidgetAction A widget action for adding titled sections to menus.
ZoomWidgetAction A widget action with plus, minus, and reset buttons.
RotateWidgetAction A widget action with rotate left and right buttons.
ActionToolbarWidget Class constructor.
class spinetoolbox.widgets.custom_qwidgets.FilterWidgetBase(parent)[source]

Bases: PySide2.QtWidgets.QWidget

Filter widget class.

Init class.

Parameters:parent (QWidget) –
okPressed[source]
cancelPressed[source]
connect_signals(self)[source]
save_state(self)[source]

Saves the state of the FilterCheckboxListModel.

reset_state(self)[source]

Sets the state of the FilterCheckboxListModel to saved state.

clear_filter(self)[source]

Selects all items in FilterCheckBoxListModel.

has_filter(self)[source]

Returns true if any item is filtered in FilterCheckboxListModel false otherwise.

set_filter_list(self, data)[source]

Sets the list of items to filter.

_apply_filter(self)[source]

Apply current filter and save state.

_cancel_filter(self)[source]

Cancel current edit of filter and set the state to the stored state.

_filter_list(self)[source]

Filter list with current text.

_text_edited(self, new_text)[source]

Callback for edit text, starts/restarts timer. Start timer after text is edited, restart timer if text is edited before last time out.

class spinetoolbox.widgets.custom_qwidgets.SimpleFilterWidget(parent, show_empty=True)[source]

Bases: spinetoolbox.widgets.custom_qwidgets.FilterWidgetBase

Filter widget class.

Init class.

Parameters:parent (QWidget) –
class spinetoolbox.widgets.custom_qwidgets.CustomWidgetAction(parent=None)[source]

Bases: PySide2.QtWidgets.QWidgetAction

Class constructor.

Parameters:parent (QWidget) – the widget’s parent
_handle_hovered(self)[source]

Hides other menus that might be shown in the parent widget and repaints it. This is to emulate the behavior of QAction.

class spinetoolbox.widgets.custom_qwidgets.TitleWidgetAction(title, parent=None)[source]

Bases: spinetoolbox.widgets.custom_qwidgets.CustomWidgetAction

A widget action for adding titled sections to menus.

Class constructor.

Parameters:parent (QWidget) – the widget’s parent
H_MARGIN = 6[source]
V_MARGIN = 2[source]
class spinetoolbox.widgets.custom_qwidgets.ZoomWidgetAction(parent=None)[source]

Bases: spinetoolbox.widgets.custom_qwidgets.CustomWidgetAction

A widget action with plus, minus, and reset buttons. Used to create zoom actions for menus.

Class constructor.

Parameters:parent (QWidget) – the widget’s parent
minus_pressed[source]
plus_pressed[source]
reset_pressed[source]
_handle_action_triggered(self, name)[source]
class spinetoolbox.widgets.custom_qwidgets.RotateWidgetAction(parent=None)[source]

Bases: spinetoolbox.widgets.custom_qwidgets.CustomWidgetAction

A widget action with rotate left and right buttons. Used to create rotate actions for menus.

Class constructor.

Parameters:parent (QWidget) – the widget’s parent
clockwise_pressed[source]
anticlockwise_pressed[source]
_handle_action_triggered(self, name)[source]
class spinetoolbox.widgets.custom_qwidgets.ActionToolbarWidget(text, actions, parent=None)[source]

Bases: PySide2.QtWidgets.QWidget

Class constructor.

Parameters:parent (QWidget) – the widget’s parent
action_triggered[source]
paintEvent(self, event)[source]

Overridden method.