Logo Search packages:      
Sourcecode: webissues version File versions  Download package

WebIssues::TableItemModel Class Reference

#include <tableitemmodel.h>

List of all members.


Detailed Description

Item model for a tree view providing items from data tables.

This model connects one or more AbstractTableModel instances to provide an item model for a list of rows with nested rows from other tables.

The top level items can be either all rows from a table or rows matching the given foreign key value. They can be additionally filtered using an AbstractRowFilter.

Child items are rows from another table whose foreign key match the primary key of their parent item. Child tables can be nested to any level.

The list of columns for the entire model is stored in the ColumnList structure.

The model automatically updates itself when table models emit update signals.

Definition at line 51 of file tableitemmodel.h.


Public Types

enum  Roles { RowIdRole = Qt::UserRole, LevelRole, ColumnRole }

Public Member Functions

void addChildTableModel (AbstractTableModel *model, const RDB::ForeignIndexBase *index)
int columnCount (const QModelIndex &parent) const
const QList< Column > & columns () const
QVariant data (const QModelIndex &index, int role) const
QVariant headerData (int section, Qt::Orientation orientation, int role) const
QModelIndex index (int row, int column, const QModelIndex &parent) const
QModelIndex parent (const QModelIndex &index) const
AbstractTableModelrootTableModel () const
int rowCount (const QModelIndex &parent) const
void setColumns (const QList< Column > &columns)
void setRootTableModel (AbstractTableModel *model, const RDB::ForeignIndexBase *index, int parentId)
void setRootTableModel (AbstractTableModel *model, const RDB::UniqueIndexBase *index)
void setRowFilter (AbstractRowFilter *filter)
void sort (int column, Qt::SortOrder order)
Column sortColumn () const
Qt::SortOrder sortOrder () const
 TableItemModel (QObject *parent)
int totalCount () const
 ~TableItemModel ()

Private Slots

void updateRow (int id)
void updateRows ()
void updateTable ()

Private Member Functions

int addGroup (int level)
void addItemToGroup (int group, int id)
void attachTableModel (AbstractTableModel *model)
void buildAllIndexes ()
void buildChildIndexes (int group)
void buildRootIndex ()
CellIndex cellAt (const QModelIndex &index)
QModelIndex findCell (const CellIndex &cell)
void sortAllGroups ()
void sortGroup (int group)

Private Attributes

QList< const
RDB::ForeignIndexBase * > 
m_childIndexes
QList< Columnm_columns
AbstractRowFilterm_filter
const RDB::ForeignIndexBasem_foreignIndex
QList< ItemGroup > m_itemGroups
QList< AbstractTableModel * > m_models
int m_parentId
Column m_sortColumn
Qt::SortOrder m_sortOrder
int m_totalCount
const RDB::UniqueIndexBasem_uniqueIndex

Classes

struct  CellIndex
class  CompareItems
struct  Item
struct  ItemGroup

The documentation for this class was generated from the following files:

Generated by  Doxygen 1.6.0   Back to index