Isis 3 Programmer Reference
GuiIntegerParameter.cpp
1 
6 /* SPDX-License-Identifier: CC0-1.0 */
7 #include <QHBoxLayout>
8 #include <QIntValidator>
9 
10 #include "GuiIntegerParameter.h"
11 #include "UserInterface.h"
12 
13 namespace Isis {
14 
15  GuiIntegerParameter::GuiIntegerParameter(QGridLayout *grid, UserInterface &ui,
16  int group, int param) :
17  GuiParameter(grid, ui, group, param) {
18 
19  p_lineEdit = new QLineEdit;
20  p_lineEdit->setValidator(new QIntValidator(p_lineEdit));
21  connect(p_lineEdit, SIGNAL(textChanged(const QString &)), this, SIGNAL(ValueChanged()));
22  grid->addWidget(p_lineEdit, param, 2);
23 
24  if(p_ui->HelpersSize(group, param) != 0) {
25  grid->addWidget(AddHelpers(p_lineEdit), param, 3);
26  }
27 
28  RememberWidget(p_lineEdit);
29  p_type = IntegerWidget;
30  }
31 
32 
33  GuiIntegerParameter::~GuiIntegerParameter() {}
34 
35  void GuiIntegerParameter::Set(QString newValue) {
36  p_lineEdit->setText(newValue);
37  }
38 
39 
40  QString GuiIntegerParameter::Value() {
41  return p_lineEdit->text();
42  }
43 
44 }
45 
Isis
This is free and unencumbered software released into the public domain.
Definition: Apollo.h:16