itom  4.1.0
itomParamFactory.h
1 /* ********************************************************************
2  itom software
3  URL: http://www.uni-stuttgart.de/ito
4  Copyright (C) 2020, Institut fuer Technische Optik (ITO),
5  Universitaet Stuttgart, Germany
6 
7  This file is part of itom and its software development toolkit (SDK).
8 
9  itom is free software; you can redistribute it and/or modify it
10  under the terms of the GNU Library General Public Licence as published by
11  the Free Software Foundation; either version 2 of the Licence, or (at
12  your option) any later version.
13 
14  In addition, as a special exception, the Institut fuer Technische
15  Optik (ITO) gives you certain additional rights.
16  These rights are described in the ITO LGPL Exception version 1.0,
17  which can be found in the file LGPL_EXCEPTION.txt in this package.
18 
19  itom is distributed in the hope that it will be useful, but
20  WITHOUT ANY WARRANTY; without even the implied warranty of
21  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library
22  General Public Licence for more details.
23 
24  You should have received a copy of the GNU Library General Public License
25  along with itom. If not, see <http://www.gnu.org/licenses/>.
26 *********************************************************************** */
27 
28 #ifndef ITOMPARAMFACTORY_H
29 #define ITOMPARAMFACTORY_H
30 
31 #include "itomParamManager.h"
32 
33 #include "common/paramMeta.h"
34 #include "../commonWidgets.h"
35 
36 namespace ito
37 {
38 
39 class ParamIntPropertyFactoryPrivate;
40 
41 class ITOMWIDGETS_EXPORT ParamIntPropertyFactory : public QtAbstractEditorFactory<ParamIntPropertyManager>
42 {
43  Q_OBJECT
44 public:
45  ParamIntPropertyFactory(QObject *parent = 0);
47 protected:
48  void connectPropertyManager(ParamIntPropertyManager *manager);
49  QWidget *createEditor(ParamIntPropertyManager *manager, QtProperty *property, QWidget *parent);
50  void disconnectPropertyManager(ParamIntPropertyManager *manager);
51 private:
53  Q_DECLARE_PRIVATE(ParamIntPropertyFactory)
54  Q_DISABLE_COPY(ParamIntPropertyFactory)
55  Q_PRIVATE_SLOT(d_func(), void slotPropertyChanged(QtProperty *, int))
56  Q_PRIVATE_SLOT(d_func(), void slotMetaChanged(QtProperty *, const ito::IntMeta &))
57  Q_PRIVATE_SLOT(d_func(), void slotSetValue(int))
58  Q_PRIVATE_SLOT(d_func(), void slotEditorDestroyed(QObject *))
59 };
60 
61 
62 
64 
65 class ITOMWIDGETS_EXPORT ParamDoublePropertyFactory : public QtAbstractEditorFactory<ParamDoublePropertyManager>
66 {
67  Q_OBJECT
68 public:
69  ParamDoublePropertyFactory(QObject *parent = 0);
71 protected:
72  void connectPropertyManager(ParamDoublePropertyManager *manager);
73  QWidget *createEditor(ParamDoublePropertyManager *manager, QtProperty *property, QWidget *parent);
74  void disconnectPropertyManager(ParamDoublePropertyManager *manager);
75 private:
77  Q_DECLARE_PRIVATE(ParamDoublePropertyFactory)
78  Q_DISABLE_COPY(ParamDoublePropertyFactory)
79  Q_PRIVATE_SLOT(d_func(), void slotPropertyChanged(QtProperty *, double))
80  Q_PRIVATE_SLOT(d_func(), void slotMetaChanged(QtProperty *, const ito::DoubleMeta &))
81  Q_PRIVATE_SLOT(d_func(), void slotSetValue(double))
82  Q_PRIVATE_SLOT(d_func(), void slotEditorDestroyed(QObject *))
83 };
84 
85 
87 
88 class ITOMWIDGETS_EXPORT ParamCharPropertyFactory : public QtAbstractEditorFactory<ParamCharPropertyManager>
89 {
90  Q_OBJECT
91 public:
92  ParamCharPropertyFactory(QObject *parent = 0);
94 protected:
95  void connectPropertyManager(ParamCharPropertyManager *manager);
96  QWidget *createEditor(ParamCharPropertyManager *manager, QtProperty *property, QWidget *parent);
97  void disconnectPropertyManager(ParamCharPropertyManager *manager);
98 private:
100  Q_DECLARE_PRIVATE(ParamCharPropertyFactory)
101  Q_DISABLE_COPY(ParamCharPropertyFactory)
102  Q_PRIVATE_SLOT(d_func(), void slotPropertyChanged(QtProperty *, char))
103  Q_PRIVATE_SLOT(d_func(), void slotMetaChanged(QtProperty *, const ito::CharMeta &))
104  Q_PRIVATE_SLOT(d_func(), void slotSetValue(char))
105  Q_PRIVATE_SLOT(d_func(), void slotEditorDestroyed(QObject *))
106 };
107 
108 
110 
111 class ITOMWIDGETS_EXPORT ParamStringPropertyFactory : public QtAbstractEditorFactory<ParamStringPropertyManager>
112 {
113  Q_OBJECT
114 public:
115  ParamStringPropertyFactory(QObject *parent = 0);
117 protected:
118  void connectPropertyManager(ParamStringPropertyManager *manager);
119  QWidget *createEditor(ParamStringPropertyManager *manager, QtProperty *property, QWidget *parent);
120  void disconnectPropertyManager(ParamStringPropertyManager *manager);
121 private:
123  Q_DECLARE_PRIVATE(ParamStringPropertyFactory)
124  Q_DISABLE_COPY(ParamStringPropertyFactory)
125  Q_PRIVATE_SLOT(d_func(), void slotPropertyChanged(QtProperty *, const QByteArray &))
126  Q_PRIVATE_SLOT(d_func(), void slotMetaChanged(QtProperty *, const ito::StringMeta &))
127  Q_PRIVATE_SLOT(d_func(), void slotSetValue(const QByteArray &))
128  Q_PRIVATE_SLOT(d_func(), void slotEditorDestroyed(QObject *))
129 };
130 
132 
133 class ITOMWIDGETS_EXPORT ParamIntervalPropertyFactory : public QtAbstractEditorFactory<ParamIntervalPropertyManager>
134 {
135  Q_OBJECT
136 public:
137  ParamIntervalPropertyFactory(QObject *parent = 0);
139 protected:
140  void connectPropertyManager(ParamIntervalPropertyManager *manager);
141  QWidget *createEditor(ParamIntervalPropertyManager *manager, QtProperty *property, QWidget *parent);
142  void disconnectPropertyManager(ParamIntervalPropertyManager *manager);
143 private:
145  Q_DECLARE_PRIVATE(ParamIntervalPropertyFactory)
146  Q_DISABLE_COPY(ParamIntervalPropertyFactory)
147  Q_PRIVATE_SLOT(d_func(), void slotPropertyChanged(QtProperty *, int, int))
148  Q_PRIVATE_SLOT(d_func(), void slotMetaChanged(QtProperty *, const ito::IntervalMeta &))
149  Q_PRIVATE_SLOT(d_func(), void slotSetValue(int, int))
150  Q_PRIVATE_SLOT(d_func(), void slotEditorDestroyed(QObject *))
151 };
152 
153 } //end namespace ito
154 
155 #endif
Definition: itomParamFactory.cpp:103
Meta-information for Param of type Int.
Definition: paramMeta.h:183
Definition: itomParamFactory.h:88
Definition: apiFunctionsGraph.cpp:39
Definition: itomParamManager.h:103
Definition: itomParamManager.h:130
Definition: itomParamManager.h:189
Definition: itomParamFactory.cpp:668
The ParamDoublePropertyFactory class provides QSpinBox widgets for properties created by QtIntPropert...
Definition: itomParamFactory.h:65
Definition: itomParamFactory.cpp:389
Meta-information for ito::Param of type Double.
Definition: paramMeta.h:233
The ParamIntervalPropertyFactory class provides RangeWidget widgets for properties created by ParamIn...
Definition: itomParamFactory.h:133
meta-information for Param of type Char.
Definition: paramMeta.h:132
The ParamStringPropertyFactory class provides QLineEdit widgets for properties created by ParamString...
Definition: itomParamFactory.h:111
Definition: itomParamFactory.cpp:243
Meta-information for Param of type IntArrayMeta that represent an interval [minimum, maximum).
Definition: paramMeta.h:638
Definition: itomParamManager.h:163
Meta-information for Param of type String.
Definition: paramMeta.h:354
Definition: itomParamManager.h:76
The QtProperty class encapsulates an instance of a property.
Definition: qtpropertybrowser.h:60
The QtAbstractEditorFactory is the base template class for editor factories.
Definition: qtpropertybrowser.h:153
Definition: itomParamFactory.cpp:532
Definition: itomParamFactory.h:41