OpenTwin 0.1
OpenTwin
 
Loading...
Searching...
No Matches
SpinBox.h
Go to the documentation of this file.
1
4// ###########################################################################################################################################################################################################################################################################################################################
5
6#pragma once
7
8// OpenTwin header
12
13// Qt header
14#include <QtWidgets/qspinbox.h>
15
16class QTimer;
17
18namespace ot {
19
20 class OT_WIDGETS_API_EXPORT SpinBox : public QSpinBox, public QWidgetInterface {
21 Q_OBJECT
23 public:
24 SpinBox(QWidget* _parentWidget = (QWidget*)nullptr);
25 SpinBox(int _min, int _max, int _value, QWidget* _parentWidget = (QWidget*)nullptr);
26 virtual ~SpinBox();
27
28 virtual QWidget* getQWidget(void) override { return this; };
29 virtual const QWidget* getQWidget(void) const override { return this; };
30
31 void setChangeDelay(int _delayInMs);
32
33 Q_SIGNALS:
34 void valueChangeCompleted(int _value);
35
36 protected:
37 virtual void keyPressEvent(QKeyEvent* _event) override;
38 virtual void focusOutEvent(QFocusEvent* _event) override;
39
40 private Q_SLOTS:
41 void slotValueChanged(void);
42 void slotValueChangedTimeout(void);
43
44 private:
45 void ini(void);
46
47 bool m_requireSignal;
48 QTimer* m_timer;
49 };
50
51}
This file contains defines that may be used simplyfy class creation.
#define OT_DECL_NOCOPY(___class)
Removes the default copy constructor and assignment operator.
Definition OTClassHelper.h:14
#define OT_WIDGETS_API_EXPORT
Definition OTWidgetsAPIExport.h:12
Definition QWidgetInterface.h:18
Definition SpinBox.h:20
virtual const QWidget * getQWidget(void) const override
Definition SpinBox.h:29
void valueChangeCompleted(int _value)
virtual QWidget * getQWidget(void) override
Returns a pointer to the root widget of this object.
Definition SpinBox.h:28
Definition Connector.h:8