ParaView
pqSignalAdaptors.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: ParaView
4  Module: pqSignalAdaptors.h
5 
6  Copyright (c) 2005-2008 Sandia Corporation, Kitware Inc.
7  All rights reserved.
8 
9  ParaView is a free software; you can redistribute it and/or modify it
10  under the terms of the ParaView license version 1.2.
11 
12  See License_v1.2.txt for the full ParaView license.
13  A copy of this license can be obtained by contacting
14  Kitware Inc.
15  28 Corporate Drive
16  Clifton Park, NY 12065
17  USA
18 
19 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR
23 CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
24 EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
25 PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
26 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
27 LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
28 NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
29 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 
31 =========================================================================*/
32 
33 #ifndef pq_SignalAdaptors_h
34 #define pq_SignalAdaptors_h
35 
36 #include <QObject>
37 #include <QString>
38 #include <QVariant>
39 class QComboBox;
40 class QSlider;
41 class QTextEdit;
42 class QSpinBox;
43 
44 #include "pqWidgetsModule.h"
45 
51 class PQWIDGETS_EXPORT pqSignalAdaptorComboBox : public QObject
52 {
53  Q_OBJECT
54  Q_PROPERTY(QString currentText READ currentText WRITE setCurrentText)
55  Q_PROPERTY(int currentIndex READ currentIndex WRITE setCurrentIndex)
56  Q_PROPERTY(QVariant currentData READ currentData WRITE setCurrentData)
57 
58 public:
62  pqSignalAdaptorComboBox(QComboBox* p);
66  QString currentText() const;
70  int currentIndex() const;
71 
75  QVariant currentData() const;
76 
77 signals:
81  void currentTextChanged(const QString&);
82 
83  void currentIndexChanged(int);
84 public slots:
88  void setCurrentText(const QString&);
89 
93  void setCurrentIndex(int index);
94 
98  void setCurrentData(const QVariant& data);
99 
100 protected:
101 };
102 
106 class PQWIDGETS_EXPORT pqSignalAdaptorColor : public QObject
107 {
108  Q_OBJECT
109  Q_PROPERTY(QVariant color READ color WRITE setColor)
110 public:
115  pqSignalAdaptorColor(QObject* p, const char* colorProperty, const char* signal, bool enableAlpha);
119  QVariant color() const;
120 
121 signals:
125  void colorChanged(const QVariant&);
126 public slots:
130  void setColor(const QVariant&);
131 protected slots:
132  void handleColorChanged();
133 
134 protected:
135  QByteArray PropertyName;
137 };
138 
142 class PQWIDGETS_EXPORT pqSignalAdaptorSliderRange : public QObject
143 {
144  Q_OBJECT
145  Q_PROPERTY(double value READ value WRITE setValue)
146 public:
150  pqSignalAdaptorSliderRange(QSlider* p);
154  double value() const;
155 signals:
159  void valueChanged(double val);
160 public slots:
164  void setValue(double val);
165 protected slots:
166  void handleValueChanged();
167 };
168 
172 class PQWIDGETS_EXPORT pqSignalAdaptorTextEdit : public QObject
173 {
174  Q_OBJECT
175  Q_PROPERTY(QString text READ text WRITE setText)
176 
177 public:
181  pqSignalAdaptorTextEdit(QTextEdit* p);
185  QString text() const;
186 signals:
190  void textChanged();
191 public slots:
192  void setText(const QString&);
193 
194 protected:
195 };
196 
200 class PQWIDGETS_EXPORT pqSignalAdaptorSpinBox : public QObject
201 {
202  Q_OBJECT
203  Q_PROPERTY(int value READ value WRITE setValue)
204 
205 public:
209  pqSignalAdaptorSpinBox(QSpinBox* p);
213  int value() const;
214 signals:
218  void valueChanged(int val);
219 public slots:
220  void setValue(int val);
221 
222 protected:
223 };
224 
225 #endif
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)
signal adaptor to allow getting/setting/observing of a pseudo &#39;currentText&#39; property of a combo box t...
signal adaptor that lets us set/get the integer value inside a QSpinBox