All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties 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 saveEditions ()
 Saves all editions to the dataset. More...
 
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...
 
void setPromotionEnabled (const bool &enable)
 Enable / disable promotion. More...
 
Table slot methods.

Methods to handle user interaction with table.

void createHistogram (const int &column)
 Creates a new histogram based on the data at position column. More...
 
void hideColumn (const int &column)
 Hides the column at position column. More...
 
void showColumn (const int &column)
 Shows the hidden column. More...
 
void renameColumn (const int &column)
 Rename a column of the table. More...
 
void retypeColumn (const int &column)
 Changes teh type of a column in the table. More...
 
void changeColumnData (const int &column)
 Shows the change column data dialog. 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 (const bool &scroll=false)
 Promotes the highlighted rows. More...
 
void sortByColumns (const bool &asc)
 Sort by the selected columns. More...
 

Signals

void createChartDisplay (te::qt::widgets::ChartDisplayWidget *)
 
void deselectOIds (te::da::ObjectIdSet *)
 
void selectOIds (te::da::ObjectIdSet *, const bool &, te::gm::Envelope *)
 Emmite when objects was selected. More...
 

Public Member Functions

 DataSetTableView (QWidget *parent=0)
 Constructor. More...
 
bool hasEditions () const
 Returns true if there are unsaved editions e false if there is not. More...
 
void highlightOIds (const te::da::ObjectIdSet *oids)
 Highlights the objects identified by oids. More...
 
void setDataSet (te::da::DataSet *dset, const bool &clearEditor=true)
 Updates the data set being visualized. More...
 
void setHighlightColor (const QColor &color)
 Update the color to be used. More...
 
void setLayer (const te::map::AbstractLayer *layer, const bool &clearEditor=true)
 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
 Auto scroll enabling. More...
 
HighlightDelegatem_delegate
 Delegate used for rendering selected rows. More...
 
bool m_doScroll
 Flag to force or not scrolling. More...
 
te::da::DataSetm_dset
 Data set being used. More...
 
const te::map::AbstractLayerm_layer
 Pointer to the layer being presented. More...
 
DataSetTableModelm_model
 The model to be used. More...
 
bool m_orderAsc
 Flag that sinalizes if the it is sorted in ascending sorting. More...
 
std::vector< std::string > m_orderby
 Order by columns. More...
 
TablePopupFilterm_popupFilter
 The menus popup filter. More...
 
bool m_promotionEnabled
 Promotion enabled. More...
 
bool m_resetOrder
 Flag that sinalizes if there's is no sort. 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 78 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 751 of file DataSetTableView.cpp.

References te::serialize::xml::Save().

Member Function Documentation

void te::qt::widgets::DataSetTableView::addColumn ( )
slot
void te::qt::widgets::DataSetTableView::changeColumnData ( const int &  column)
slot
void te::qt::widgets::DataSetTableView::createChartDisplay ( te::qt::widgets::ChartDisplayWidget )
signal
void te::qt::widgets::DataSetTableView::createHistogram ( const int &  column)
slot

Creates a new histogram based on the data at position column.

Parameters
columnColumn that provides the data for the histogram.

Definition at line 871 of file DataSetTableView.cpp.

References te::qt::widgets::createHistogramDisplay(), te::dt::DATETIME_TYPE, and te::dt::STRING_TYPE.

void te::qt::widgets::DataSetTableView::deselectOIds ( te::da::ObjectIdSet )
signal
bool te::qt::widgets::DataSetTableView::hasEditions ( ) const

Returns true if there are unsaved editions e false if there is not.

Definition at line 866 of file DataSetTableView.cpp.

Referenced by TablePopupFilter::eventFilter().

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

Hides the column at position column.

Parameters
columnColumn to be hidden.

Definition at line 908 of file DataSetTableView.cpp.

Referenced by HideGeometryColumns().

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 839 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 1043 of file DataSetTableView.cpp.

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

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 1080 of file DataSetTableView.cpp.

References GetExtent().

Referenced by DataSetTableView().

void te::qt::widgets::DataSetTableView::promote ( const bool &  scroll = false)
slot

