DbModel Pile
version 0.0.1
DbModel pile.
|
file dbmodeltbl.h date November 2015 author Nicu Tofan More...
#include <dbmodeltbl.h>
Public Member Functions | |
DbModelTbl () | |
Constructor. | |
DbModelTbl (DbTaew *meta_part, QSqlTableModel *model_part) | |
Constructor. | |
~DbModelTbl () | |
destructor | |
bool | isValid () const |
Tell if this instance is valid (found in database). | |
DbTaew * | metadata () const |
Metadata about main table or view. | |
void | setMetadata (DbTaew *value) |
Set metadata about main table or view. | |
QSqlTableModel * | sqlModel () const |
The undelying model. | |
void | setSqlModel (QSqlTableModel *value) |
Set the undelying model. | |
const DbColumn & | column (int colidx) const |
Get the column for a particular index. | |
const QString & | columnLabel (int colidx) const |
Get the column for a particular index. | |
bool | setColumnCallback (int column_index, DbColumn::Callback value) |
Set callback for a column. | |
DbColumn::Callback | columnCallback (int column_index) const |
Get callback for a column. | |
QString | tableName () const |
Get the column for a particular index. | |
int | rowCount () const |
Number of rows in the sql model. | |
QVariant | data (int row, int column, int role=Qt::DisplayRole) const |
Data from the sql model. | |
int | toRealIndex (int value) const |
Convert the index of a column to real index. | |
void | destroy () |
Clear internal components. | |
file dbmodeltbl.h date November 2015 author Nicu Tofan
file dbmodeltbl.cc date November 2015 author Nicu Tofan
brief Contains the definition for DbModelTbl class.Table data is stored only once with multiple references from columns.
brief Contains the implementation for DbModelTbl class.
Each table that is actually used by this model gets an entry of this kind in tables_
, with the first one always being the main table.
The instance may be invalid if the referenced table is not found (by name) in the database at initialization time (table()
).