The ColumnIndexList class is a container/list of ehm_dal::column_data::Column
indexes from ehm_dal::column_data::ColumnData
. It provides a convenient way of creating a list of various columns from one or more ehm_dal::column_data::ColumnData
. In other words, it represents a list of column indexes from one or more tables.
More...
#include <column_index_list.h>
|
| ColumnIndexList (std::shared_ptr< ehm_dal::tables::AbstractTable > table) |
| Constructs a ColumnIndexList using all columns from table
|
|
void | add (std::shared_ptr< ehm_dal::tables::AbstractTable > table, const qint32 column_index) |
| Adds the column_index from the table to the column list.
|
|
void | add (std::shared_ptr< ehm_dal::tables::AbstractTable > table, const std::vector< qint32 > &column_indexes) |
| Adds all of the column_indexes from the table to the column list.
|
|
void | addAll (std::shared_ptr< ehm_dal::tables::AbstractTable > table) |
| Adds all columns from the table to the column list.
|
|
const Column * | column (const qint32 column_index) const |
| Returns a raw pointer to the Column with a column index of column_index .
|
|
std::optional< qint32 > | columnId (const qint32 column_index) const |
| Returns the column id of the Column with a column index of column_index .
|
|
QModelIndex | index (const qint32 row, const qint32 column_index) const |
| Returns a QModelIndex for row and column_index using the table to which column_index relates. This is equivalent to ehm_dal::tables::AbstractTable::index(row, column_index) .
|
|
QModelIndex | index (const qint32 row, const qint32 column_index, const qint32 parent_row, const qint32 parent_column=0) const |
| Returns a QModelIndex for row and column_index with a parent of parent_row and parent_column using the table to which column_index relates. This is equivalent to ehm_dal::tables::AbstractTable::index(row, column_index, QModelIndex(parent_row, parent_column)) .
|
|
std::shared_ptr< ehm_dal::tables::AbstractTable > | table (const qint32 column_index) const |
| Returns a shared_pointer to the AbstractTable relating tocolumn_index .
|
|
qint32 | columnCount () const |
| Returns the number of columns.
|
|
qint32 | rowCount (const qint32 table_index=0) const |
| Returns the number of rows for the selected table.
|
|
The ColumnIndexList class is a container/list of ehm_dal::column_data::Column
indexes from ehm_dal::column_data::ColumnData
. It provides a convenient way of creating a list of various columns from one or more ehm_dal::column_data::ColumnData
. In other words, it represents a list of column indexes from one or more tables.
◆ ColumnIndexList()
◆ add() [1/2]
Adds the column_index
from the table
to the column list.
- Parameters
-
table | to which the column relates. |
column_index | to add to the list. |
◆ add() [2/2]
void ehm_dal::column_data::ColumnIndexList::add |
( |
std::shared_ptr< ehm_dal::tables::AbstractTable > |
table, |
|
|
const std::vector< qint32 > & |
column_indexes |
|
) |
| |
Adds all of the column_indexes
from the table
to the column list.
- Parameters
-
table | to which the column relates. |
column_indexes | to add to the list. |
◆ addAll()
Adds all columns from the table
to the column list.
- Parameters
-
table | to which the columns relate |
◆ column()
const Column * ehm_dal::column_data::ColumnIndexList::column |
( |
const qint32 |
column_index | ) |
const |
Returns a raw pointer to the Column
with a column index of column_index
.
- Parameters
-
column_index | column index. |
◆ columnCount()
qint32 ehm_dal::column_data::ColumnIndexList::columnCount |
( |
| ) |
const |
Returns the number of columns.
- Returns
- column count
◆ columnId()
std::optional< qint32 > ehm_dal::column_data::ColumnIndexList::columnId |
( |
const qint32 |
column_index | ) |
const |
Returns the column id of the Column
with a column index of column_index
.
- Parameters
-
column_index | column index. |
- Returns
- column id
◆ index() [1/2]
QModelIndex ehm_dal::column_data::ColumnIndexList::index |
( |
const qint32 |
row, |
|
|
const qint32 |
column_index |
|
) |
| const |
Returns a QModelIndex
for row
and column_index
using the table to which column_index
relates. This is equivalent to ehm_dal::tables::AbstractTable::index(row, column_index)
.
- Parameters
-
row | Row of the table |
column_index | Column index of the table |
- Returns
QModelIndex
◆ index() [2/2]
QModelIndex ehm_dal::column_data::ColumnIndexList::index |
( |
const qint32 |
row, |
|
|
const qint32 |
column_index, |
|
|
const qint32 |
parent_row, |
|
|
const qint32 |
parent_column = 0 |
|
) |
| const |
Returns a QModelIndex
for row
and column_index
with a parent of parent_row
and parent_column
using the table to which column_index
relates. This is equivalent to ehm_dal::tables::AbstractTable::index(row, column_index, QModelIndex(parent_row, parent_column))
.
- Parameters
-
row | Row of the table |
column_index | Column index of the table |
parent_row | Parent row |
parent_column | Parent column (typically 0) |
- Returns
QModelIndex
◆ rowCount()
qint32 ehm_dal::column_data::ColumnIndexList::rowCount |
( |
const qint32 |
table_index = 0 | ) |
const |
Returns the number of rows for the selected table.
- Returns
- row count
◆ table()
Returns a shared_pointer to the AbstractTable
relating tocolumn_index
.
- Parameters
-
- Returns
- shared_ptr to
AbstractTable