The Table class represents a database table and provides access to rows of data.
More...
|
| AbstractTable (const QString &table_name, const ehm_dal::tables::TableIndex table_id, const ehm_dal::tables::TableType table_type, ehm_dal::column_data::ColumnData *column_data=new ehm_dal::column_data::ColumnData()) |
| Constructs a new database table.
|
|
void | addChildItem (const qint32 parent_row_id, std::shared_ptr< ehm_dal::schema::AbstractTableItem > item, const ehm_dal::tables::TableIndex child_table) |
|
QVariant | childData (const QModelIndex &index, qint32 role, ehm_dal::column_data::ColumnData *column_data, const ehm_dal::tables::TableIndex child_table) |
|
qint32 | childItemId (const qint32 parent_row_id, const ehm_dal::tables::TableIndex child_table) const |
|
virtual qint32 | childRowCount (const qint32 parent_row_id, const ehm_dal::tables::TableIndex child_table) const |
|
bool | setChildData (const QModelIndex &index, const QVariant &value, const qint32 role, std::vector< qint32 > &modified_columns, ehm_dal::column_data::ColumnData *column_data, const ehm_dal::tables::TableIndex child_table) |
|
bool | read (QDataStream &in) |
| Reads the table data from a QDataStream (wrapper for AbstractTable::readStream ).
|
|
bool | readData (QByteArray *data) |
| Reads the table data from a QByteArray .
|
|
ehm_dal::data_types::Pointer | find (const qint32 value, const quint16 column) |
| Finds the first row which has a value in the chosen column matching value .
|
|
ehm_dal::data_types::Pointer | find (const QString &text, const quint16 column, const Qt::CaseSensitivity cs=Qt::CaseInsensitive) |
| Finds the first row which has text in the chosen column exactly matching text . The entirety of the string much match the text to constitute a match.
|
|
ehm_dal::data_types::Pointer | findContains (const QString &text, const quint16 column, const Qt::CaseSensitivity cs=Qt::CaseInsensitive) |
| Finds the first row which has text in the chosen column containing text . This function performs a sub-string search.
|
|
std::vector< ehm_dal::data_types::Pointer > | findAll (const qint32 value, const quint16 column) |
| Finds all rows which have a value in the chosen column matching value .
|
|
std::vector< ehm_dal::data_types::Pointer > | findAll (const QString &text, const quint16 column, const Qt::CaseSensitivity cs=Qt::CaseInsensitive) |
| Finds all rows which have text in the chosen column exactly matching text . The entirety of the string much match the text to constitute a match.
|
|
std::vector< ehm_dal::data_types::Pointer > | findAllContains (const QString &text, const quint16 column, const Qt::CaseSensitivity cs=Qt::CaseInsensitive) |
| Finds all rows which have text in the chosen column containing text . This function performs a sub-string search.
|
|
QVariant | data (const QModelIndex &index, qint32 role=Qt::DisplayRole) const override |
| Returns the data stored under the given role for the item referred to by the index.
|
|
bool | isValidRow (const qint32 row_id) const |
|
QString | text (const qint32 row) const |
|
qint32 | rowCount (const QModelIndex &parent=QModelIndex()) const override |
| Returns the number of rows in the table.
|
|
std::shared_ptr< ehm_dal::schema::AbstractTableItem > | pointer (const qint32 row) |
| Returns a shared pointer to the selected row of the table.
|
|
const TableAttributes * | attributes () const |
|
bool | init () |
| Initialises the table.
|
|
bool | moveRows (const QModelIndex &source_parent, qint32 source_row, qint32 count, const QModelIndex &destination_parent, qint32 destination_child) override |
|
qint32 | parentRowId (const QModelIndex &index) const |
|
virtual std::shared_ptr< ehm_dal::tables::AbstractTable > | parentTable () const |
|
virtual ParentTableRelationshipType | parentTableRelationship () const |
|
virtual void | setParentTable (const std::shared_ptr< ehm_dal::tables::AbstractTable > parent_table, const ParentTableRelationshipType relationship) |
|
bool | removeRows (qint32 row, qint32 count, const QModelIndex &parent=QModelIndex()) override |
|
bool | setData (const QModelIndex &index, const QVariant &value, qint32 role=Qt::EditRole) override |
|
| AbstractBaseModel (ehm_dal::column_data::ColumnData *column_data=new ehm_dal::column_data::ColumnData(), QObject *parent=nullptr) |
|
ehm_dal::column_data::ColumnData * | columnData () |
| Returns the ehm_dal::column_data::ColumnData .
|
|
ehm_dal::column_data::ColumnData * | constColumnData () 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 |
|
The Table class represents a database table and provides access to rows of data.
Access to each row of data is via QModelIndex
. Table inherits from QAbstractTableModel
and is there compatible with Qt's Model/View framework.