Main Page
Modules
Namespaces
Classes
Files
File List
File Members
GroupByWizardPage.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/query/GroupByWizardPage.cpp
22
23
\brief This file has the GroupByWizardPage class.
24
*/
25
26
// TerraLib
27
#include "../../../dataaccess/query/GroupByItem.h"
28
#include "../../../dataaccess/query/PropertyName.h"
29
#include "../utils/DoubleListWidget.h"
30
#include "
GroupByWizardPage.h
"
31
#include "ui_DoubleListWidgetForm.h"
32
33
// Qt
34
#include <QGridLayout>
35
36
37
te::qt::widgets::GroupByWizardPage::GroupByWizardPage
(QWidget* parent)
38
: QWizardPage(parent)
39
{
40
m_widget
.reset(
new
DoubleListWidget
(
this
));
41
42
QGridLayout* layout =
new
QGridLayout(
this
);
43
44
layout->addWidget(
m_widget
.get());
45
46
//configure page
47
this->setTitle(tr(
"Group By Definition"
));
48
this->setSubTitle(tr(
"Choose the attributes to be grouped."
));
49
50
m_widget
->getForm()->m_leftItemsLabel->setText(tr(
"Available Properties"
));
51
m_widget
->getForm()->m_rightItemsLabel->setText(tr(
"Used Properties"
));
52
}
53
54
te::qt::widgets::GroupByWizardPage::~GroupByWizardPage
()
55
{
56
}
57
58
bool
te::qt::widgets::GroupByWizardPage::isComplete
()
const
59
{
60
return
true
;
61
}
62
63
te::qt::widgets::DoubleListWidget
*
te::qt::widgets::GroupByWizardPage::getWidget
()
const
64
{
65
return
m_widget.get();
66
}
67
68
te::da::GroupBy
*
te::qt::widgets::GroupByWizardPage::getGroupBy
()
69
{
70
std::vector<std::string> values = m_widget->getOutputValues();
71
72
if
(values.empty())
73
return
0;
74
75
76
te::da::GroupBy
* groupBy =
new
te::da::GroupBy
;
77
78
for
(
size_t
t = 0; t < values.size(); ++t)
79
{
80
te::da::GroupByItem
* gi =
new
te::da::GroupByItem
(
new
te::da::PropertyName
(values[t]));
81
82
groupBy->push_back(gi);
83
}
84
85
return
groupBy;
86
}
te::da::GroupBy
boost::ptr_vector< GroupByItem > GroupBy
A class that can be used to model a GROUP BY clause.
Definition:
GroupBy.h:37
te::da::GroupByItem
A class that can be used in a GROUP BY clause.
Definition:
GroupByItem.h:50
te::qt::widgets::GroupByWizardPage::isComplete
bool isComplete() const
Definition:
GroupByWizardPage.cpp:58
te::qt::widgets::DoubleListWidget
...
Definition:
DoubleListWidget.h:53
te::da::PropertyName
A class that models the name of any property of an object.
Definition:
PropertyName.h:50
GroupByWizardPage.h
This file has the GroupByWizardPage class.
te::qt::widgets::GroupByWizardPage::~GroupByWizardPage
virtual ~GroupByWizardPage()
Definition:
GroupByWizardPage.cpp:54
te::qt::widgets::GroupByWizardPage::getWidget
DoubleListWidget * getWidget() const
Definition:
GroupByWizardPage.cpp:63
te::qt::widgets::GroupByWizardPage::getGroupBy
te::da::GroupBy * getGroupBy()
Definition:
GroupByWizardPage.cpp:68
te::qt::widgets::GroupByWizardPage::m_widget
std::auto_ptr< DoubleListWidget > m_widget
Definition:
GroupByWizardPage.h:71
te::qt::widgets::GroupByWizardPage::GroupByWizardPage
GroupByWizardPage(QWidget *parent=0)
Definition:
GroupByWizardPage.cpp:37
git_master
terralib5
src
terralib
qt
widgets
query
GroupByWizardPage.cpp
Generated on Tue Jan 12 2016 08:40:58 for TerraLib by
1.8.9.1