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  m_ui->m_helpLabel->setVisible(false);
31 
32  connect (m_ui->m_closePushButton, SIGNAL(pressed()), SLOT(reject()));
33  connect (m_ui->m_executePushButton, SIGNAL(pressed()), SLOT(accept()));
34 
35  connect (m_ui->m_divPushButton, SIGNAL(pressed()), SLOT(divPressed()));
36  connect (m_ui->m_plusPushButton, SIGNAL(pressed()), SLOT(plusPressed()));
37  connect (m_ui->m_minusPushButton, SIGNAL(pressed()), SLOT(minusPressed()));
38  connect (m_ui->m_multiplyPushButton, SIGNAL(pressed()), SLOT(multiplyPressed()));
39 
40  connect (m_ui->m_columnsComboBox, SIGNAL(currentIndexChanged(const QString&)), SLOT(columnChanged(const QString&)));
41 }
42 
44 {
45 }
46 
48 {
49  m_ui->m_selectedColumnLineEdit->setText(colName);
50 }
51 
52 void te::qt::widgets::AlterDataDialog::setDataColumns(const std::vector<QString>& cols)
53 {
54  std::vector<QString>::const_iterator it;
55 
56  m_ui->m_columnsComboBox->clear();
57 
58  m_ui->m_columnsComboBox->blockSignals(true);
59 
60  for(it=cols.begin(); it!=cols.end(); ++it)
61  m_ui->m_columnsComboBox->addItem(*it);
62 
63  m_ui->m_columnsComboBox->blockSignals(false);
64 }
65 
67 {
68  return m_ui->m_allRadioButton->isChecked();
69 }
70 
72 {
73  return m_ui->m_expressionTextEdit->toPlainText();
74 }
75 
77 {
78  m_ui->m_expressionTextEdit->insertPlainText("+ ");
79 }
80 
82 {
83  m_ui->m_expressionTextEdit->insertPlainText("- ");
84 }
85 
87 {
88  m_ui->m_expressionTextEdit->insertPlainText("* ");
89 }
90 
92 {
93  m_ui->m_expressionTextEdit->insertPlainText("/ ");
94 }
95 
97 {
98  m_ui->m_expressionTextEdit->insertPlainText(col + " ");
99 }
100 
102 {
103  m_ui->m_helpLabel->setVisible(true);
104  m_ui->m_helpLabel->setText(text);
105 }
A Qt dialog for reset data of a column in the table.
std::auto_ptr< Ui::AlterDataDialogForm > m_ui
void setHelpLabelText(const QString &text)
void columnChanged(const QString &col)
void setSelectedColumn(const QString &colName)
void setDataColumns(const std::vector< QString > &cols)