All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DataSetExplorer.cpp
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/DataSetExplorer.cpp
22 
23  \brief A widget designed to explore the datasets of a data source.
24 */
25 
26 // TerraLib
27 #include "DataSetExplorer.h"
28 #include "DataSetTreeView.h"
29 
30 // Qt
31 #include <QScrollArea>
32 #include <QVBoxLayout>
33 
34 te::qt::widgets::DataSetExplorer::DataSetExplorer(QWidget* parent, Qt::WindowFlags flags)
35  : QDockWidget(tr("Dataset Explorer"), parent, flags)
36 {
37  //QScrollArea* scrollArea = new QScrollArea(this);
38 
39  m_treeView.reset(new DataSetTreeView(this));
40 
41  //scrollArea->setWidget(dtv);
42 
43  //scrollArea->setWidgetResizable(true);
44 
45  //setWidget(scrollArea);
46 
47  setWidget(m_treeView.get());
48 }
49 
51 {
52  //QWidget* w = widget();
53 
54  //if(w == 0)
55  //return;
56 
57  //QScrollArea* scrollArea = dynamic_cast<QScrollArea*>(w);
58 
59  //if(w == 0)
60  //return;
61 
62  //w = scrollArea->widget();
63 
64  //if(w == 0)
65  //return;
66 
67  //DataSetTreeView* tview = dynamic_cast<DataSetTreeView*>(w);
68 
69  //if(tview == 0)
70  //return;
71 
72  //QAbstractItemModel* model = tview->model();
73 
74  //tview->setModel(0);
75 
76  //delete model;
77 }
78 
80 {
81  m_treeView->set(ds);
82 }
83 
85 {
86  return m_treeView.get();
87 }
88 
A tree view for datasets of a data source.
DataSetTreeView * getTreeView() const
DataSetExplorer(QWidget *parent=0, Qt::WindowFlags flags=0)
std::auto_ptr< DataSetTreeView > m_treeView
A tree view for datasets of a data source.
A widget designed to explore the datasets of a data source.
void set(const te::da::DataSourceInfoPtr &ds)
boost::shared_ptr< DataSourceInfo > DataSourceInfoPtr