1// Copyright (C) 2020 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QQUICKSTYLEITEMSLIDER_H
5#define QQUICKSTYLEITEMSLIDER_H
6
7#include "qquickstyleitem.h"
8#include <QtQuickTemplates2/private/qquickslider_p.h>
9
10QT_BEGIN_NAMESPACE
11
12class QQuickStyleItemSlider : public QQuickStyleItem
13{
14 Q_OBJECT
15
16 Q_PROPERTY(SubControl subControl MEMBER m_subControl)
17
18 QML_NAMED_ELEMENT(Slider)
19
20public:
21 enum SubControl {
22 Groove = 1,
23 Handle,
24 };
25 Q_ENUM(SubControl)
26
27 QFont styleFont(QQuickItem *control) const override;
28
29protected:
30 void connectToControl() const override;
31 void paintEvent(QPainter *painter) const override;
32 StyleItemGeometry calculateGeometry() override;
33
34private:
35 void initStyleOption(QStyleOptionSlider &styleOption) const;
36
37private:
38 SubControl m_subControl = Groove;
39};
40
41QT_END_NAMESPACE
42
43#endif // QQUICKSTYLEITEMSLIDER_H
44

source code of qtdeclarative/src/quicknativestyle/items/qquickstyleitemslider.h