QSkinny 0.8.0
C++/Qt UI toolkit
Loading...
Searching...
No Matches
QskSpinBox.h
1/******************************************************************************
2 * QSkinny - Copyright (C) The authors
3 * SPDX-License-Identifier: BSD-3-Clause
4 *****************************************************************************/
5
6#ifndef QSK_SPIN_BOX_H
7#define QSK_SPIN_BOX_H
8
9#include <QskBoundedValueInput.h>
10
11class QSK_EXPORT QskSpinBox : public QskBoundedValueInput
12{
13 Q_OBJECT
15
16 Q_PROPERTY( bool wrapping READ isWrapping
17 WRITE setWrapping NOTIFY wrappingChanged )
18
19 Q_PROPERTY( Decoration decoration READ decoration
20 WRITE setDecoration RESET resetDecoration NOTIFY decorationChanged )
21
22 public:
23 QSK_SUBCONTROLS( Panel, TextPanel, Text,
24 UpPanel, UpIndicator, DownPanel, DownIndicator )
25
26 QSK_STATES( Decreasing, Increasing )
27
28 enum Decoration
29 {
30 NoDecoration,
31
32 ButtonsLeftAndRight,
33 ButtonsRight,
34 UpDownControl
35 };
36 Q_ENUM( Decoration )
37
38 QskSpinBox( QQuickItem* parent = nullptr );
39 QskSpinBox( qreal min, qreal max,
40 qreal stepSize, QQuickItem* parent = nullptr );
41
42 ~QskSpinBox() override;
43
44 void setDecoration( Decoration );
45 void resetDecoration();
46 Decoration decoration() const;
47
48 void setWrapping( bool );
49 bool isWrapping() const;
50
51 void increment( qreal ) override;
52
53 Q_SIGNALS:
54 void decorationChanged( Decoration );
55 void wrappingChanged( bool );
56
57 protected:
58 void timerEvent( QTimerEvent* ) override;
59
60 void mouseReleaseEvent( QMouseEvent* ) override;
61 void mouseMoveEvent( QMouseEvent* ) override;
62 void mousePressEvent( QMouseEvent* ) override;
63 void mouseUngrabEvent() override;
64
65 void hoverMoveEvent( QHoverEvent* ) override;
66
67 void keyPressEvent( QKeyEvent* ) override;
68 void keyReleaseEvent( QKeyEvent* ) override;
69
70 private:
71 class PrivateData;
72 std::unique_ptr< PrivateData > m_data;
73};
74
75#endif
void mouseUngrabEvent() override
Definition QskItem.cpp:1044
A control to edit, increment and decrement number values.
Definition QskSpinBox.h:12