Isis 3 Programmer Reference
GuiParameter.h
1#ifndef Isis_GuiParameter_h
2#define Isis_GuiParameter_h
3
9/* SPDX-License-Identifier: CC0-1.0 */
10
11#include <QGridLayout>
12#include <QLabel>
13#include <QLineEdit>
14#include <QMenu>
15#include <QObject>
16#include <QString>
17#include <QToolButton>
18
19namespace Isis {
20 class UserInterface;
21
34 class GuiParameter : public QObject {
35
36 Q_OBJECT
37
38 public:
39
40 GuiParameter(QGridLayout *grid, UserInterface &ui, int group, int param);
41 virtual ~GuiParameter();
42
44 QString Name() const {
45 return p_name;
46 };
47
48 void SetToDefault();
49
50 void SetToCurrent();
51
52 virtual QString Value() = 0;
53
54 virtual void Set(QString newValue) = 0;
55
56 void SetEnabled(bool enabled, bool isParentCombo=false);
57
59 bool IsEnabled() const {
60 return p_label->isEnabled();
61 }
62
63 virtual bool IsModified();
64
65 void Update();
66
67 void RememberWidget(QWidget *w);
68
70
71 virtual std::vector<QString> Exclusions();
72
73 enum ParameterType { IntegerWidget, DoubleWidget, StringWidget,
74 ListWidget, FileNameWidget, CubeWidget,
75 BooleanWidget, ComboWidget
76 };
77 ParameterType Type() {
78 return p_type;
79 };
80
81 protected:
82
83 QToolButton *p_fileButton;
84 QLineEdit *p_lineEdit;
85
86 int p_group;
87 int p_param;
88 QString p_name;
89 UserInterface *p_ui;
90
91 QLabel *p_label;
92
93 QList<QWidget *> p_widgetList;
94
95 ParameterType p_type;
96
97 private:
98 QMenu *p_helperMenu;
99
100 signals:
101 void ValueChanged();
102 void HelperTrigger(const QString &);
103
104 };
105};
106
107#endif
void Update()
Update the value on the GUI with the value in the UI.
bool IsEnabled() const
Is the parameter enabled.
virtual bool IsModified()
Return if the parameter value is different from the default value.
void RememberWidget(QWidget *w)
Add widgets to a list for enabling/disabling.
void SetToDefault()
Change the parameter to the default value.
virtual std::vector< QString > Exclusions()
Return list of current exclusions.
void SetEnabled(bool enabled, bool isParentCombo=false)
Enable or disable the parameter.
GuiParameter(QGridLayout *grid, UserInterface &ui, int group, int param)
Constructor.
void SetToCurrent()
Change the parameter to the current user interface value.
QString Name() const
Return the name of the parameter.
QWidget * AddHelpers(QObject *lo)
Sets up helper button.
virtual ~GuiParameter()
Destructor.
Command Line and Xml loader, validation, and access.
This is free and unencumbered software released into the public domain.
Definition Apollo.h:16