All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
AlterDataDialog.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 #include "AlterDataDialog.h"
21 
22 #include <ui_AlterDataDialogForm.h>
23 
25 QDialog(parent)
26 {
27  m_ui.reset(new Ui::AlterDataDialogForm);
28  m_ui->setupUi(this);
29 
30  connect (m_ui->m_closePushButton, SIGNAL(pressed()), SLOT(reject()));
31  connect (m_ui->m_executePushButton, SIGNAL(pressed()), SLOT(accept()));
32 
33  connect (m_ui->m_divPushButton, SIGNAL(pressed()), SLOT(divPressed()));
34  connect (m_ui->m_plusPushButton, SIGNAL(pressed()), SLOT(plusPressed()));
35  connect (m_ui->m_minusPushButton, SIGNAL(pressed()), SLOT(minusPressed()));
36  connect (m_ui->m_multiplyPushButton, SIGNAL(pressed()), SLOT(multiplyPressed()));
37 
38  connect (m_ui->m_columnsComboBox, SIGNAL(currentIndexChanged(const QString&)), SLOT(columnChanged(const QString&)));
39 }
40 
42 {
43 }
44 
46 {
47  m_ui->m_selectedColumnLineEdit->setText(colName);
48 }
49 
50 void te::qt::widgets::AlterDataDialog::setDataColumns(const std::vector<QString>& cols)
51 {
52  std::vector<QString>::const_iterator it;
53 
54  m_ui->m_columnsComboBox->clear();
55 
56  m_ui->m_columnsComboBox->blockSignals(true);
57 
58  for(it=cols.begin(); it!=cols.end(); ++it)
59  m_ui->m_columnsComboBox->addItem(*it);
60 
61  m_ui->m_columnsComboBox->blockSignals(false);
62 }
63 
65 {
66  return m_ui->m_allRadioButton->isChecked();
67 }
68 
70 {
71  return m_ui->m_expressionTextEdit->toPlainText();
72 }
73 
75 {
76  m_ui->m_expressionTextEdit->insertPlainText("+ ");
77 }
78 
80 {
81  m_ui->m_expressionTextEdit->insertPlainText("- ");
82 }
83 
85 {
86  m_ui->m_expressionTextEdit->insertPlainText("* ");
87 }
88 
90 {
91  m_ui->m_expressionTextEdit->insertPlainText("/ ");
92 }
93 
95 {
96  m_ui->m_expressionTextEdit->insertPlainText(col + " ");
97 }
A Qt dialog for reset data of a column in the table.
std::auto_ptr< Ui::AlterDataDialogForm > m_ui
void columnChanged(const QString &col)
void setSelectedColumn(const QString &colName)
void setDataColumns(const std::vector< QString > &cols)