spinetoolbox.widgets.custom_delegates
¶
Custom item delegates.
- author
Marin (KTH)
- date
1.9.2018
Module Contents¶
Classes¶
A delegate that places a fully functioning QCheckBox. |
|
A delegate that places a QCheckBox but draws a number instead of the check. |
- class spinetoolbox.widgets.custom_delegates.ComboBoxDelegate(items)[source]¶
Bases:
PySide2.QtWidgets.QStyledItemDelegate
- class spinetoolbox.widgets.custom_delegates.CheckBoxDelegate(parent, centered=True)[source]¶
Bases:
PySide2.QtWidgets.QStyledItemDelegate
A delegate that places a fully functioning QCheckBox.
- Parameters
parent (QWiget) –
centered (bool) – whether or not the checkbox should be center-aligned in the widget
- createEditor(self, parent, option, index)[source]¶
Important, otherwise an editor is created if the user clicks in this cell. ** Need to hook up a signal to the model.
- editorEvent(self, event, model, option, index)[source]¶
Change the data in the model and the state of the checkbox when user presses left mouse button and this cell is editable. Otherwise do nothing.
- class spinetoolbox.widgets.custom_delegates.RankDelegate(parent, centered=True)[source]¶
Bases:
CheckBoxDelegate
A delegate that places a QCheckBox but draws a number instead of the check.
- Parameters
parent (QWiget) –
centered (bool) – whether or not the checkbox should be center-aligned in the widget