SciDAVis  1.D4
Public Types | Public Member Functions | Private Attributes
TableModel Class Reference

Model for the access to a Table. More...

#include <TableModel.h>

List of all members.

Public Types

enum  CustomDataRole { MaskingRole = Qt::UserRole, FormulaRole = Qt::UserRole+1, CommentRole = Qt::UserRole+2 }
 Custom data roles used in addition to Qt::ItemDataRole. More...

Public Member Functions

void activateFormulaMode (bool on)
Columncolumn (int index)
bool formulaModeActive () const
 TableModel (future::Table *table)
 Constructor.
 ~TableModel ()
 Destructor.
Overloaded functions from QAbstractItemModel
Qt::ItemFlags flags (const QModelIndex &index) const
QVariant data (const QModelIndex &index, int role) const
QVariant headerData (int section, Qt::Orientation orientation, int role) const
int rowCount (const QModelIndex &parent=QModelIndex()) const
int columnCount (const QModelIndex &parent=QModelIndex()) const
bool setData (const QModelIndex &index, const QVariant &value, int role)
QModelIndex index (int row, int column, const QModelIndex &parent=QModelIndex()) const
QModelIndex parent (const QModelIndex &child) const

Private Slots

Handlers for events from Table
void handleColumnsAboutToBeInserted (int, QList< Column * >)
void handleColumnsInserted (int first, int count)
void handleColumnsAboutToBeRemoved (int first, int count)
void handleColumnsRemoved (int first, int count)
void handleRowsAboutToBeInserted (int before, int count)
void handleRowsInserted (int first, int count)
void handleRowsAboutToBeRemoved (int first, int count)
void handleRowsRemoved (int first, int count)
void handleDataChanged (int top, int left, int bottom, int right)

Private Attributes

bool d_formula_mode
 Toggle flag for formula mode.
future::Tabled_table

Detailed Description

Model for the access to a Table.

This is a model in the sense of Qt4 model/view framework which is used to access a Table object from any of Qt4s view classes, typically a QTableView. Its main purposes are translating Table signals into QAbstractItemModel signals and translating calls to the QAbstractItemModel read/write API into calls in the public API of Table. In many cases a pointer to the addressed column is obtained by calling Table::column() and the manipulation is done using the public API of column.


Member Enumeration Documentation

Custom data roles used in addition to Qt::ItemDataRole.

Enumerator:
MaskingRole 

bool determining whether the cell is masked

FormulaRole 

the cells formula

CommentRole 

the column comment (for headerData())


Constructor & Destructor Documentation

TableModel::TableModel ( future::Table table)
explicit
TableModel::~TableModel ( )

Destructor.


Member Function Documentation

void TableModel::activateFormulaMode ( bool  on)
inline
Column * TableModel::column ( int  index)

References future::Table::column(), and d_table.

int TableModel::columnCount ( const QModelIndex &  parent = QModelIndex()) const
QVariant TableModel::data ( const QModelIndex &  index,
int  role 
) const
Qt::ItemFlags TableModel::flags ( const QModelIndex &  index) const
bool TableModel::formulaModeActive ( ) const
inline

References d_formula_mode.

Referenced by TableView::formulaModeActive().

void TableModel::handleColumnsAboutToBeInserted ( int  before,
QList< Column * >  cols 
)
privateslot

Referenced by TableModel().

void TableModel::handleColumnsAboutToBeRemoved ( int  first,
int  count 
)
privateslot

Referenced by TableModel().

void TableModel::handleColumnsInserted ( int  first,
int  count 
)
privateslot

Referenced by TableModel().

void TableModel::handleColumnsRemoved ( int  first,
int  count 
)
privateslot

Referenced by TableModel().

void TableModel::handleDataChanged ( int  top,
int  left,
int  bottom,
int  right 
)
privateslot

References index().

Referenced by TableModel().

void TableModel::handleRowsAboutToBeInserted ( int  before,
int  count 
)
privateslot

Referenced by TableModel().

void TableModel::handleRowsAboutToBeRemoved ( int  first,
int  count 
)
privateslot

Referenced by TableModel().

void TableModel::handleRowsInserted ( int  first,
int  count 
)
privateslot

Referenced by TableModel().

void TableModel::handleRowsRemoved ( int  first,
int  count 
)
privateslot

Referenced by TableModel().

QVariant TableModel::headerData ( int  section,
Qt::Orientation  orientation,
int  role 
) const
QModelIndex TableModel::index ( int  row,
int  column,
const QModelIndex &  parent = QModelIndex() 
) const
QModelIndex TableModel::parent ( const QModelIndex &  child) const
int TableModel::rowCount ( const QModelIndex &  parent = QModelIndex()) const
bool TableModel::setData ( const QModelIndex &  index,
const QVariant &  value,
int  role 
)

Member Data Documentation

bool TableModel::d_formula_mode
private

Toggle flag for formula mode.

Referenced by activateFormulaMode(), data(), formulaModeActive(), and setData().

future::Table* TableModel::d_table
private

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