All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
te::qt::widgets::DataSetTableView Class Reference

A customized table view for te::map::AbstractLayer objects. Uses a te::qt::widgets::DataSetModel as its model. More...

#include <DataSetTableView.h>

Inheritance diagram for te::qt::widgets::DataSetTableView:

Public Slots

void addColumn ()
 Add column to the table. More...
 
void removeColumn (const int &column)
 
void setAutoScrollEnabled (const bool &enable)
 Enable / disable auto-scroll. More...
 
void setOIdsColumnsVisible (const bool &visible)
 Shows or hides the icon sinalizing the columns that identify each row. More...
 
Table slot methods.

Methods to handle user interaction with table.

void hideColumn (const int &column)
 Hides the column at position column. More...
 
void showColumn (const int &column)
 Shows the hidden column. More...
 
void showAllColumns ()
 Shows all hidden columns. More...
 
void resetColumnsOrder ()
 Shows columns in the original order. More...
 
void highlightRow (const int &row, const bool &add)
 Used to highlight the data when the mouse is clicked over a row in the table. More...
 
void highlightRows (const int &initRow, const int &finalRow)
 Select all rows from initRow to finalRow. More...
 
void promote ()
 Promotes the highlighted rows. More...
 
void sortByColumns (const bool &asc)
 Sort by the selected columns. More...
 

Signals

void deselectOIds (te::da::ObjectIdSet *)
 
void selectOIds (te::da::ObjectIdSet *, const bool &)
 Emmite when objects was selected. More...
 

Public Member Functions

 DataSetTableView (QWidget *parent=0)
 Constructor. More...
 
void highlightOIds (const te::da::ObjectIdSet *oids)
 Highlights the objects identified by oids. More...
 
void setDataSet (te::da::DataSet *dset)
 Updates the data set being visualized. More...
 
void setLayer (const te::map::AbstractLayer *layer)
 Sets the layer to be presented. More...
 
virtual void setLayerSchema (const te::da::DataSetType *schema)
 Sets the schema of the data set. It is used to define the primary keys and create the ObjectIdSet. More...
 
virtual ~DataSetTableView ()
 Virtual destructor. More...
 

Protected Member Functions

void removeSelection (const int &initRow, const int &finalRow)
 

Protected Attributes

bool m_autoScrollEnabled
 
HighlightDelegatem_delegate
 Delegate used for rendering selected rows. More...
 
te::da::DataSetm_dset
 Previously promoted. More...
 
bool m_isPromoted
 Previously sorted. More...
 
bool m_isSorted
 Auto scroll enabling. More...
 
const te::map::AbstractLayerm_layer
 Pointer to the layer being presented. More...
 
DataSetTableModelm_model
 The model to be used. More...
 
TablePopupFilterm_popupFilter
 The menus popup filter. More...
 

Detailed Description

A customized table view for te::map::AbstractLayer objects. Uses a te::qt::widgets::DataSetModel as its model.

Note
We assume that the layer can return ALWAYS return a te::da::DataSet object with random access of it's values.

Definition at line 71 of file DataSetTableView.h.

Constructor & Destructor Documentation

te::qt::widgets::DataSetTableView::DataSetTableView ( QWidget *  parent = 0)
te::qt::widgets::DataSetTableView::~DataSetTableView ( )
virtual

Virtual destructor.

Definition at line 485 of file DataSetTableView.cpp.

Member Function Documentation

void te::qt::widgets::DataSetTableView::addColumn ( )
slot
void te::qt::widgets::DataSetTableView::deselectOIds ( te::da::ObjectIdSet )
signal
void te::qt::widgets::DataSetTableView::hideColumn ( const int &  column)
slot

Hides the column at position column.

Parameters
columnColumn to be hidden.

Definition at line 551 of file DataSetTableView.cpp.

void te::qt::widgets::DataSetTableView::highlightOIds ( const te::da::ObjectIdSet oids)

Highlights the objects identified by oids.

Parameters
oidsThe identifiers of rows to be highlighted.

Definition at line 537 of file DataSetTableView.cpp.

References te::da::ObjectIdSet::begin(), and te::da::ObjectIdSet::size().

void te::qt::widgets::DataSetTableView::highlightRow ( const int &  row,
const bool &  add 
)
slot

Used to highlight the data when the mouse is clicked over a row in the table.

Parameters
rowRow to be highlighted.
addTrue to add to selection, false to new selection.

Definition at line 585 of file DataSetTableView.cpp.

References te::da::ObjectIdSet::begin().

Referenced by DataSetTableView().

void te::qt::widgets::DataSetTableView::highlightRows ( const int &  initRow,
const int &  finalRow 
)
slot

Select all rows from initRow to finalRow.

