EHM DAL 0.2.5
Data abstraction layer for Eastside Hockey Manager
Loading...
Searching...
No Matches
ehm_dal::tables::AbstractBaseModel Class Reference
Inheritance diagram for ehm_dal::tables::AbstractBaseModel:

Public Types

enum class  AbstractTableModelType : quint8 { AbstractClass , GameTable , GameChildTable , GameChildTreeTable }
 

Public Member Functions

 AbstractBaseModel (ehm_dal::column_data::ColumnData *column_data=new ehm_dal::column_data::ColumnData(), QObject *parent=nullptr)
 
ehm_dal::column_data::ColumnDatacolumnData ()
 Returns the ehm_dal::column_data::ColumnData.
 
ehm_dal::column_data::ColumnDataconstColumnData () const
 
qint32 columnCount (const QModelIndex &parent=QModelIndex()) const override
 Returns the number of columns in the table.
 
qint32 size () const
 
Qt::ItemFlags flags (const QModelIndex &index) const override
 Returns the item flags for the given index.
 
QVariant headerData (qint32 section, Qt::Orientation orientation, qint32 role=Qt::DisplayRole) const override
 Returns the data for the given role and section in the header with the specified orientation. For horizontal headers, the section number corresponds to the column number. Similarly, for vertical headers, the section number corresponds to the row number.
 
std::unique_ptr< QSortFilterProxyModel > proxy ()
 
virtual QString modelName () const
 
virtual constexpr AbstractTableModelType modelType () const
 

Protected Member Functions

bool emitModifiedColumns (const qint32 row, const std::vector< qint32 > &modified_columns, const QList< qint32 > &modified_roles=QList< qint32 >())
 

Member Function Documentation

◆ columnCount()

qint32 ehm_dal::tables::AbstractBaseModel::columnCount ( const QModelIndex &  parent = QModelIndex()) const
override

Returns the number of columns in the table.

Parameters
parentNot used
Returns
the column count.

◆ columnData()

ehm_dal::column_data::ColumnData * ehm_dal::tables::AbstractBaseModel::columnData ( )

Returns the ehm_dal::column_data::ColumnData.

Returns
a raw pointer to the ehm_dal::column_data::ColumnData.

◆ flags()

Qt::ItemFlags ehm_dal::tables::AbstractBaseModel::flags ( const QModelIndex &  index) const
override

Returns the item flags for the given index.

Parameters
indexIndex of the selected row and column
Returns
the Qt::ItemFlags.

◆ headerData()

QVariant ehm_dal::tables::AbstractBaseModel::headerData ( qint32  section,
Qt::Orientation  orientation,
qint32  role = Qt::DisplayRole 
) const
override

Returns the data for the given role and section in the header with the specified orientation. For horizontal headers, the section number corresponds to the column number. Similarly, for vertical headers, the section number corresponds to the row number.

Parameters
sectionRow or column, depending on orientation
orientationHorizontal or vertical orientation
roleItem data role. Typically Qt::DisplayRole
Returns
the header data.