filter_widget

Widgets that represent Filter Actions

class camelot.view.controls.filter_widget.AbstractFilterWidget[source]

Overwrite some methods to avoid to many state updates

get_value()[source]
Returns:a list of selected values
class camelot.view.controls.filter_widget.ComboBoxFilterWidget(action, gui_context, parent)[source]

Flter widget based on a QGroupBox

class camelot.view.controls.filter_widget.GroupBoxFilterWidget(action, gui_context, parent)[source]

A box containing a filter that can be applied on a table view, this filter is based on the distinct values in a certain column

class camelot.view.controls.filter_widget.OperatorFilterWidget(action, gui_context, default_value_1, default_value_2, parent)[source]

Widget that allows applying various filter operators on a field

Parameters:
  • cls – the class on which the filter will be applied
  • field_name – the name fo the field on the class on which to filter
  • field_attributes – a dictionary of field attributes for this filter
  • default_operator – a default operator to be used, on of the attributes of the python module operator, such as operator.eq
  • default_value_1 – a default value for the first editor (in case the default operator in unary or binary
  • default_value_2 – a default value for the second editor (in case the default operator is binary)
  • parent – the parent QtWidgets.QWidget
combobox_changed(index)[source]

Whenever the combobox changes, show or hide the appropriate editors and emit the filter_changed signal

update_editors()[source]

Show or hide the editors according to the operator arity