QSkinny 0.8.0
C++/Qt UI toolkit
Loading...
Searching...
No Matches
QskSlider.h
1/******************************************************************************
2 * QSkinny - Copyright (C) The authors
3 * SPDX-License-Identifier: BSD-3-Clause
4 *****************************************************************************/
5
6#ifndef QSK_SLIDER_H
7#define QSK_SLIDER_H
8
9#include "QskBoundedValueInput.h"
10
11class QSK_EXPORT QskSlider : public QskBoundedValueInput
12{
13 Q_OBJECT
14
15 Q_PROPERTY( bool isPressed READ isPressed NOTIFY pressedChanged )
16
17 Q_PROPERTY( Qt::Orientation orientation READ orientation
18 WRITE setOrientation NOTIFY orientationChanged )
19
20 Q_PROPERTY( bool tracking READ isTracking
21 WRITE setTracking NOTIFY trackingChanged )
22
23 Q_PROPERTY( qreal handlePosition READ handlePosition )
24
26
27 public:
28 QSK_SUBCONTROLS( Panel, Groove, Fill, Scale, Handle,
29 GrooveStopIndicators, FillStopIndicators )
30 QSK_STATES( Pressed )
31
32 explicit QskSlider( QQuickItem* parent = nullptr );
33 explicit QskSlider( Qt::Orientation, QQuickItem* parent = nullptr );
34
35 ~QskSlider() override;
36
37 bool isPressed() const;
38
39 void setOrientation( Qt::Orientation );
40 Qt::Orientation orientation() const;
41
42 void setTracking( bool );
43 bool isTracking() const;
44
45 qreal handlePosition() const; // [0,0, 1.0]
46
48
49 Q_SIGNALS:
50 void pressedChanged( bool );
51 void orientationChanged( Qt::Orientation );
52 void trackingChanged( bool );
53
54 protected:
55 void mousePressEvent( QMouseEvent* ) override;
56 void mouseMoveEvent( QMouseEvent* ) override;
57 void mouseReleaseEvent( QMouseEvent* ) override;
58
59 QSizeF handleSize() const;
60 QRectF handleRect() const;
61
62 void aboutToShow() override;
63
64 private:
65 void moveHandle();
66 void moveHandleTo( qreal value, const QskAnimationHint& );
67
68 class PrivateData;
69 std::unique_ptr< PrivateData > m_data;
70};
71
72#endif
Variation
Some sort of variation.
Definition QskAspect.h:82
virtual void aboutToShow()
Definition QskItem.cpp:1091
virtual QskAspect::Variation effectiveVariation() const