spinetoolbox.widgets.custom_editors
¶
Custom editors for model/view programming.
- author
Marin (KTH)
- date
2.9.2018
Module Contents¶
Classes¶
A custom QLineEdit to handle data from models. |
|
A custom QLineEdit to handle data from models. |
|
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 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.widgets.custom_editors.CustomLineEditor[source]¶
Bases:
PySide2.QtWidgets.QLineEdit
A custom QLineEdit to handle data from models.
- class spinetoolbox.widgets.custom_editors.ParameterValueLineEditor[source]¶
Bases:
CustomLineEditor
A custom QLineEdit to handle data from models.
- class spinetoolbox.widgets.custom_editors._CustomLineEditDelegate[source]¶
Bases:
PySide2.QtWidgets.QStyledItemDelegate
A delegate for placing a CustomLineEditor on the first row of SearchBarEditor.
- class spinetoolbox.widgets.custom_editors.SearchBarEditor(parent, tutor=None)[source]¶
Bases:
PySide2.QtWidgets.QTableView
A Google-like search bar, implemented as a QTableView with a _CustomLineEditDelegate in the first row.
Initializes instance.
- Parameters
parent (QWidget) – parent widget
tutor (QWidget, optional) – another widget used for positioning.
- set_data(self, current, items)[source]¶
Populates model.
- Parameters
current (str) – item that is currently selected from given items
items (Sequence(str)) – items to show in the list
- class spinetoolbox.widgets.custom_editors.CheckListEditor(parent, tutor=None, ranked=False)[source]¶
Bases:
PySide2.QtWidgets.QTableView
A check list editor.
Initialize class.
- toggle_selected(self, index)[source]¶
Adds or removes given index from selected items.
- Parameters
index (QModelIndex) – index to toggle
- class spinetoolbox.widgets.custom_editors._IconPainterDelegate[source]¶
Bases:
PySide2.QtWidgets.QStyledItemDelegate
A delegate to highlight decorations in a QListWidget.
- class spinetoolbox.widgets.custom_editors.IconColorEditor(parent)[source]¶
Bases:
PySide2.QtWidgets.QDialog
An editor to let the user select an icon and a color for an object_class.
Init class.