pqSignalAdaptors.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Kitware Inc.
2 // SPDX-FileCopyrightText: Copyright (c) Sandia Corporation
3 // SPDX-License-Identifier: BSD-3-Clause
4 
5 #ifndef pqSignalAdaptors_h
6 #define pqSignalAdaptors_h
7 
8 #include <QObject>
9 #include <QString>
10 #include <QVariant>
11 class QComboBox;
12 class QSlider;
13 class QTextEdit;
14 class QSpinBox;
15 
16 #include "pqWidgetsModule.h"
17 
24 {
25  Q_OBJECT
26  Q_PROPERTY(QString currentText READ currentText WRITE setCurrentText)
27  Q_PROPERTY(int currentIndex READ currentIndex WRITE setCurrentIndex)
28  Q_PROPERTY(QVariant currentData READ currentData WRITE setCurrentData)
29 
30 public:
34  pqSignalAdaptorComboBox(QComboBox* p);
38  QString currentText() const;
42  int currentIndex() const;
43 
47  QVariant currentData() const;
48 
49 Q_SIGNALS:
53  void currentTextChanged(const QString&);
54 
55  void currentIndexChanged(int);
56 public Q_SLOTS:
60  void setCurrentText(const QString&);
61 
65  void setCurrentIndex(int index);
66 
70  void setCurrentData(const QVariant& data);
71 
72 protected:
73 };
74 
78 class PQWIDGETS_EXPORT pqSignalAdaptorColor : public QObject
79 {
80  Q_OBJECT
81  Q_PROPERTY(QVariant color READ color WRITE setColor)
82 public:
87  pqSignalAdaptorColor(QObject* p, const char* colorProperty, const char* signal, bool enableAlpha);
91  QVariant color() const;
92 
93 Q_SIGNALS:
97  void colorChanged(const QVariant&);
98 public Q_SLOTS:
102  void setColor(const QVariant&);
103 protected Q_SLOTS:
104  void handleColorChanged();
105 
106 protected: // NOLINT(readability-redundant-access-specifiers)
107  QByteArray PropertyName;
109 };
110 
115 {
116  Q_OBJECT
117  Q_PROPERTY(double value READ value WRITE setValue)
118 public:
122  pqSignalAdaptorSliderRange(QSlider* p);
126  double value() const;
127 Q_SIGNALS:
131  void valueChanged(double val);
132 public Q_SLOTS:
136  void setValue(double val);
137 protected Q_SLOTS:
138  void handleValueChanged();
139 };
140 
145 {
146  Q_OBJECT
147  Q_PROPERTY(QString text READ text WRITE setText)
148 
149 public:
153  pqSignalAdaptorTextEdit(QTextEdit* p);
157  QString text() const;
158 Q_SIGNALS:
162  void textChanged();
163 public Q_SLOTS:
164  void setText(const QString&);
165 
166 protected:
167 };
168 
173 {
174  Q_OBJECT
175  Q_PROPERTY(int value READ value WRITE setValue)
176 
177 public:
181  pqSignalAdaptorSpinBox(QSpinBox* p);
185  int value() const;
186 Q_SIGNALS:
190  void valueChanged(int val);
191 public Q_SLOTS:
192  void setValue(int val);
193 
194 protected:
195 };
196 
197 #endif
color
signal adaptor to allow getting/setting/observing of an rgba (0.0 - 1.0 range)
signal adaptor that lets us get the text inside a QTextEdit
signal adaptor to adjust the range of a int slider to (0.0-1.0)
#define PQWIDGETS_EXPORT
signal adaptor to allow getting/setting/observing of a pseudo &#39;currentText&#39; property of a combo box t...
value
signal adaptor that lets us set/get the integer value inside a QSpinBox
#define const
Definition: zconf.h:238