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 pqSignalAdaptors_h
34 #define pqSignalAdaptors_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 
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 Q_SIGNALS:
81  void currentTextChanged(const QString&);
82 
83  void currentIndexChanged(int);
84 public Q_SLOTS:
88  void setCurrentText(const QString&);
89 
93  void setCurrentIndex(int index);
94 
98  void setCurrentData(const QVariant& data);
99 
100 protected:
101 };
102 
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 Q_SIGNALS:
125  void colorChanged(const QVariant&);
126 public Q_SLOTS:
130  void setColor(const QVariant&);
131 protected Q_SLOTS:
132  void handleColorChanged();
133 
134 protected: // NOLINT(readability-redundant-access-specifiers)
135  QByteArray PropertyName;
137 };
138 
143 {
144  Q_OBJECT
145  Q_PROPERTY(double value READ value WRITE setValue)
146 public:
150  pqSignalAdaptorSliderRange(QSlider* p);
154  double value() const;
155 Q_SIGNALS:
159  void valueChanged(double val);
160 public Q_SLOTS:
164  void setValue(double val);
165 protected Q_SLOTS:
166  void handleValueChanged();
167 };
168 
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 Q_SIGNALS:
190  void textChanged();
191 public Q_SLOTS:
192  void setText(const QString&);
193 
194 protected:
195 };
196 
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 Q_SIGNALS:
218  void valueChanged(int val);
219 public Q_SLOTS:
220  void setValue(int val);
221 
222 protected:
223 };
224 
225 #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