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 enum NodeRole
21 {
22 PanelRole,
23 GrooveRole,
24 FillRole,
25 GrooveStopIndicatorsRole,
26 FillStopIndicatorsRole,
27 HandleRole,
28
29 RoleCount
30 };
31
32 Q_INVOKABLE QskSliderSkinlet( QskSkin* = nullptr );
33 ~QskSliderSkinlet() override;
34
35 QRectF subControlRect( const QskSkinnable*,
36 const QRectF& rect, QskAspect::Subcontrol ) const override;
37
38 QSizeF sizeHint( const QskSkinnable*,
39 Qt::SizeHint, const QSizeF& ) const override;
40
41 int sampleCount( const QskSkinnable*, QskAspect::Subcontrol ) const override;
42
43 QRectF sampleRect( const QskSkinnable*,
44 const QRectF&, QskAspect::Subcontrol, int index ) const override;
45
46 QskAspect::States sampleStates( const QskSkinnable*,
47 QskAspect::Subcontrol, int ) const override;
48
49 protected:
50 QSGNode* updateSubNode( const QskSkinnable*,
51 quint8 nodeRole, QSGNode* ) const override;
52
53 QSGNode* updateSampleNode( const QskSkinnable*,
54 QskAspect::Subcontrol, int index, QSGNode* ) const override;
55
56 private:
57 QRectF panelRect( const QskSlider*, const QRectF& ) const;
58 QRectF grooveRect( const QskSlider*, const QRectF& ) const;
59 QRectF fillRect( const QskSlider*, const QRectF& ) const;
60 QRectF handleRect( const QskSlider*, const QRectF& ) const;
61 QRectF scaleRect( const QskSlider*, const QRectF& ) const;
62
63 QRectF innerRect( const QskSlider*, const QRectF&, QskAspect::Subcontrol ) const;
64};
65
66#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