qudi.util.models
This file contains Qt models for Python data structures.
Classes
|
Qt model storing a table in dictionaries |
|
Qt model storing a table in lists. |
- class qudi.util.models.DictTableModel(headers: str | Sequence[str])[source]
Bases:
PySide2.QtCore.QAbstractTableModelQt model storing a table in dictionaries
- columnCount(parent: QModelIndex | None = None) int[source]
Returns the number of data fields (columns)
- data(index: ~PySide2.QtCore.QModelIndex, role: <class 'PySide2.QtCore.Qt.ItemDataRole'>) Any[source]
Get data from model for a given cell. Data can have a role that affects display. Re-Implement in subclass in order to support anything else than the 2 default columns.
- flags(index: QModelIndex | None = None) ItemFlags[source]
Determines what can be done with the given indexed cell.
- get(*args)[source]
Get value for key from dictionary.
@param args: value for key, optional default return value
@return value: value for key from dict
- get_index_by_key(key: Any) int[source]
Get row index for dict key.
Warning: Row index for a key changes when keys with lower index are removed.
- headerData(section: int, orientation: <class 'PySide2.QtCore.Qt.Orientation'>, role: <class 'PySide2.QtCore.Qt.ItemDataRole'> | None = PySide2.QtCore.Qt.ItemDataRole.DisplayRole) Any[source]
Data for the table view headers
- pop(*args)[source]
Remove key from dictionary.
@param args: dict key to remove, optional default return value
@return value: value removed from dict
- staticMetaObject = <PySide2.QtCore.QMetaObject object>
- class qudi.util.models.ListTableModel(headers: str | Sequence[str])[source]
Bases:
PySide2.QtCore.QAbstractTableModelQt model storing a table in lists.
- data(index: ~PySide2.QtCore.QModelIndex, role: <class 'PySide2.QtCore.Qt.ItemDataRole'>) Any[source]
Get data from model for a given cell. Data can have a role that affects display.
- flags(index: QModelIndex) ItemFlags[source]
Determines what can be done with entry cells in the table view.
- headerData(section: int, orientation: <class 'PySide2.QtCore.Qt.Orientation'>, role: <class 'PySide2.QtCore.Qt.ItemDataRole'> | None = PySide2.QtCore.Qt.ItemDataRole.DisplayRole) Any[source]
Data for the table view headers
- insert(n, data)[source]
Insert a row into a table before the nth element.
- Parameters:
- nint
Index before which the row should be inserted.
- dataobject
Row to insert into the table.
- pop(n)[source]
Remove the nth row from a table.
- Parameters:
- nint
Index of the row to remove.
- Returns:
- object
Removed row.
- staticMetaObject = <PySide2.QtCore.QMetaObject object>