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