iblqt.core.DataFrameTableModel
- class iblqt.core.DataFrameTableModel[source]
Bases:
QAbstractTableModel
A Qt TableModel for Pandas DataFrames.
- Variables:
dataFrame (
Property
) – The DataFrame containing the models data.
- columnCount(parent=None)[source]
Get the number of columns in the model.
- Parameters:
parent (
QModelIndex
, optional) – The parent index.- Returns:
The number of columns.
- Return type:
- data(index, role=0)[source]
Get the data for the specified index.
- Parameters:
index (
QModelIndex
) – The index of the data.role (
int
, optional) – The role of the data.
- Returns:
The data for the specified index.
- Return type:
Any
orNone
- getDataFrame()[source]
Get the underlying DataFrame.
- Returns:
The DataFrame represented by the model.
- Return type:
DataFrame
- headerData(section, orientation=1, role=0)[source]
Get the header data for the specified section.
- Parameters:
section (
int
) – The section index.orientation (
Orientation
, optional) – The orientation of the header. Defaults to Horizontal.role (
int
, optional) – The role of the header data. Only DisplayRole is supported at this time.
- Returns:
The header data.
- Return type:
Any
orNone
- rowCount(parent=None)[source]
Get the number of rows in the model.
- Parameters:
parent (
QModelIndex
, optional) – The parent index.- Returns:
The number of rows.
- Return type:
- setData(index, value, role=0)[source]
Set data at the specified index with the given value.
- Parameters:
index (
QModelIndex
) – The index where the data will be set.value (
Any
) – The new value to be set at the specified index.role (
int
, optional) – The role of the data. Only DisplayRole is supported at this time.
- Returns:
Returns true if successful; otherwise returns false.
- Return type:
- setDataFrame(dataFrame)[source]
Set a new DataFrame.
- Parameters:
dataFrame (
DataFrame
) – The new DataFrame to be set.
- dataFrame: pyqtProperty
The DataFrame containing the models data.