Promotes the highlighted rows.

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

Parameters
Iftrue, scrolls to the top of the table.

Definition at line 1110 of file DataSetTableView.cpp.

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

Definition at line 1237 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 1281 of file DataSetTableView.cpp.

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

Rename a column of the table.

Parameters
columnIndex of the column to be renamed.

Definition at line 918 of file DataSetTableView.cpp.

References GetDataSource(), te::qt::widgets::RenameColumnDialog::getNewName(), te::qt::widgets::RenameColumnDialog::getOldName(), and te::qt::widgets::RenameColumnDialog::setOldColumnName().

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

Shows columns in the original order.

Definition at line 1028 of file DataSetTableView.cpp.

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

Saves all editions to the dataset.

Definition at line 1296 of file DataSetTableView.cpp.

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

void te::qt::widgets::DataSetTableView::selectOIds ( te::da::ObjectIdSet ,
const bool &  ,
te::gm::Envelope  
)
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 1266 of file DataSetTableView.cpp.

void te::qt::widgets::DataSetTableView::setDataSet ( te::da::DataSet dset,
const bool &  clearEditor = true 
)

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.
clearEditorTrue for reset editions, false to maintain it.

Definition at line 811 of file DataSetTableView.cpp.

References HideGeometryColumns().

void te::qt::widgets::DataSetTableView::setHighlightColor ( const QColor &  color)

Update the color to be used.

Parameters
colorThe new color;

Definition at line 859 of file DataSetTableView.cpp.

Referenced by te::qt::af::DataSetTableDockWidget::DataSetTableDockWidget().

void te::qt::widgets::DataSetTableView::setLayer ( const te::map::AbstractLayer layer,
const bool &  clearEditor = true 
)

Sets the layer to be presented.

Parameters
layerPointer to the layer to be presented.
clearEditorTrue for reset editions, false to maintain it.

Definition at line 768 of file DataSetTableView.cpp.

References GetCapabilities(), GetDataSet(), GetDataSource(), and te::map::AbstractLayer::getSchema().

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 824 of file DataSetTableView.cpp.

References te::da::GetEmptyOIDSet().

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 1183 of file DataSetTableView.cpp.

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

Enable / disable promotion.

If enabled all selected rows will be moved to te top of the table.

Parameters
enableTrue to enable promotion, false to disable it

Definition at line 1271 of file DataSetTableView.cpp.

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

Shows all hidden columns.

Definition at line 1019 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 913 of file DataSetTableView.cpp.

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

Sort by the selected columns.

Parameters
ascTrue for ascendent order, false for descendent.

Definition at line 1131 of file DataSetTableView.cpp.

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

Member Data Documentation

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

Auto scroll enabling.

Definition at line 298 of file DataSetTableView.h.

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

Delegate used for rendering selected rows.

Definition at line 296 of file DataSetTableView.h.

Referenced by DataSetTableView().

bool te::qt::widgets::DataSetTableView::m_doScroll
protected

Flag to force or not scrolling.

Definition at line 299 of file DataSetTableView.h.

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

Data set being used.

Definition at line 301 of file DataSetTableView.h.

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

Pointer to the layer being presented.

Definition at line 297 of file DataSetTableView.h.

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

The model to be used.

Definition at line 294 of file DataSetTableView.h.

Referenced by DataSetTableView().

bool te::qt::widgets::DataSetTableView::m_orderAsc
protected

Flag that sinalizes if the it is sorted in ascending sorting.

Definition at line 303 of file DataSetTableView.h.

std::vector<std::string> te::qt::widgets::DataSetTableView::m_orderby
protected

Order by columns.

Definition at line 302 of file DataSetTableView.h.

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

The menus popup filter.

Definition at line 295 of file DataSetTableView.h.

Referenced by DataSetTableView().

bool te::qt::widgets::DataSetTableView::m_promotionEnabled
protected

Promotion enabled.

Definition at line 300 of file DataSetTableView.h.

bool te::qt::widgets::DataSetTableView::m_resetOrder
protected

Flag that sinalizes if there's is no sort.

Definition at line 304 of file DataSetTableView.h.


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