|
SciDAVis
1.D4
|
Model for the access to a Table. More...
#include <TableModel.h>
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) |
| Column * | column (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::Table * | d_table |
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.
Custom data roles used in addition to Qt::ItemDataRole.
| MaskingRole |
bool determining whether the cell is masked |
| FormulaRole |
the cells formula |
| CommentRole |
the column comment (for headerData()) |
|
explicit |
| TableModel::~TableModel | ( | ) |
Destructor.
|
inline |
References d_formula_mode.
Referenced by TableView::activateFormulaMode().
| Column * TableModel::column | ( | int | index | ) |
References future::Table::column(), and d_table.
| int TableModel::columnCount | ( | const QModelIndex & | parent = QModelIndex() | ) | const |
References future::Table::columnCount(), and d_table.
Referenced by TableCommentsHeaderModel::columnCount().
| QVariant TableModel::data | ( | const QModelIndex & | index, |
| int | role | ||
| ) | const |
| Qt::ItemFlags TableModel::flags | ( | const QModelIndex & | index | ) | const |
|
inline |
References d_formula_mode.
Referenced by TableView::formulaModeActive().
|
privateslot |
Referenced by TableModel().
|
privateslot |
Referenced by TableModel().
|
privateslot |
Referenced by TableModel().
|
privateslot |
Referenced by TableModel().
|
privateslot |
References index().
Referenced by TableModel().
|
privateslot |
Referenced by TableModel().
|
privateslot |
Referenced by TableModel().
|
privateslot |
Referenced by TableModel().
|
privateslot |
Referenced by TableModel().
| QVariant TableModel::headerData | ( | int | section, |
| Qt::Orientation | orientation, | ||
| int | role | ||
| ) | const |
References d_table, and future::Table::headerData().
Referenced by TableCommentsHeaderModel::headerData().
| 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 |
References d_table, and future::Table::rowCount().
Referenced by TableView::eventFilter(), and TableCommentsHeaderModel::rowCount().
| bool TableModel::setData | ( | const QModelIndex & | index, |
| const QVariant & | value, | ||
| int | role | ||
| ) |
|
private |
Toggle flag for formula mode.
Referenced by activateFormulaMode(), data(), formulaModeActive(), and setData().
|
private |
Referenced by column(), columnCount(), data(), headerData(), rowCount(), setData(), and TableModel().
1.8.1