QtPdWidgets  2.3.1
CheckBox.h
Go to the documentation of this file.
1 /*****************************************************************************
2  *
3  * Copyright (C) 2009 Florian Pose <fp@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 PD_CHECKBOX_H
24 #define PD_CHECKBOX_H
25 
26 #include <QCheckBox>
27 #include <QScopedPointer>
28 
29 #include "Export.h"
30 #include <QtPdCom1/ScalarSubscriber.h>
31 
32 namespace Pd {
33 
34 class CheckBoxPrivate;
35 
36 /****************************************************************************/
37 
41  public QCheckBox, public QtPdCom::ScalarSubscriber
42 {
43  Q_OBJECT
44  Q_PROPERTY(int onValue
45  READ getOnValue WRITE setOnValue RESET resetOnValue)
46  Q_PROPERTY(int offValue
47  READ getOffValue WRITE setOffValue RESET resetOffValue)
48 
49  public:
50  CheckBox(QWidget *parent = 0);
51  virtual ~CheckBox();
52 
53  void clearData(); // pure-virtual from ScalarSubscriber
54 
55  int getOnValue() const;
56  void setOnValue(int);
57  void resetOnValue();
58  int getOffValue() const;
59  void setOffValue(int);
60  void resetOffValue();
61 
62  protected:
63  void checkStateSet();
64  void nextCheckState();
65 
66  private:
67  Q_DECLARE_PRIVATE(CheckBox);
68  QScopedPointer<CheckBoxPrivate> const d_ptr;
69 
70  PD_PRIVATE void newValues(std::chrono::nanoseconds) override;
71 };
72 
73 /****************************************************************************/
74 
75 } // namespace
76 
77 #endif
Definition: Bar.h:36
QScopedPointer< CheckBoxPrivate > const d_ptr
Definition: CheckBox.h:68
CheckBox.
Definition: CheckBox.h:40
#define PD_PRIVATE
Definition: Export.h:28
#define PD_PUBLIC
Definition: Export.h:33