DataTableModel

class sofia_redux.pipeline.gui.widgets.DataTableModel(data, parent=None)[source]

Bases: QAbstractTableModel

Model for the File Information table view.

Initialize the data model.

Parameters:
dataOrderedDict

Keys are the column headers; values are the row items. Format is that of the redux.reduction.Reduction data_id attribute.

parentQWidget, optional

Parent widget.

Methods Summary

columnCount([parent])

Return the total number of columns of data.

data(index[, role])

Retrieve table data by index.

headerData(col, orientation[, role])

Retrieve column data.

rowCount([parent])

Return the total number of rows of data.

Methods Documentation

columnCount(parent=None)[source]

Return the total number of columns of data.

Parameters:
parentQWidget, optional

Parent widget.

Returns:
int

The number of columns in the table.

data(index, role=0)[source]

Retrieve table data by index.

Parameters:
indexQModelIndex

Data index to retrieve.

roleint, optional

Qt display role.

Returns:
str or None

If index is valid, a string representation of the data at the index value is returned. If not, None is returned.

headerData(col, orientation, role=0)[source]

Retrieve column data.

Parameters:
colint

Column name to retrieve.

orientationint

Qt orientation.

roleint, optional

Qt display role.

Returns:
str or None

Column name if orientation and role are valid; otherwise None.

rowCount(parent=None)[source]

Return the total number of rows of data.

Parameters:
parentQWidget, optional

Parent widget.

Returns:
int

The number of rows in the table.