QtPdWidgets  2.3.1
NoPdTouchEdit.h
Go to the documentation of this file.
1 /*****************************************************************************
2  *
3  * Copyright (C) 2011 - 2012 Andreas Stewering-Bone <ab@igh-essen.com>
4  *
5  * This file is part of the QtPdWidgets library.
6  *
7  * The QtPdWidgets library is free software: you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public License as
9  * published by the Free Software Foundation, either version 3 of the License,
10  * or (at your option) any later version.
11  *
12  * The QtPdWidgets library is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
15  * General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public License
18  * along with the QtPdWidgets Library. If not, see
19  * <http://www.gnu.org/licenses/>.
20  *
21  ****************************************************************************/
22 
23 #ifndef NOPD_TOUCHEDIT_H
24 #define NOPD_TOUCHEDIT_H
25 
26 #include <QFrame>
27 #include <QScopedPointer>
28 
29 #include "Export.h"
30 
31 namespace Pd {
32 
33 class TouchEditDialog;
34 
35 class NoPdTouchEditPrivate;
36 
37 /****************************************************************************/
38 
42  public QFrame
43 {
44  Q_OBJECT
45 
46  Q_PROPERTY(double value
47  READ getValue WRITE setValue RESET resetValue)
48  Q_PROPERTY(Qt::Alignment alignment
49  READ getAlignment WRITE setAlignment RESET resetAlignment)
50  Q_PROPERTY(quint32 decimals
51  READ getDecimals WRITE setDecimals RESET resetDecimals)
52  Q_PROPERTY(QString suffix
53  READ getSuffix WRITE setSuffix RESET resetSuffix)
54  Q_PROPERTY(double lowerLimit
55  READ getLowerLimit WRITE setLowerLimit
56  RESET resetLowerLimit)
57  Q_PROPERTY(double upperLimit
58  READ getUpperLimit WRITE setUpperLimit
59  RESET resetUpperLimit)
60 
61  public:
62  NoPdTouchEdit(QWidget *parent = 0);
63  virtual ~NoPdTouchEdit();
64 
65  double getValue() const;
66  void setValue(double);
67  void resetValue();
68 
69  Qt::Alignment getAlignment() const;
70  void setAlignment(Qt::Alignment);
71  void resetAlignment();
72 
73  quint32 getDecimals() const;
74  void setDecimals(quint32);
75  void resetDecimals();
76 
77  QString getSuffix() const;
78  void setSuffix(const QString &);
79  void resetSuffix();
80 
81  double getLowerLimit() const;
82  void setLowerLimit(double);
83  void resetLowerLimit();
84 
85  double getUpperLimit() const;
86  void setUpperLimit(double);
87  void resetUpperLimit();
88 
89  QSize sizeHint() const;
90 
91  signals:
92  void valueChanged();
93 
94  protected:
95  bool event(QEvent *) override;
96  void paintEvent(QPaintEvent *) override;
97  void drawText(QPaintEvent *, QPainter &);
98  void changeEvent(QEvent *) override;
99 
100  private:
101  Q_DECLARE_PRIVATE(NoPdTouchEdit)
102  QScopedPointer<NoPdTouchEditPrivate> const d_ptr;
103 };
104 
105 /****************************************************************************/
106 
107 } // namespace
108 
109 #endif
Definition: Bar.h:36
#define PD_PUBLIC
Definition: Export.h:33
Definition: NoPdTouchEdit.cpp:39
Touch edit for non-process data.
Definition: NoPdTouchEdit.h:41