Table widget
Displays and edits parameter types holding NumPy record arrays in tabular form.
Overview
quatm/GUI/widgets/table_parameter.py provides the table widget (table_parameter): it extends the parameter tree so that parameters holding NumPy record arrays can be displayed and edited in tabular form, and can be registered as a reusable custom parameter type via registerParameterType.
Components
| Component | Description |
|---|---|
table_parameterItem | Table-widget parameter item for editing record arrays (a WidgetParameterItem subclass) |
table_parameter | Table parameter type (a Parameter subclass), used together with the item above |
Key methods
| Method | Description |
|---|---|
makeWidget (table_parameterItem) | Creates a QTableWidget editor from the recArray dtype |
value / setValue (table_parameterItem) | Reads back cell by cell from the table / writes the array cell by cell |
valueChanged (table_parameterItem) | Refreshes the table and label when the parameter value changes |
setValue / valueIsDefault (table_parameter) | Sets the parameter value / tests whether it is the default value |
Usage
from quatm.GUI.widgets.table_parameter import table_parameter
param = table_parameter(name="records", value=recarray) # insert into the parameter tree
For a more complete description see Table parameter.