All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
ChartLayerDialog.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/charts/ChartLayerDialog.cpp
22 
23  \brief A dialog used to build a chart.
24 */
25 
26 // TerraLib
27 #include "ChartLayerDialog.h"
28 #include "ChartLayerWidget.h"
29 #include "ui_ChartLayerDialogForm.h"
30 
31 te::qt::widgets::ChartLayerDialog::ChartLayerDialog(QWidget* parent, Qt::WindowFlags f)
32  : QDialog(parent, f),
33  m_ui(new Ui::ChartLayerDialogForm),
34  m_chartWidget(0)
35 {
36  m_ui->setupUi(this);
37 
38  // Fill Widget
40 
41  // Adjusting...
42  QGridLayout* layout = new QGridLayout(m_ui->m_widget);
43  layout->setContentsMargins(0,0,0,0);
44  layout->addWidget(m_chartWidget);
45 
46  //connect
47  connect(m_ui->m_okPushButton, SIGNAL(clicked()), this, SLOT(onPushButtonClicked()));
48  m_ui->m_helpPushButton->setPageReference("widgets/charts/pie_bar/pie_bar.html");
49 
50 }
51 
53 {
54 }
55 
57 {
58  std::auto_ptr<te::map::LayerSchema> dsType(layer->getSchema());
59 
60  m_chartWidget->setLayer(layer);
61 }
62 
64 {
65  m_chartWidget->setChart(chart);
66 }
67 
69 {
70  bool res = m_chartWidget->buildChart();
71 
72  if(res)
73  accept();
74 }
A dialog used to build a chart.
A widget used to build a chart.
void setChart(te::map::Chart *chart)
Update the interface with the chart properties.
A widget used to build a grouping.
void setLayer(te::map::AbstractLayerPtr layer)
Set a layer.
std::auto_ptr< Ui::ChartLayerDialogForm > m_ui
Dialog form.
This class represents the informations needed to build map charts.
Definition: Chart.h:51
ChartLayerDialog(QWidget *parent=0, Qt::WindowFlags f=0)
Constructs a basic fill dialog which is a child of parent, with widget flags set to f...
te::qt::widgets::ChartLayerWidget * m_chartWidget
ChartLayer Widget used to configure the grouping operation.
boost::intrusive_ptr< AbstractLayer > AbstractLayerPtr
void onPushButtonClicked()
Function used when the user clicked over the ok push button.