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
() =
default
;
55
56
bool
te::qt::widgets::GroupByWizardPage::isComplete
()
const
57
{
58
return
true
;
59
}
60
61
te::qt::widgets::DoubleListWidget
*
te::qt::widgets::GroupByWizardPage::getWidget
()
const
62
{
63
return
m_widget
.get();
64
}
65
66
te::da::GroupBy
*
te::qt::widgets::GroupByWizardPage::getGroupBy
()
67
{
68
std::vector<std::string> values =
m_widget
->getOutputValues();
69
70
if
(values.empty())
71
return
nullptr
;
72
73
74
te::da::GroupBy
* groupBy =
new
te::da::GroupBy
;
75
76
for
(
size_t
t = 0; t < values.size(); ++t)
77
{
78
te::da::GroupByItem
* gi =
new
te::da::GroupByItem
(
new
te::da::PropertyName
(values[t]));
79
80
groupBy->push_back(gi);
81
}
82
83
return
groupBy;
84
}
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:56
QWizardPage
te::qt::widgets::DoubleListWidget
...
Definition:
DoubleListWidget.h:53
te::da::PropertyName
A class that models the name of any property of an object.
Definition:
dataaccess/query/PropertyName.h:50
QWidget
GroupByWizardPage.h
This file has the GroupByWizardPage class.
te::qt::widgets::GroupByWizardPage::~GroupByWizardPage
virtual ~GroupByWizardPage()
te::qt::widgets::GroupByWizardPage::m_widget
std::unique_ptr< DoubleListWidget > m_widget
Definition:
GroupByWizardPage.h:73
te::qt::widgets::GroupByWizardPage::getWidget
DoubleListWidget * getWidget() const
Definition:
GroupByWizardPage.cpp:61
te::qt::widgets::GroupByWizardPage::getGroupBy
te::da::GroupBy * getGroupBy()
Definition:
GroupByWizardPage.cpp:66
te::qt::widgets::GroupByWizardPage::GroupByWizardPage
GroupByWizardPage(QWidget *parent=0)
Definition:
GroupByWizardPage.cpp:37
terralib5_src
src
terralib
qt
widgets
query
GroupByWizardPage.cpp
Generated on Wed Jun 6 2018 12:16:09 for TerraLib by
1.8.11