OTB  6.7.0
Orfeo Toolbox
otbWrapperQtWidgetParameterBase.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2005-2019 Centre National d'Etudes Spatiales (CNES)
3  *
4  * This file is part of Orfeo Toolbox
5  *
6  * https://www.orfeo-toolbox.org/
7  *
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  */
20 
21 #ifndef otbWrapperQtWidgetParameterBase_h
22 #define otbWrapperQtWidgetParameterBase_h
23 
24 #include <QtWidgets>
25 #include "otbWrapperParameter.h"
27 #include "OTBQtWidgetExport.h"
28 
29 namespace otb
30 {
31 namespace Wrapper
32 {
33 
34 class QtWidgetParameterGroup;
35 
41 class OTBQtWidget_EXPORT QtWidgetParameterBase : public QWidget
42 {
43  Q_OBJECT
44  friend class QtWidgetParameterGroup;
45 public:
46  QtWidgetParameterBase( Parameter *, QtWidgetModel * , QWidget * parent);
47  ~QtWidgetParameterBase() override;
48 
49  void CreateWidget();
50 
53  virtual bool IsChecked() const
54  {
55  return m_IsChecked;
56  }
57 
59  virtual void SetChecked(const bool value)
60  {
61  m_IsChecked = value;
62  }
63 
64 public slots:
65  void UpdateGUI();
66  virtual void SetActivationState( bool value );
67 
68 protected slots:
69  void ParameterChanged(const QString& key);
70 
71 signals:
72  void ParameterActiveStatus(bool value);
73 
74 protected:
75  QtWidgetModel* GetModel();
76 
77  const Parameter * GetParam() const;
78 
79  Parameter * GetParam();
80 
81  bool eventFilter(QObject* o, QEvent* e) override;
82 
83 private:
85  void operator=(const QtWidgetParameterBase&) = delete;
86 
87  virtual void DoUpdateGUI() = 0;
88 
89  virtual void DoCreateWidget() = 0;
90 
91 private:
93 
95 
98 };
99 
100 
101 }
102 }
103 
104 #endif
This class represent a parameter for the wrapper framework This class is a high level class represent...