spinetoolbox.spine_db_editor.widgets.custom_editors
Custom editors for model/view programming.
Module Contents
Classes
A custom QLineEdit to handle data from models. |
|
A custom QLineEdit to handle data from models. |
|
Line editor that is visible on Pivot view's header tables due to a clever hack. |
|
A delegate for placing a CustomLineEditor on the first row of SearchBarEditor. |
|
A Google-like search bar, implemented as a QTableView with a _CustomLineEditDelegate in the first row. |
|
A Google-like search bar, implemented as a QTableView with a _CustomLineEditDelegate in the first row. |
|
A check list editor. |
|
A delegate to highlight decorations in a QListWidget. |
|
An editor to let the user select an icon and a color for an object_class. |
- class spinetoolbox.spine_db_editor.widgets.custom_editors.EventFilterForCatchingRollbackShortcut[source]
Bases:
PySide6.QtCore.QObject
- class spinetoolbox.spine_db_editor.widgets.custom_editors.CustomComboBoxEditor(parent)[source]
Bases:
PySide6.QtWidgets.QComboBox
- class spinetoolbox.spine_db_editor.widgets.custom_editors.CustomLineEditor(parent)[source]
Bases:
PySide6.QtWidgets.QLineEdit
A custom QLineEdit to handle data from models.
- class spinetoolbox.spine_db_editor.widgets.custom_editors.ParameterValueLineEditor(parent)[source]
Bases:
CustomLineEditor
A custom QLineEdit to handle data from models.
- class spinetoolbox.spine_db_editor.widgets.custom_editors.PivotHeaderTableLineEditor(parent=None)[source]
Bases:
CustomLineEditor
Line editor that is visible on Pivot view’s header tables due to a clever hack.
- Parameters
parent (QWidget, optional) – parent widget
- class spinetoolbox.spine_db_editor.widgets.custom_editors._CustomLineEditDelegate[source]
Bases:
PySide6.QtWidgets.QStyledItemDelegate
A delegate for placing a CustomLineEditor on the first row of SearchBarEditor.
- class spinetoolbox.spine_db_editor.widgets.custom_editors.SearchBarEditor(parent, tutor=None)[source]
Bases:
PySide6.QtWidgets.QTableView
A Google-like search bar, implemented as a QTableView with a _CustomLineEditDelegate in the first row.
- Parameters
parent (QWidget, optional) – parent widget
tutor (QWidget, optional) – another widget used for positioning.
- set_data(current, items)[source]
Populates model.
- Parameters
current (str) – item that is currently selected from given items
items (Sequence of str) – items to show in the list
- set_base_offset(offset)[source]
Changes the base offset that is applied to the editor’s position.
- Parameters
offset (QPoint) – new offset
- update_geometry(option)[source]
Updates geometry.
- Parameters
option (QStyleOptionViewItem) – style information
- _handle_delegate_text_edited(text)[source]
Filters model as the first row is being edited.
- Parameters
text (str) – text the user has entered on the first row
- _proxy_model_filter_accepts_row(source_row, source_parent)[source]
Always accept first row while filtering the rest.
- Parameters
source_row (int) – source row index
source_parent (QModelIndex) – parent index for source row
- Returns
True if row is accepted, False otherwise
- Return type
bool
- class spinetoolbox.spine_db_editor.widgets.custom_editors.BooleanSearchBarEditor(parent, tutor=None)[source]
Bases:
SearchBarEditor
A Google-like search bar, implemented as a QTableView with a _CustomLineEditDelegate in the first row.
- Parameters
parent (QWidget, optional) – parent widget
tutor (QWidget, optional) – another widget used for positioning.
- class spinetoolbox.spine_db_editor.widgets.custom_editors.CheckListEditor(parent, tutor=None)[source]
Bases:
PySide6.QtWidgets.QTableView
A check list editor.
- Parameters
parent (QWidget) – parent widget
tutor (QWidget, optional) – a widget that helps in positioning
- toggle_selected(index)[source]
Adds or removes given index from selected items.
- Parameters
index (QModelIndex) – index to toggle
- class spinetoolbox.spine_db_editor.widgets.custom_editors._IconPainterDelegate[source]
Bases:
PySide6.QtWidgets.QStyledItemDelegate
A delegate to highlight decorations in a QListWidget.
- class spinetoolbox.spine_db_editor.widgets.custom_editors.IconColorEditor(parent)[source]
Bases:
PySide6.QtWidgets.QDialog
An editor to let the user select an icon and a color for an object_class.
- Parameters
parent (QWidget) – parent widget