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
30 void setChangeDelay(int _delayInMs);
31
32 Q_SIGNALS:
33 void valueChangeCompleted(int _value);
34
35 protected:
36 virtual void keyPressEvent(QKeyEvent* _event) override;
37 virtual void focusOutEvent(QFocusEvent* _event) override;
38
39 private Q_SLOTS:
40 void slotValueChanged(void);
41 void slotValueChangedTimeout(void);
42
43 private:
44 void ini(void);
45
46 bool m_requireSignal;
47 QTimer* m_timer;
48 };
49
50}
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 QWidget * getQWidget(void) override
Returns a pointer to the root widget of this object.
Definition SpinBox.h:28
Definition Connector.h:8