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 | #include <QtCore/qpoint.h> |
5 | #include <QtCore/qstring.h> |
6 | #include <QtGui/qpaintdevice.h> |
7 | #include <QtGui/qpolygon.h> |
8 | #include <QtCore/qstringbuilder.h> |
9 | #include <QtCore/private/qglobal_p.h> |
10 | #if QT_CONFIG(accessibility) |
11 | #include <QtGui/qaccessible.h> |
12 | #endif |
13 | |
14 | #ifndef QSTYLEHELPER_P_H |
15 | #define QSTYLEHELPER_P_H |
16 | |
17 | // |
18 | // W A R N I N G |
19 | // ------------- |
20 | // |
21 | // This file is not part of the Qt API. It exists purely as an |
22 | // implementation detail. This header file may change from version to |
23 | // version without notice, or even be removed. |
24 | // |
25 | // We mean it. |
26 | // |
27 | |
28 | QT_BEGIN_NAMESPACE |
29 | |
30 | class QObject; |
31 | class QPainter; |
32 | class QPixmap; |
33 | |
34 | namespace QQC2 { |
35 | |
36 | class QStyleOptionSlider; |
37 | class QStyleOption; |
38 | |
39 | namespace QStyleHelper |
40 | { |
41 | QString uniqueName(const QString &key, const QStyleOption *option, const QSize &size); |
42 | |
43 | qreal dpi(const QStyleOption *option); |
44 | qreal dpiScaled(qreal value, qreal dpi); |
45 | qreal dpiScaled(qreal value, const QPaintDevice *device); |
46 | qreal dpiScaled(qreal value, const QStyleOption *option); |
47 | |
48 | qreal angle(const QPointF &p1, const QPointF &p2); |
49 | QPolygonF calcLines(const QStyleOptionSlider *dial); |
50 | int calcBigLineSize(int radius); |
51 | void drawDial(const QStyleOptionSlider *dial, QPainter *painter); |
52 | |
53 | void drawBorderPixmap(const QPixmap &pixmap, QPainter *painter, const QRect &rect, |
54 | int left = 0, int top = 0, int right = 0, |
55 | int bottom = 0); |
56 | |
57 | #if QT_CONFIG(accessibility) |
58 | bool isInstanceOf(QObject *obj, QAccessible::Role role); |
59 | bool hasAncestor(QObject *obj, QAccessible::Role role); |
60 | #endif |
61 | QColor backgroundColor(const QPalette &pal); |
62 | |
63 | enum WidgetSizePolicy { SizeLarge = 0, SizeSmall = 1, SizeMini = 2, SizeDefault = -1 }; |
64 | WidgetSizePolicy widgetSizePolicy(const QStyleOption *opt); |
65 | } |
66 | |
67 | } // namespace QQC2 |
68 | |
69 | QT_END_NAMESPACE |
70 | |
71 | #endif // QSTYLEHELPER_P_H |
72 | |