A table model representing a te::da::DataSet. More...
#include <DataSetTableModel.h>
Public Member Functions | |
DataSetTableModel (QObject *parent=0) | |
Constructor. More... | |
void | discardEditions () |
Discard editions. More... | |
std::auto_ptr< te::da::DataSet > | getEditions (const te::da::DataSetType *type, std::vector< std::set< int > > &ps) |
Returns a memory dataset to be saved. More... | |
te::da::ObjectIdSet * | getObjectIdSet (const int &initRow, const int &finalRow) |
Returns the ObjectIdSet begining with row initRow and ending in finalRow. More... | |
Promoter * | getPromoter () |
Returns the pointer to the promoter being used. More... | |
bool | hasEditions () const |
Returns true if there are unsaved editions. More... | |
void | promote (const te::da::ObjectIdSet *oids) |
Promotes the rows identified by oids. More... | |
void | setDataSet (te::da::DataSet *dset, te::common::CharEncoding enc, const bool &clearEditor=true) |
Updates the data being used. More... | |
void | setEditable (const bool &editable) |
Sets if the model is editable or not. More... | |
void | setEnabled (const bool &enabled) |
Enable or disable the dataset presentation. More... | |
void | setPkeysColumns (const std::vector< size_t > &pkeys) |
Sets the columns used as pkeys, for presentation purposes. More... | |
void | showOIdsVisible (const bool &visible) |
Shows an icon for indentify the columns that are used for identify objects. More... | |
virtual | ~DataSetTableModel () |
Virtual destructor. More... | |
QAbstractTableModel re-implementation methods. | |
Re-implementation of QAbstractTableModel methods. | |
int | rowCount (const QModelIndex &parent) const |
int | columnCount (const QModelIndex &parent) const |
QVariant | data (const QModelIndex &index, int role) const |
QVariant | headerData (int section, Qt::Orientation orientation, int role) const |
Qt::ItemFlags | flags (const QModelIndex &index) const |
bool | setData (const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) |
bool | insertColumns (int column, int count, const QModelIndex &parent=QModelIndex()) |
bool | removeColumns (int column, int count, const QModelIndex &parent=QModelIndex()) |
Protected Attributes | |
int | m_currentRow |
An internal row pointer. More... | |
te::da::DataSet * | m_dataset |
The dataset being used. More... | |
std::auto_ptr< Editor > | m_editor |
Pointer to editor. More... | |
bool | m_enabled |
Enabling flag. More... | |
te::common::CharEncoding | m_encoding |
bool | m_isEditable |
Flag that indicates if the model is editable. More... | |
bool | m_OIdsVisible |
Oids icon visibility. More... | |
std::vector< size_t > | m_pkeysColumns |
Primary key columns. More... | |
Promoter * | m_promoter |
Promoter to be used. More... | |
int | m_rowCount |
Number of rows. More... | |
A table model representing a te::da::DataSet.
Definition at line 68 of file DataSetTableModel.h.
te::qt::widgets::DataSetTableModel::DataSetTableModel | ( | QObject * | parent = 0 | ) |
Constructor.
|
virtual |
Virtual destructor.
int te::qt::widgets::DataSetTableModel::columnCount | ( | const QModelIndex & | parent | ) | const |
QVariant te::qt::widgets::DataSetTableModel::data | ( | const QModelIndex & | index, |
int | role | ||
) | const |
void te::qt::widgets::DataSetTableModel::discardEditions | ( | ) |
Discard editions.
Qt::ItemFlags te::qt::widgets::DataSetTableModel::flags | ( | const QModelIndex & | index | ) | const |
std::auto_ptr<te::da::DataSet> te::qt::widgets::DataSetTableModel::getEditions | ( | const te::da::DataSetType * | type, |
std::vector< std::set< int > > & | ps | ||
) |
Returns a memory dataset to be saved.
type | DataSetType to construct memory dataset. | |
[out] | ps | Positions of the columns edited for each row. |
te::da::ObjectIdSet* te::qt::widgets::DataSetTableModel::getObjectIdSet | ( | const int & | initRow, |
const int & | finalRow | ||
) |
Returns the ObjectIdSet begining with row initRow and ending in finalRow.
initRow | Initial row. |
endRow | Final row. |
Promoter* te::qt::widgets::DataSetTableModel::getPromoter | ( | ) |
Returns the pointer to the promoter being used.
bool te::qt::widgets::DataSetTableModel::hasEditions | ( | ) | const |
Returns true if there are unsaved editions.
QVariant te::qt::widgets::DataSetTableModel::headerData | ( | int | section, |
Qt::Orientation | orientation, | ||
int | role | ||
) | const |
bool te::qt::widgets::DataSetTableModel::insertColumns | ( | int | column, |
int | count, | ||
const QModelIndex & | parent = QModelIndex() |
||
) |
void te::qt::widgets::DataSetTableModel::promote | ( | const te::da::ObjectIdSet * | oids | ) |
Promotes the rows identified by oids.
oids The identifiers of the rows to be promoted.
bool te::qt::widgets::DataSetTableModel::removeColumns | ( | int | column, |
int | count, | ||
const QModelIndex & | parent = QModelIndex() |
||
) |
int te::qt::widgets::DataSetTableModel::rowCount | ( | const QModelIndex & | parent | ) | const |
bool te::qt::widgets::DataSetTableModel::setData | ( | const QModelIndex & | index, |
const QVariant & | value, | ||
int | role = Qt::EditRole |
||
) |
void te::qt::widgets::DataSetTableModel::setDataSet | ( | te::da::DataSet * | dset, |
te::common::CharEncoding | enc, | ||
const bool & | clearEditor = true |
||
) |
Updates the data being used.
dset | The new data set to be used. |
clearEditor | True for reset editions, false to maintain it. |
void te::qt::widgets::DataSetTableModel::setEditable | ( | const bool & | editable | ) |
Sets if the model is editable or not.
editable | True if the model is editable, false otherwise. |
void te::qt::widgets::DataSetTableModel::setEnabled | ( | const bool & | enabled | ) |
Enable or disable the dataset presentation.
enabled | True for show dataSet on table, false to hide it. |
void te::qt::widgets::DataSetTableModel::setPkeysColumns | ( | const std::vector< size_t > & | pkeys | ) |
Sets the columns used as pkeys, for presentation purposes.
pkeys | Positions of the columns that form the primary key. |
void te::qt::widgets::DataSetTableModel::showOIdsVisible | ( | const bool & | visible | ) |
Shows an icon for indentify the columns that are used for identify objects.
|
mutableprotected |
An internal row pointer.
Definition at line 199 of file DataSetTableModel.h.
|
protected |
The dataset being used.
Definition at line 195 of file DataSetTableModel.h.
|
protected |
Pointer to editor.
Definition at line 213 of file DataSetTableModel.h.
|
protected |
Enabling flag.
Definition at line 207 of file DataSetTableModel.h.
|
protected |
Definition at line 197 of file DataSetTableModel.h.
|
protected |
Flag that indicates if the model is editable.
Definition at line 211 of file DataSetTableModel.h.
|
protected |
Oids icon visibility.
Definition at line 205 of file DataSetTableModel.h.
|
protected |
Primary key columns.
Definition at line 201 of file DataSetTableModel.h.
|
protected |
Promoter to be used.
Definition at line 203 of file DataSetTableModel.h.
|
protected |
Number of rows.
Definition at line 209 of file DataSetTableModel.h.