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 QCOMMONSTYLE_H
5#define QCOMMONSTYLE_H
6
7#include "qquickstyle.h"
8
9QT_BEGIN_NAMESPACE
10
11namespace QQC2 {
12
13class QCommonStylePrivate;
14
15class QCommonStyle: public QStyle
16{
17 Q_OBJECT
18
19public:
20 QCommonStyle();
21 ~QCommonStyle() override;
22
23 void drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QPainter *p) const override;
24 void drawControl(ControlElement element, const QStyleOption *opt, QPainter *p) const override;
25 void drawComplexControl(ComplexControl cc, const QStyleOptionComplex *opt, QPainter *p) const override;
26
27 QRect subElementRect(SubElement r, const QStyleOption *opt) const override;
28 QRect subControlRect(ComplexControl cc, const QStyleOptionComplex *opt, SubControl sc) const override;
29
30 QSize sizeFromContents(ContentsType ct, const QStyleOption *opt, const QSize &contentsSize) const override;
31 QFont font(ControlElement element, const QStyle::State state) const override;
32 QMargins ninePatchMargins(ControlElement ce, const QStyleOption *opt, const QSize &imageSize) const override;
33 QMargins ninePatchMargins(ComplexControl cc, const QStyleOptionComplex *opt, const QSize &imageSize) const override;
34
35 int pixelMetric(PixelMetric m, const QStyleOption *opt = nullptr) const override;
36 int styleHint(StyleHint sh, const QStyleOption *opt = nullptr, QStyleHintReturn *shret = nullptr) const override;
37
38 QIcon standardIcon(StandardPixmap standardIcon, const QStyleOption *opt = nullptr) const override;
39 QPixmap standardPixmap(StandardPixmap sp, const QStyleOption *opt = nullptr) const override;
40 QPixmap generatedIconPixmap(QIcon::Mode iconMode, const QPixmap &pixmap, const QStyleOption *opt) const override;
41
42 SubControl hitTestComplexControl(ComplexControl cc, const QStyleOptionComplex *opt, const QPoint &pt) const override;
43
44protected:
45 QCommonStyle(QCommonStylePrivate &dd);
46
47private:
48 Q_DECLARE_PRIVATE(QCommonStyle)
49 Q_DISABLE_COPY(QCommonStyle)
50};
51
52} // namespace QQC2
53
54QT_END_NAMESPACE
55
56#endif // QCOMMONSTYLE_H
57

source code of qtdeclarative/src/quicknativestyle/qstyle/qquickcommonstyle.h