rayoptics.qtgui.pytablemodel module

Table model supporting data content via python eval() fct

class PyTableModel(root, rootEvalStr, colEvalStr, rowHeaders, colHeaders, colFormats, is_editable=False, get_num_rows=None, get_row_headers=None, drop_actions=None)[source]

Bases: QAbstractTableModel

Table model supporting data content via python eval() fct.

Model interface for table view of list structures.

root

object or list at the root of the eval() string

rootEvalStr

string that is concatentated to the root name and passed to the eval() function. This will accomodate dynamic name changes.

colEvalStr

string that is concatentated to the root name and passed to the eval() function. There should be a replacement field, i.e. {} where the row value will be substituted using the str.format() function.

rowHeaders

list of strings, length defines number of rows in the table

colHeaders

list of strings, length defines number of columns in the table

colFormats

format strings to be used to format data in each column

is_editable

if true, items are editable

get_num_rows

if not None, a function that returns the number of rows in the table

get_row_headers

if not None, a function that returns the row headers for the table

update
rowCount(self, parent: PySide6.QtCore.QModelIndex | PySide6.QtCore.QPersistentModelIndex = Invalid(PySide6.QtCore.QModelIndex)) int[source]
columnCount(self, parent: PySide6.QtCore.QModelIndex | PySide6.QtCore.QPersistentModelIndex = Invalid(PySide6.QtCore.QModelIndex)) int[source]
headerData(self, section: int, orientation: PySide6.QtCore.Qt.Orientation, role: int = Instance(Qt.DisplayRole)) Any[source]
flags(self, index: PySide6.QtCore.QModelIndex | PySide6.QtCore.QPersistentModelIndex) PySide6.QtCore.Qt.ItemFlag[source]
get_root_object()[source]
data(self, index: PySide6.QtCore.QModelIndex | PySide6.QtCore.QPersistentModelIndex, role: int = Instance(Qt.DisplayRole)) Any[source]
setData(self, index: PySide6.QtCore.QModelIndex | PySide6.QtCore.QPersistentModelIndex, value: Any, role: int = Instance(Qt.EditRole)) bool[source]
staticMetaObject = PySide6.QtCore.QMetaObject("PyTableModel" inherits "QAbstractTableModel": Methods:   #76 type=Signal, signature=update(PyObject,int), parameters=PyObject, int )