1// Copyright (C) 2016 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 <QtWidgets/qtwidgetsglobal.h>
8#include <QtWidgets/qstyle.h>
9
10QT_BEGIN_NAMESPACE
11
12class QCommonStylePrivate;
13
14class Q_WIDGETS_EXPORT QCommonStyle: public QStyle
15{
16 Q_OBJECT
17
18public:
19 QCommonStyle();
20 ~QCommonStyle();
21
22 void drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QPainter *p,
23 const QWidget *w = nullptr) const override;
24 void drawControl(ControlElement element, const QStyleOption *opt, QPainter *p,
25 const QWidget *w = nullptr) const override;
26 QRect subElementRect(SubElement r, const QStyleOption *opt, const QWidget *widget = nullptr) const override;
27 void drawComplexControl(ComplexControl cc, const QStyleOptionComplex *opt, QPainter *p,
28 const QWidget *w = nullptr) const override;
29 SubControl hitTestComplexControl(ComplexControl cc, const QStyleOptionComplex *opt,
30 const QPoint &pt, const QWidget *w = nullptr) const override;
31 QRect subControlRect(ComplexControl cc, const QStyleOptionComplex *opt, SubControl sc,
32 const QWidget *w = nullptr) const override;
33 QSize sizeFromContents(ContentsType ct, const QStyleOption *opt,
34 const QSize &contentsSize, const QWidget *widget = nullptr) const override;
35
36 int pixelMetric(PixelMetric m, const QStyleOption *opt = nullptr, const QWidget *widget = nullptr) const override;
37
38 int styleHint(StyleHint sh, const QStyleOption *opt = nullptr, const QWidget *w = nullptr,
39 QStyleHintReturn *shret = nullptr) const override;
40
41 QIcon standardIcon(StandardPixmap standardIcon, const QStyleOption *opt = nullptr,
42 const QWidget *widget = nullptr) const override;
43 QPixmap standardPixmap(StandardPixmap sp, const QStyleOption *opt = nullptr,
44 const QWidget *widget = nullptr) const override;
45
46 QPixmap generatedIconPixmap(QIcon::Mode iconMode, const QPixmap &pixmap,
47 const QStyleOption *opt) const override;
48 int layoutSpacing(QSizePolicy::ControlType control1, QSizePolicy::ControlType control2,
49 Qt::Orientation orientation, const QStyleOption *option = nullptr,
50 const QWidget *widget = nullptr) const override;
51
52 void polish(QPalette &) override;
53 void polish(QApplication *app) override;
54 void polish(QWidget *widget) override;
55 void unpolish(QWidget *widget) override;
56 void unpolish(QApplication *application) override;
57
58protected:
59 QCommonStyle(QCommonStylePrivate &dd);
60
61private:
62 Q_DECLARE_PRIVATE(QCommonStyle)
63 Q_DISABLE_COPY(QCommonStyle)
64#if QT_CONFIG(animation)
65 Q_PRIVATE_SLOT(d_func(), void _q_removeAnimation())
66#endif
67};
68
69QT_END_NAMESPACE
70
71#endif // QCOMMONSTYLE_H
72

source code of qtbase/src/widgets/styles/qcommonstyle.h