FileSystemTreeView.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 FileSystemTreeView.h
22 
23  \brief A tree view for the file system of an application.
24 */
25 
26 #ifndef __TERRALIB_QT_WIDGETS_INTERNAL_FILESYSTEMTREEVIEW_H
27 #define __TERRALIB_QT_WIDGETS_INTERNAL_FILESYSTEMTREEVIEW_H
28 
29 // TerraLib
30 #include "../../Config.h"
31 #include "../../../../maptools/AbstractLayer.h"
32 
33 // Qt
34 #include <QEvent>
35 #include <QFileInfo>
36 #include <QFileSystemModel>
37 #include <QTreeView>
38 
39 namespace te
40 {
41  namespace qt
42  {
43  namespace widgets
44  {
45  /*!
46  \class FileSystemTreeView
47 
48  \brief A tree view for the file system of an application.
49 
50  */
51  class TEQTWIDGETSEXPORT FileSystemTreeView : public QTreeView
52  {
53  Q_OBJECT
54 
55  public:
56 
57  FileSystemTreeView(QWidget* parent = 0);
58 
60 
61  public:
62 
63  void setNameFilters(QStringList list);
64 
65  void setDataSourceTypesNames(std::vector<std::string> dsTypesNames);
66 
67  signals:
68 
69  void clicked(QFileInfo info);
70 
71  void layersCreated(const std::list<te::map::AbstractLayerPtr>& layers);
72 
73  protected slots:
74 
75  void itemClicked(const QModelIndex & index);
76 
77  void itemDoubleClicked(const QModelIndex & index);
78 
79  void slotCustomContextMenu(const QPoint &point);
80 
81  protected:
82 
83  std::list<te::map::AbstractLayerPtr> createLayer(const QFileInfo& file);
84 
85  protected:
86 
87  QFileSystemModel* m_model;
88 
89  std::vector<std::string> m_dataSourceTypesNames;
90  };
91  } // end namespace widgets
92  } // end namespace qt
93 } // end namespace te
94 
95 #endif // __TERRALIB_QT_WIDGETS_INTERNAL_FILESYSTEMTREEVIEW_H
A tree view for the file system of an application.
void layersCreated(const std::list< te::map::AbstractLayerPtr > &layers)
void itemClicked(const QModelIndex &index)
std::list< te::map::AbstractLayerPtr > createLayer(const QFileInfo &file)
void slotCustomContextMenu(const QPoint &point)
void itemDoubleClicked(const QModelIndex &index)
FileSystemTreeView(QWidget *parent=0)
void setNameFilters(QStringList list)
void setDataSourceTypesNames(std::vector< std::string > dsTypesNames)
std::vector< std::string > m_dataSourceTypesNames
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