spinetoolbox.widgets.custom_qwidgets

Custom QWidgets for Filtering and Zooming.

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

4.12.2018

Module Contents

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

Init class.

Parameters:parent (QWidget) –
class spinetoolbox.widgets.custom_qwidgets.DataToValueFilterWidget(parent, data_to_value, show_empty=True)[source]

Bases: spinetoolbox.widgets.custom_qwidgets.FilterWidgetBase

Init class.

Parameters:
  • parent (QWidget) –
  • data_to_value (method) – a method to translate item data to a value for display role
class spinetoolbox.widgets.custom_qwidgets.LazyFilterWidget(parent, source_model, show_empty=True)[source]

Bases: spinetoolbox.widgets.custom_qwidgets.FilterWidgetBase

Init class.

Parameters:
set_model(self)[source]
class spinetoolbox.widgets.custom_qwidgets.ZoomWidgetAction(parent=None)[source]

Bases: PySide2.QtWidgets.QWidgetAction

A zoom widget action.

Class constructor.

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

Runs when the zoom widget action is hovered. Hides other menus under the parent widget which are being shown. This is the default behavior for hovering QAction, but for some reason it’s not the case for hovering QWidgetAction.

class spinetoolbox.widgets.custom_qwidgets.ZoomWidget(parent=None)[source]

Bases: PySide2.QtWidgets.QWidget

Class constructor.

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

Overridden method.