Parameters
initRowthe begin row.
finalRowthe final row.
Note
It does not matter if initRow is less than finalRow.

Definition at line 612 of file DataSetTableView.cpp.

Referenced by DataSetTableView().

void te::qt::widgets::DataSetTableView::promote ( )
slot

Promotes the highlighted rows.

The rows highlighted are presented in the begining of the table.

Definition at line 637 of file DataSetTableView.cpp.

void te::qt::widgets::DataSetTableView::removeColumn ( const int &  column)
slot

Definition at line 758 of file DataSetTableView.cpp.

References GetDataSource(), and te::common::Exception::what().

void te::qt::widgets::DataSetTableView::removeSelection ( const int &  initRow,
const int &  finalRow 
)
protected

Definition at line 793 of file DataSetTableView.cpp.

void te::qt::widgets::DataSetTableView::resetColumnsOrder ( )
slot

Shows columns in the original order.

Definition at line 570 of file DataSetTableView.cpp.

void te::qt::widgets::DataSetTableView::selectOIds ( te::da::ObjectIdSet ,
const bool &   
)
signal

Emmite when objects was selected.

void te::qt::widgets::DataSetTableView::setAutoScrollEnabled ( const bool &  enable)
slot

Enable / disable auto-scroll.

Parameters
enableTrue for enable auto-scroll, false for disable it.

Definition at line 787 of file DataSetTableView.cpp.

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

Updates the data set being visualized.

Note that this DataSet MUST HAVE random access. The view DOES TAKE the ownership of the pointer.

Parameters
dsetThe new data set to be visualized.

Definition at line 508 of file DataSetTableView.cpp.

References GetGeometryColumnsPositions().

void te::qt::widgets::DataSetTableView::setLayer ( const te::map::AbstractLayer layer)

Sets the layer to be presented.

Parameters
layerPointer to the layer to be presented.

Definition at line 489 of file DataSetTableView.cpp.

References GetCapabilities(), GetDataSource(), and te::common::RANDOM.

void te::qt::widgets::DataSetTableView::setLayerSchema ( const te::da::DataSetType schema)
virtual

Sets the schema of the data set. It is used to define the primary keys and create the ObjectIdSet.

Parameters
schemaThe DataSetType to extract keys.

Definition at line 524 of file DataSetTableView.cpp.

References te::da::GetEmptyOIDSet(), and te::da::ObjectIdSet::getPropertyPos().

void te::qt::widgets::DataSetTableView::setOIdsColumnsVisible ( const bool &  visible)
slot

Shows or hides the icon sinalizing the columns that identify each row.

Parameters
visibleTrue for icon visible, false otherwise.

Definition at line 705 of file DataSetTableView.cpp.

void te::qt::widgets::DataSetTableView::showAllColumns ( )
slot

Shows all hidden columns.

Definition at line 561 of file DataSetTableView.cpp.

void te::qt::widgets::DataSetTableView::showColumn ( const int &  column)
slot

Shows the hidden column.

Parameters
columnColumn to be presented.

Definition at line 556 of file DataSetTableView.cpp.

void te::qt::widgets::DataSetTableView::sortByColumns ( const bool &  asc)
slot

Sort by the selected columns.

Sort by the selected columns.

Parameters
ascTrue for ascendent order, false for descendent.

Definition at line 660 of file DataSetTableView.cpp.

References GetDataSet(), and te::common::Exception::what().

Member Data Documentation

bool te::qt::widgets::DataSetTableView::m_autoScrollEnabled
protected

Definition at line 236 of file DataSetTableView.h.

HighlightDelegate* te::qt::widgets::DataSetTableView::m_delegate
protected

Delegate used for rendering selected rows.

Definition at line 234 of file DataSetTableView.h.

Referenced by DataSetTableView().

te::da::DataSet* te::qt::widgets::DataSetTableView::m_dset
protected

Previously promoted.

Definition at line 239 of file DataSetTableView.h.

bool te::qt::widgets::DataSetTableView::m_isPromoted
protected

Previously sorted.

Definition at line 238 of file DataSetTableView.h.

bool te::qt::widgets::DataSetTableView::m_isSorted
protected

Auto scroll enabling.

Definition at line 237 of file DataSetTableView.h.

const te::map::AbstractLayer* te::qt::widgets::DataSetTableView::m_layer
protected

Pointer to the layer being presented.

Definition at line 235 of file DataSetTableView.h.

DataSetTableModel* te::qt::widgets::DataSetTableView::m_model
protected

The model to be used.

Definition at line 232 of file DataSetTableView.h.

Referenced by DataSetTableView().

TablePopupFilter* te::qt::widgets::DataSetTableView::m_popupFilter
protected

The menus popup filter.

Definition at line 233 of file DataSetTableView.h.

Referenced by DataSetTableView().


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