QSkinny 0.8.0
C++/Qt UI toolkit
Loading...
Searching...
No Matches
QskSliderSkinlet.h
1/******************************************************************************
2 * QSkinny - Copyright (C) The authors
3 * SPDX-License-Identifier: BSD-3-Clause
4 *****************************************************************************/
5
6#ifndef QSK_SLIDER_SKINLET_H
7#define QSK_SLIDER_SKINLET_H
8
9#include "QskSkinlet.h"
10
11class QskSlider;
12
13class QSK_EXPORT QskSliderSkinlet : public QskSkinlet
14{
15 Q_GADGET
16
17 using Inherited = QskSkinlet;
18
19 public:
20 QSK_STATES( Filled )
21
22 enum NodeRole
23 {
24 PanelRole,
25 GrooveRole,
26 FillRole,
27 TicksRole,
28 HandleRole,
29
30 RoleCount
31 };
32
33 Q_INVOKABLE QskSliderSkinlet( QskSkin* = nullptr );
34 ~QskSliderSkinlet() override;
35
36 QRectF subControlRect( const QskSkinnable*,
37 const QRectF& rect, QskAspect::Subcontrol ) const override;
38
39 QSizeF sizeHint( const QskSkinnable*,
40 Qt::SizeHint, const QSizeF& ) const override;
41
42 int sampleCount( const QskSkinnable*, QskAspect::Subcontrol ) const override;
43
44 QRectF sampleRect( const QskSkinnable*,
45 const QRectF&, QskAspect::Subcontrol, int index ) const override;
46
47 QVariant sampleAt( const QskSkinnable*,
48 QskAspect::Subcontrol, int index ) const override;
49
50 QskAspect::States sampleStates( const QskSkinnable*,
51 QskAspect::Subcontrol, int ) const override;
52
53 protected:
54 QSGNode* updateSubNode( const QskSkinnable*,
55 quint8 nodeRole, QSGNode* ) const override;
56
57 QSGNode* updateSampleNode( const QskSkinnable*,
58 QskAspect::Subcontrol, int index, QSGNode* ) const override;
59
60 virtual QVector< qreal > graduation( const QskSlider* ) const;
61
62 private:
63 QRectF panelRect( const QskSlider*, const QRectF& ) const;
64 QRectF fillRect( const QskSlider*, const QRectF& ) const;
65 QRectF handleRect( const QskSlider*, const QRectF& ) const;
66 QRectF tickRect( const QskSlider*, const QRectF&, int index ) const;
67};
68
69#endif
Subcontrol
For use within the rendering or lay-outing of a specific QskSkinnable.
Definition QskAspect.h:104
Describes the rendering interface of a QskControl. Change the skinlet to change the appearance of the...
Definition QskSkinlet.h:34