widgets.custom_editors¶
Custom editors for model/view programming.
| author: |
|
|---|---|
| date: | 2.9.2018 |
Module Contents¶
-
class
widgets.custom_editors.CustomLineEditor[source]¶ Bases:
PySide2.QtWidgets.QLineEditA custom QLineEdit to handle data from models.
-
parent¶ the widget that wants to edit the data
Type: QWidget
-
-
class
widgets.custom_editors.CustomComboEditor[source]¶ Bases:
PySide2.QtWidgets.QComboBoxA custom QComboBox to handle data from models.
-
parent¶ the widget that wants to edit the data
Type: QWidget
-
-
class
widgets.custom_editors.CustomLineEditDelegate(parent)[source]¶ Bases:
PySide2.QtWidgets.QItemDelegateA delegate for placing a CustomLineEditor on the first row of SearchBarEditor.
-
parent¶ search bar editor
Type: SearchBarEditor
-
-
class
widgets.custom_editors.SearchBarEditor(parent, elder_sibling=None, is_json=False)[source]¶ Bases:
PySide2.QtWidgets.QTableViewA Google-like search bar, implemented as a QTableView with a CustomLineEditDelegate in the first row.
-
parent¶ the parent for this widget
Type: QWidget
-
elder_sibling¶ another widget which is used to find this widget’s position.
Type: QWidget or NoneType
-
update_geometry(self)[source]¶ Update geometry. Resize the widget to optimal size, then adjust its position.
-
_proxy_model_filter_accepts_row(self, source_row, source_parent)[source]¶ Overridden method to always accept first row.
-
-
class
widgets.custom_editors.SearchBarDelegate(parent)[source]¶ Bases:
PySide2.QtWidgets.QItemDelegateA custom delegate to place a SearchBarEditor on each cell of a MultiSearchBarEditor.
-
parent¶ multi search bar editor
Type: MultiSearchBarEditor
-
-
class
widgets.custom_editors.MultiSearchBarEditor(parent, elder_sibling=None)[source]¶ Bases:
PySide2.QtWidgets.QTableViewA table view made of several Google-like search bars.
-
class
widgets.custom_editors.CheckListEditor(parent, elder_sibling=None)[source]¶ Bases:
PySide2.QtWidgets.QTableViewA check list editor.
-
class
widgets.custom_editors.JSONEditor(parent, elder_sibling, popup=False)[source]¶ Bases:
PySide2.QtWidgets.QTabWidgetA double JSON editor, featuring: - A QTextEdit for editing arbitrary json. - A QTableView for editing json array.
-
_view_key_press_event(self, event)[source]¶ Accept key events on the view to avoid weird behaviour, when trying to navigate outside of its limits.
-
eventFilter(self, widget, event)[source]¶ Intercept events to text_edit and table_view to enable consistent behavior.
-
check_focus(self)[source]¶ Called when either the text edit or the table view lose focus. Check if the focus is still on this widget (which would mean it was a tab change) otherwise emit signal so this is closed.
-
_handle_current_changed(self, index)[source]¶ Update json data on text edit or table view, and set focus.
-
-
class
widgets.custom_editors.IconPainterDelegate[source]¶ Bases:
PySide2.QtWidgets.QItemDelegateA delegate to highlight decorations in a QListWidget.
-
class
widgets.custom_editors.IconColorEditor(parent)[source]¶ Bases:
PySide2.QtWidgets.QDialogAn editor to let the user select an icon and a color for an object class.