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 QQUICKSTYLEITEMSPINBOX_H
5#define QQUICKSTYLEITEMSPINBOX_H
6
7#include "qquickstyleitem.h"
8#include <QtQuickTemplates2/private/qquickspinbox_p.h>
9
10QT_BEGIN_NAMESPACE
11
12class QQuickStyleItemSpinBox : public QQuickStyleItem
13{
14 Q_OBJECT
15
16 Q_PROPERTY(SubControl subControl MEMBER m_subControl)
17
18 QML_NAMED_ELEMENT(SpinBox)
19
20public:
21 enum SubControl {
22 Frame = 1,
23 Up,
24 Down,
25 };
26 Q_ENUM(SubControl)
27
28 QFont styleFont(QQuickItem *control) const override;
29
30protected:
31 void connectToControl() const override;
32 void paintEvent(QPainter *painter) const override;
33 StyleItemGeometry calculateGeometry() override;
34
35private:
36 void initStyleOption(QStyleOptionSpinBox &styleOption) const;
37
38private:
39 SubControl m_subControl = Frame;
40};
41
42QT_END_NAMESPACE
43
44#endif // QQUICKSTYLEITEMSPINBOX_H
45

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