A customized table view for te::map::AbstractLayer objects. Uses a te::qt::widgets::DataSetModel as its model. More...
#include <DataSetTableView.h>
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 | createNormalDistribution (const int &column) |
Creates a new chart that displays the normal distribution 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 | getAcceptDrop () |
Gets accept drop flag. More... | |
bool | getDragDrop () |
Gets the drag drop flag. 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 | setAcceptDrop (bool b) |
Sets the drop on the horizontal header. More... | |
void | setDataSet (te::da::DataSet *dset, te::common::CharEncoding enc, const bool &clearEditor=true) |
Updates the data set being visualized. More... | |
void | setDragDrop (bool b) |
Sets the drag drop on the horizontal header. When the drag drop is enabled, you lose the ability to swap columns. More... | |
void | setHighlightColor (const QColor &color) |
Update the color to be used. More... | |
void | setLayer (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... | |
HighlightDelegate * | m_delegate |
Delegate used for rendering selected rows. More... | |
bool | m_doScroll |
Flag to force or not scrolling. More... | |
te::da::DataSet * | m_dset |
Data set being used. More... | |
te::common::CharEncoding | m_encoding |
te::map::AbstractLayer * | m_layer |
Pointer to the layer being presented. More... | |
DataSetTableModel * | m_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... | |
TablePopupFilter * | m_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... | |
A customized table view for te::map::AbstractLayer objects. Uses a te::qt::widgets::DataSetModel as its model.
Definition at line 80 of file DataSetTableView.h.
te::qt::widgets::DataSetTableView::DataSetTableView | ( | QWidget * | parent = 0 | ) |
Constructor.
parent | Qt widget parent. |
Definition at line 782 of file DataSetTableView.cpp.
References te::qt::widgets::DataSetTableModel::getPromoter(), highlightRow(), highlightRows(), m_delegate, m_model, m_popupFilter, te::qt::widgets::HighlightDelegate::setColor(), and te::qt::widgets::HighlightDelegate::setPromoter().
|
virtual |
Virtual destructor.
Definition at line 821 of file DataSetTableView.cpp.
References te::serialize::xml::Save().
|
slot |
Add column to the table.
Definition at line 1319 of file DataSetTableView.cpp.
References GetDataSource(), te::qt::widgets::AddColumnDialog::getNewProperty(), te::qt::widgets::AddColumnDialog::setTableName(), and te::common::Exception::what().
|
slot |
Shows the change column data dialog.
column | Index of the column to be updated. |
Definition at line 1103 of file DataSetTableView.cpp.
References te::qt::widgets::AlterDataDialog::alterAllData(), GetColumnsNames(), GetDataSource(), te::qt::widgets::AlterDataDialog::getExpression(), te::qt::widgets::AlterDataDialog::setDataColumns(), te::qt::widgets::AlterDataDialog::setSelectedColumn(), and te::common::Exception::what().
|
signal |
|
slot |
Creates a new histogram based on the data at position column.
column | Column that provides the data for the histogram. |
Definition at line 973 of file DataSetTableView.cpp.
References te::qt::widgets::createHistogramDisplay(), te::qt::widgets::HistogramDataWidget::getHistogram(), and te::qt::widgets::HistogramDataWidget::setHistogramProperty().
|
slot |
Creates a new chart that displays the normal distribution based on the data at position column.
column | Column that provides the data used to calculate the normal distribution. |
Definition at line 1005 of file DataSetTableView.cpp.
References te::qt::widgets::createNormalDistribution(), te::dt::INT16_TYPE, and te::dt::NUMERIC_TYPE.
|
signal |
bool te::qt::widgets::DataSetTableView::getAcceptDrop | ( | ) |
Gets accept drop flag.
Definition at line 856 of file DataSetTableView.cpp.
References te::qt::widgets::DataSetTableHorizontalHeader::getAcceptDrop().
bool te::qt::widgets::DataSetTableView::getDragDrop | ( | ) |
Gets the drag drop flag.
Definition at line 844 of file DataSetTableView.cpp.
References te::qt::widgets::DataSetTableHorizontalHeader::getDragDrop().
bool te::qt::widgets::DataSetTableView::hasEditions | ( | ) | const |
Returns true if there are unsaved editions e false if there is not.
Definition at line 968 of file DataSetTableView.cpp.
Referenced by TablePopupFilter::eventFilter().
|
slot |
Hides the column at position column.
column | Column to be hidden. |
Definition at line 1020 of file DataSetTableView.cpp.
Referenced by HideGeometryColumns(), and HideTsVectorColumn().
void te::qt::widgets::DataSetTableView::highlightOIds | ( | const te::da::ObjectIdSet * | oids | ) |
Highlights the objects identified by oids.
oids | The identifiers of rows to be highlighted. |
Definition at line 941 of file DataSetTableView.cpp.
References te::da::ObjectIdSet::begin(), and te::da::ObjectIdSet::size().
|
slot |
Used to highlight the data when the mouse is clicked over a row in the table.
row | Row to be highlighted. |
add | True to add to selection, false to new selection. |
Definition at line 1172 of file DataSetTableView.cpp.
References te::da::ObjectIdSet::begin(), and GetExtent().
Referenced by DataSetTableView().
|
slot |
Select all rows from initRow to finalRow.
initRow | the begin row. |
finalRow | the final row. |
Definition at line 1209 of file DataSetTableView.cpp.
References GetExtent().
Referenced by DataSetTableView().
|
slot |
Promotes the highlighted rows.
The rows highlighted are presented in the begining of the table.
If | true, scrolls to the top of the table. |
Definition at line 1239 of file DataSetTableView.cpp.
|
slot |
Definition at line 1368 of file DataSetTableView.cpp.
References GetDataSource(), and te::common::Exception::what().
|
protected |
Definition at line 1414 of file DataSetTableView.cpp.
|
slot |
Rename a column of the table.
column | Index of the column to be renamed. |
Definition at line 1030 of file DataSetTableView.cpp.
References GetDataSource(), te::qt::widgets::RenameColumnDialog::getNewName(), te::qt::widgets::RenameColumnDialog::getOldName(), te::qt::widgets::RenameColumnDialog::setOldColumnName(), and te::common::Exception::what().
|
slot |
Shows columns in the original order.
Definition at line 1157 of file DataSetTableView.cpp.
|
slot |
Changes teh type of a column in the table.
column | Index of the column to be changed. |
Definition at line 1066 of file DataSetTableView.cpp.
References GetDataSource(), te::dt::Property::getName(), te::qt::widgets::RetypeColumnDialog::getProperty(), te::dt::Property::getType(), te::common::LATIN1, te::qt::widgets::RetypeColumnDialog::setColumnName(), te::qt::widgets::RetypeColumnDialog::setTableName(), and te::qt::widgets::RetypeColumnDialog::setType().
|
slot |
Saves all editions to the dataset.
Definition at line 1429 of file DataSetTableView.cpp.
References GetDataSource(), te::da::GetEmptyOIDSet(), and te::common::Exception::what().
|
signal |
Emmite when objects was selected.
void te::qt::widgets::DataSetTableView::setAcceptDrop | ( | bool | b | ) |
Sets the drop on the horizontal header.
b | True: accept drop. False: do not accept drop. |
Definition at line 850 of file DataSetTableView.cpp.
References te::qt::widgets::DataSetTableHorizontalHeader::setAcceptDrop().
|
slot |
Enable / disable auto-scroll.
enable | True for enable auto-scroll, false for disable it. |
Definition at line 1399 of file DataSetTableView.cpp.
void te::qt::widgets::DataSetTableView::setDataSet | ( | te::da::DataSet * | dset, |
te::common::CharEncoding | enc, | ||
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.
dset | The new data set to be visualized. |
clearEditor | True for reset editions, false to maintain it. |
Definition at line 908 of file DataSetTableView.cpp.
References HideGeometryColumns(), HideTsVectorColumn(), and te::qt::widgets::DataSetTableHorizontalHeader::setDataSet().
void te::qt::widgets::DataSetTableView::setDragDrop | ( | bool | b | ) |
Sets the drag drop on the horizontal header. When the drag drop is enabled, you lose the ability to swap columns.
b | True: does the drag drop. False: do not drag drop. |
Definition at line 838 of file DataSetTableView.cpp.
References te::qt::widgets::DataSetTableHorizontalHeader::setDragDrop().
void te::qt::widgets::DataSetTableView::setHighlightColor | ( | const QColor & | color | ) |
Update the color to be used.
color | The new color; |
Definition at line 961 of file DataSetTableView.cpp.
Referenced by te::qt::af::DataSetTableDockWidget::DataSetTableDockWidget().
void te::qt::widgets::DataSetTableView::setLayer | ( | te::map::AbstractLayer * | layer, |
const bool & | clearEditor = true |
||
) |
Sets the layer to be presented.
layer | Pointer to the layer to be presented. |
clearEditor | True for reset editions, false to maintain it. |
Definition at line 862 of file DataSetTableView.cpp.
References GetCapabilities(), GetDataSet(), GetDataSource(), and te::qt::widgets::DataSetTableHorizontalHeader::setLayer().
|
virtual |
Sets the schema of the data set. It is used to define the primary keys and create the ObjectIdSet.
schema | The DataSetType to extract keys. |
Definition at line 926 of file DataSetTableView.cpp.
References te::da::GetEmptyOIDSet().
|
slot |
Shows or hides the icon sinalizing the columns that identify each row.
visible | True for icon visible, false otherwise. |
Definition at line 1312 of file DataSetTableView.cpp.
|
slot |
Enable / disable promotion.
If enabled all selected rows will be moved to te top of the table.
enable | True to enable promotion, false to disable it |
Definition at line 1404 of file DataSetTableView.cpp.
|
slot |
Shows all hidden columns.
Definition at line 1148 of file DataSetTableView.cpp.
|
slot |
Shows the hidden column.
column | Column to be presented. |
Definition at line 1025 of file DataSetTableView.cpp.
|
slot |
Sort by the selected columns.
asc | True for ascendent order, false for descendent. |
Definition at line 1260 of file DataSetTableView.cpp.
References GetDataSet(), and te::common::Exception::what().
|
protected |
Auto scroll enabling.
Definition at line 336 of file DataSetTableView.h.
|
protected |
Delegate used for rendering selected rows.
Definition at line 334 of file DataSetTableView.h.
Referenced by DataSetTableView().
|
protected |
Flag to force or not scrolling.
Definition at line 337 of file DataSetTableView.h.
|
protected |
Data set being used.
Definition at line 339 of file DataSetTableView.h.
|
protected |
Definition at line 343 of file DataSetTableView.h.
|
protected |
Pointer to the layer being presented.
Definition at line 335 of file DataSetTableView.h.
|
protected |
The model to be used.
Definition at line 332 of file DataSetTableView.h.
Referenced by DataSetTableView().
|
protected |
Flag that sinalizes if the it is sorted in ascending sorting.
Definition at line 341 of file DataSetTableView.h.
|
protected |
Order by columns.
Definition at line 340 of file DataSetTableView.h.
|
protected |
The menus popup filter.
Definition at line 333 of file DataSetTableView.h.
Referenced by DataSetTableView().
|
protected |
Promotion enabled.
Definition at line 338 of file DataSetTableView.h.
|
protected |
Flag that sinalizes if there's is no sort.
Definition at line 342 of file DataSetTableView.h.