Loading...
Searching...
No Matches
DataSetTreeView.h
Go to the documentation of this file.
1/* Copyright (C) 2008 National Institute For Space Research (INPE) - Brazil.
2
3 This file is part of the TerraLib - a Framework for building GIS enabled applications.
4
5 TerraLib is free software: you can redistribute it and/or modify
6 it under the terms of the GNU Lesser General Public License as published by
7 the Free Software Foundation, either version 3 of the License,
8 or (at your option) any later version.
9
10 TerraLib is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU Lesser General Public License for more details.
14
15 You should have received a copy of the GNU Lesser General Public License
16 along with TerraLib. See COPYING. If not, write to
17 TerraLib Team at <terralib-team@terralib.org>.
18 */
19
20/*!
21 \file terralib/qt/widgets/dataset/explorer/DataSetTreeView.h
22
23 \brief A tree view for datasets of a data source.
24*/
25
26#ifndef __TERRALIB_QT_WIDGETS_DATASET_EXPLORER_INTERNAL_DATASETTREEVIEW_H
27#define __TERRALIB_QT_WIDGETS_DATASET_EXPLORER_INTERNAL_DATASETTREEVIEW_H
28
29// TerraLib
30#ifndef Q_MOC_RUN
31#include "../../../../dataaccess/datasource/DataSourceInfo.h"
32#endif
33#include "../../Config.h"
34
35// STL
36#include <list>
37#include <memory>
38
39// Qt
40#include <QTreeView>
41
42namespace te
43{
44 namespace qt
45 {
46 namespace widgets
47 {
48 class DataSetGroupItem;
49 class DataSetCategoryGroupItem;
50 class DataSetItem;
51 class DataSetTreeModel;
52 class DataSetCategoryModel;
53
54 /*!
55 \class DataSetTreeView
56
57 \brief A tree view for datasets of a data source.
58
59 \ingroup widgets
60
61 \sa DataSetTreeViewModel, DataSetExplorer
62 */
63 class TEQTWIDGETSEXPORT DataSetTreeView : public QTreeView
64 {
65 Q_OBJECT
66
67 public:
68
69 DataSetTreeView(QWidget* parent = 0);
70
72
73 void set(const te::da::DataSourceInfoPtr& ds, bool useCheckableItems = false);
74
75 std::list<DataSetItem*> getSelectedDataSets() const;
76
77 bool hasSelectedDataSets() const;
78
79 signals:
80
82
84
86
87 void clicked(DataSetItem* item);
88
90
92
94
96
98
99 void entered(DataSetItem* item);
100
102
104
105 void pressed(DataSetItem* item);
106
108
110
111 void toggled(DataSetItem* item);
112
114
116
117 protected slots:
118
119 void onItemActivated(const QModelIndex & index);
120
121 void onItemClicked(const QModelIndex & index);
122
123 void onItemDoubleClicked(const QModelIndex & index);
124
125 void onItemEntered(const QModelIndex & index);
126
127 void onItemPressed(const QModelIndex & index);
128
129 void customContextMenu(const QPoint &point);
130
131 void onModelToggled(bool checked);
132
133 private:
134
135 std::unique_ptr<DataSetCategoryModel> m_categoryModel;
136 std::unique_ptr<DataSetTreeModel> m_treeModel;
140 };
141 } // end namespace widgets
142 } // end namespace qt
143} // end namespace te
144
145#endif // __TERRALIB_QT_WIDGETS_DATASET_EXPLORER_INTERNAL_DATASETTREEVIEW_H
A tree view for datasets of a data source.
void activated(DataSetItem *item)
void pressed(DataSetItem *item)
void activated(DataSetCategoryGroupItem *item)
void pressed(DataSetGroupItem *item)
te::da::DataSourceInfoPtr m_ds
void onItemClicked(const QModelIndex &index)
void entered(DataSetGroupItem *item)
void onItemDoubleClicked(const QModelIndex &index)
std::unique_ptr< DataSetTreeModel > m_treeModel
std::unique_ptr< DataSetCategoryModel > m_categoryModel
void onModelToggled(bool checked)
void pressed(DataSetCategoryGroupItem *item)
void clicked(DataSetCategoryGroupItem *item)
void onItemActivated(const QModelIndex &index)
void entered(DataSetCategoryGroupItem *item)
void clicked(DataSetItem *item)
DataSetTreeView(QWidget *parent=0)
void customContextMenu(const QPoint &point)
void doubleClicked(DataSetGroupItem *item)
void activated(DataSetGroupItem *item)
void toggled(DataSetCategoryGroupItem *item)
void doubleClicked(DataSetItem *item)
void entered(DataSetItem *item)
void onItemEntered(const QModelIndex &index)
std::list< DataSetItem * > getSelectedDataSets() const
void toggled(DataSetItem *item)
void set(const te::da::DataSourceInfoPtr &ds, bool useCheckableItems=false)
void onItemPressed(const QModelIndex &index)
void doubleClicked(DataSetCategoryGroupItem *item)
void clicked(DataSetGroupItem *item)
void toggled(DataSetGroupItem *item)
boost::shared_ptr< DataSourceInfo > DataSourceInfoPtr
TerraLib.
#define slots
#define TEQTWIDGETSEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:63