All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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...
 
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...
 
void promote (const te::da::ObjectIdSet *oids)
 Promotes the rows identified by oids. More...
 
void setDataSet (te::da::DataSet *dset)
 Updates the data being used. 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...
 
bool m_enabled
 
bool m_OIdsVisible
 Oids icon visibility. More...
 
std::vector< size_t > m_pkeysColumns
 Primary key columns. More...
 
Promoterm_promoter
 Promoter to be used. More...
 

Detailed Description

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

Definition at line 62 of file DataSetTableModel.h.

Constructor & Destructor Documentation

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

Constructor.

Definition at line 120 of file DataSetTableModel.cpp.

References m_promoter.

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

Virtual destructor.

Definition at line 130 of file DataSetTableModel.cpp.

Member Function Documentation

int te::qt::widgets::DataSetTableModel::columnCount ( const QModelIndex &  parent) const

Definition at line 209 of file DataSetTableModel.cpp.

QVariant te::qt::widgets::DataSetTableModel::data ( const QModelIndex &  index,
int  role 
) const

Definition at line 214 of file DataSetTableModel.cpp.

Qt::ItemFlags te::qt::widgets::DataSetTableModel::flags ( const QModelIndex &  index) const

Definition at line 288 of file DataSetTableModel.cpp.

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.

Definition at line 171 of file DataSetTableModel.cpp.

References te::da::ObjectIdSet::add(), te::da::ObjectIdSet::addProperty(), te::da::GenerateOID(), and te::da::ObjectIdSet::getPropertyNames().

te::qt::widgets::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.

Definition at line 161 of file DataSetTableModel.cpp.

Referenced by te::qt::widgets::DataSetTableView::DataSetTableView().

QVariant te::qt::widgets::DataSetTableModel::headerData ( int  section,
Qt::Orientation  orientation,
int  role 
) const

Definition at line 246 of file DataSetTableModel.cpp.

References columnType(), and IsPkey().

bool te::qt::widgets::DataSetTableModel::insertColumns ( int  column,
int  count,
const QModelIndex &  parent = QModelIndex() 
)

Definition at line 305 of file DataSetTableModel.cpp.

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.

Definition at line 152 of file DataSetTableModel.cpp.

bool te::qt::widgets::DataSetTableModel::removeColumns ( int  column,
int  count,
const QModelIndex &  parent = QModelIndex() 
)

Definition at line 314 of file DataSetTableModel.cpp.

int te::qt::widgets::DataSetTableModel::rowCount ( const QModelIndex &  parent) const

Definition at line 204 of file DataSetTableModel.cpp.

bool te::qt::widgets::DataSetTableModel::setData ( const QModelIndex &  index,
const QVariant &  value,
int  role = Qt::EditRole 
)

Definition at line 300 of file DataSetTableModel.cpp.

void te::qt::widgets::DataSetTableModel::setDataSet ( te::da::DataSet dset)

Updates the data being used.

Parameters
dsetThe new data set to be used.
Note
This method DOES TAKE the ownership of dset.

Definition at line 136 of file DataSetTableModel.cpp.

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.

Definition at line 195 of file DataSetTableModel.cpp.

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.

Definition at line 147 of file DataSetTableModel.cpp.

void te::qt::widgets::DataSetTableModel::showOIdsVisible ( const bool &  visible)

Shows an icon for indentify the columns that are used for identify objects.

Definition at line 166 of file DataSetTableModel.cpp.

Member Data Documentation

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

An internal row pointer.

Definition at line 159 of file DataSetTableModel.h.

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

The dataset being used.

Definition at line 157 of file DataSetTableModel.h.

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

Definition at line 167 of file DataSetTableModel.h.

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

Oids icon visibility.

Definition at line 165 of file DataSetTableModel.h.

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

Primary key columns.

Definition at line 161 of file DataSetTableModel.h.

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

Promoter to be used.

Definition at line 163 of file DataSetTableModel.h.

Referenced by DataSetTableModel().


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