Isis 3 Programmer Reference
GuiDoubleParameter.cpp
1 #include <QHBoxLayout>
2 #include <iostream>
3 #include <QDoubleValidator>
4 #include "GuiDoubleParameter.h"
5 #include "UserInterface.h"
6 
7 
8 namespace Isis {
9 
10  GuiDoubleParameter::GuiDoubleParameter(QGridLayout *grid, UserInterface &ui,
11  int group, int param) :
12  GuiParameter(grid, ui, group, param) {
13 
14  p_lineEdit = new QLineEdit;
15  p_lineEdit->setValidator(new QDoubleValidator(p_lineEdit));
16  connect(p_lineEdit, SIGNAL(textChanged(const QString &)), this, SIGNAL(ValueChanged()));
17  grid->addWidget(p_lineEdit, param, 2);
18 
19  if(p_ui->HelpersSize(group, param) != 0) {
20  grid->addWidget(AddHelpers(p_lineEdit), param, 3);
21  }
22 
23  RememberWidget(p_lineEdit);
24 
25  p_type = DoubleWidget;
26  }
27 
28 
29  GuiDoubleParameter::~GuiDoubleParameter() {}
30 
31 
32  void GuiDoubleParameter::Set(QString newValue) {
33  p_lineEdit->setText(newValue);
34  }
35 
36 
37  QString GuiDoubleParameter::Value() {
38  return p_lineEdit->text();
39  }
40 
41 }
42 
QWidget * AddHelpers(QObject *lo)
Sets up helper button.
int HelpersSize(const int &group, const int &param) const
Returns the number of helpers the parameter has.
Definition: IsisAml.cpp:1771
Namespace for ISIS/Bullet specific routines.
Definition: Apollo.h:31
void RememberWidget(QWidget *w)
Add widgets to a list for enabling/disabling.