te::qt::widgets::DataSetTableModel Class Reference

A table model representing a te::da::DataSet. More...

#include <DataSetTableModel.h>

Inheritance diagram for te::qt::widgets::DataSetTableModel:

Public Member Functions

 DataSetTableModel (QObject *parent=0)
 Constructor. More...
 
void discardEditions ()
 Discard editions. More...
 
std::auto_ptr< te::da::DataSetgetEditions (const te::da::DataSetType *type, std::vector< std::set< int > > &ps)
 Returns a memory dataset to be saved. More...
 
te::da::ObjectIdSetgetObjectIdSet (const int &initRow, const int &finalRow)
 Returns the ObjectIdSet begining with row initRow and ending in finalRow. More...
 
PromotergetPromoter ()
 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, 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::DataSetm_dataset
 The dataset being used. More...
 
std::auto_ptr< Editor > m_editor
 Pointer to editor. More...
 
bool m_enabled
 Enabling flag. More...
 
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...
 
Promoterm_promoter
 Promoter to be used. More...
 
int m_rowCount
 Number of rows. More...
 

Detailed Description

A table model representing a te::da::DataSet.

Definition at line 68 of file DataSetTableModel.h.

Constructor & Destructor Documentation

te::qt::widgets::DataSetTableModel::DataSetTableModel ( QObject *  parent = 0)

Constructor.

virtual te::qt::widgets::DataSetTableModel::~DataSetTableModel ( )
virtual

Virtual destructor.

Member Function Documentation

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.

Parameters
typeDataSetType to construct memory dataset.
[out]psPositions of the columns edited for each row.
Returns
Memory dataset with editions.
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.

Parameters
initRowInitial row.
endRowFinal row.
Note
The caller WILL TAKE the ownership of the ObjectIdSet returned.
Promoter* te::qt::widgets::DataSetTableModel::getPromoter ( )

Returns the pointer to the promoter being used.

Returns
Pointer of the promoter being used.
Note
The caller of this method DOES NOT take the ownership of the pointer.
bool te::qt::widgets::DataSetTableModel::hasEditions ( ) const

Returns true if there are unsaved editions.

Returns
True if there are unsaved editions, false otherwise.
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,
const bool &  clearEditor = true 
)

Updates the data being used.

Parameters
dsetThe new data set to be used.
clearEditorTrue for reset editions, false to maintain it.
Note
This method DOES TAKE the ownership of dset.
void te::qt::widgets::DataSetTableModel::setEditable ( const bool &  editable)

Sets if the model is editable or not.

Parameters
editableTrue if the model is editable, false otherwise.
void te::qt::widgets::DataSetTableModel::setEnabled ( const bool &  enabled)

Enable or disable the dataset presentation.

Parameters
enabledTrue 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.

Parameters
pkeysPositions 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.

Member Data Documentation

int te::qt::widgets::DataSetTableModel::m_currentRow
mutableprotected

An internal row pointer.

Definition at line 197 of file DataSetTableModel.h.

te::da::DataSet* te::qt::widgets::DataSetTableModel::m_dataset
protected

The dataset being used.

Definition at line 195 of file DataSetTableModel.h.

std::auto_ptr<Editor> te::qt::widgets::DataSetTableModel::m_editor
protected

Pointer to editor.

Definition at line 211 of file DataSetTableModel.h.

bool te::qt::widgets::DataSetTableModel::m_enabled
protected

Enabling flag.

Definition at line 205 of file DataSetTableModel.h.

bool te::qt::widgets::DataSetTableModel::m_isEditable
protected

Flag that indicates if the model is editable.

Definition at line 209 of file DataSetTableModel.h.

bool te::qt::widgets::DataSetTableModel::m_OIdsVisible
protected

Oids icon visibility.

Definition at line 203 of file DataSetTableModel.h.

std::vector<size_t> te::qt::widgets::DataSetTableModel::m_pkeysColumns
protected

Primary key columns.

Definition at line 199 of file DataSetTableModel.h.

Promoter* te::qt::widgets::DataSetTableModel::m_promoter
protected

Promoter to be used.

Definition at line 201 of file DataSetTableModel.h.

int te::qt::widgets::DataSetTableModel::m_rowCount
protected

Number of rows.

Definition at line 207 of file DataSetTableModel.h.


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