Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qquickdrawutil.h
Go to the documentation of this file.
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// Qt-Security score:significant reason:default
4
5#ifndef QDRAWUTIL_H
6#define QDRAWUTIL_H
7
8#include <QtCore/qnamespace.h>
9#include <QtCore/qstring.h> // char*->QString conversion
10#include <QtCore/qmargins.h>
11#include <QtGui/qpixmap.h>
12
14
15
16class QPainter;
17class QPalette;
18class QPoint;
19class QColor;
20class QBrush;
21class QRect;
22
23namespace QQC2 {
24
25//
26// Standard shade drawing
27//
28
29void qDrawShadeLine(QPainter *p, int x1, int y1, int x2, int y2,
30 const QPalette &pal, bool sunken = true,
31 int lineWidth = 1, int midLineWidth = 0);
32
33void qDrawShadeLine(QPainter *p, const QPoint &p1, const QPoint &p2,
34 const QPalette &pal, bool sunken = true,
35 int lineWidth = 1, int midLineWidth = 0);
36
37void qDrawShadeRect(QPainter *p, int x, int y, int w, int h,
38 const QPalette &pal, bool sunken = false,
39 int lineWidth = 1, int midLineWidth = 0,
40 const QBrush *fill = nullptr);
41
42void qDrawShadeRect(QPainter *p, const QRect &r,
43 const QPalette &pal, bool sunken = false,
44 int lineWidth = 1, int midLineWidth = 0,
45 const QBrush *fill = nullptr);
46
47void qDrawShadePanel(QPainter *p, int x, int y, int w, int h,
48 const QPalette &pal, bool sunken = false,
49 int lineWidth = 1, const QBrush *fill = nullptr);
50
51void qDrawShadePanel(QPainter *p, const QRect &r,
52 const QPalette &pal, bool sunken = false,
53 int lineWidth = 1, const QBrush *fill = nullptr);
54
55void qDrawWinButton(QPainter *p, int x, int y, int w, int h,
56 const QPalette &pal, bool sunken = false,
57 const QBrush *fill = nullptr);
58
59void qDrawWinButton(QPainter *p, const QRect &r,
60 const QPalette &pal, bool sunken = false,
61 const QBrush *fill = nullptr);
62
63void qDrawWinPanel(QPainter *p, int x, int y, int w, int h,
64 const QPalette &pal, bool sunken = false,
65 const QBrush *fill = nullptr);
66
67void qDrawWinPanel(QPainter *p, const QRect &r,
68 const QPalette &pal, bool sunken = false,
69 const QBrush *fill = nullptr);
70
71void qDrawPlainRect(QPainter *p, int x, int y, int w, int h, const QColor &,
72 int lineWidth = 1, const QBrush *fill = nullptr);
73
74void qDrawPlainRect(QPainter *p, const QRect &r, const QColor &,
75 int lineWidth = 1, const QBrush *fill = nullptr);
76
77
78
80{
81 inline QTileRules(Qt::TileRule horizontalRule, Qt::TileRule verticalRule)
83 inline QTileRules(Qt::TileRule rule = Qt::StretchTile)
87};
88
89#ifndef Q_QDOC
90// For internal use only.
112#endif
113
115 const QRect &targetRect,
116 const QMargins &targetMargins,
117 const QPixmap &pixmap,
118 const QRect &sourceRect,
119 const QMargins &sourceMargins,
120 const QTileRules &rules = QTileRules()
121#ifndef Q_QDOC
123#endif
124 );
125
126inline void qDrawBorderPixmap(QPainter *painter,
127 const QRect &target,
128 const QMargins &margins,
129 const QPixmap &pixmap)
130{
131 qDrawBorderPixmap(painter, target, margins, pixmap, pixmap.rect(), margins);
132}
133
134} // namespace QQC2
135
136QT_END_NAMESPACE
137
138#endif // QDRAWUTIL_H
friend class QPainter
\inmodule QtCore\reentrant
Definition qpoint.h:231
\inmodule QtCore\reentrant
Definition qpoint.h:29
QCommonStyle(QCommonStylePrivate &dd)
QRect subElementRect(SubElement r, const QStyleOption *opt) const override
QRect subControlRect(ComplexControl cc, const QStyleOptionComplex *opt, SubControl sc) const override
\reimp
QIcon standardIcon(StandardPixmap standardIcon, const QStyleOption *opt=nullptr) const override
int styleHint(StyleHint sh, const QStyleOption *opt=nullptr, QStyleHintReturn *shret=nullptr) const override
QPixmap standardPixmap(StandardPixmap sp, const QStyleOption *opt=nullptr) const override
int pixelMetric(PixelMetric m, const QStyleOption *opt=nullptr) const override
QStyleOptionTab::Shape shape
QStyleOption & operator=(const QStyleOption &other)
Assign other to this QStyleOption.
const QStyle * proxy() const
static int sliderPositionFromValue(int min, int max, int val, int space, bool upsideDown=false)
Converts the given logicalValue to a pixel position.
static const char *const question_xpm[]
static uint qt_intensity(uint r, uint g, uint b)
static const char *const filedialog_end_xpm[]
static const char *const dock_widget_close_xpm[]
static void drawArrow(const QStyle *style, const QStyleOptionToolButton *toolbutton, const QRect &rect, QPainter *painter)
void qDrawBorderPixmap(QPainter *painter, const QRect &target, const QMargins &margins, const QPixmap &pixmap)
static const char *const qt_close_xpm[]
static const char *const qt_help_xpm[]
static const char *const qt_menu_xpm[]
static const char *const qt_unshade_xpm[]
static const char *const qt_normalizeup_xpm[]
static StaticPolygonF< 3 > calcArrow(const QStyleOptionSlider *dial, qreal &a)
static QSizeF viewItemTextLayout(QTextLayout &textLayout, int lineWidth, int maxHeight=-1, int *lastVisibleLine=nullptr)
static const char *const information_xpm[]
static const char *const qt_shade_xpm[]
static const char *const qt_maximize_xpm[]
static const char *const qt_minimize_xpm[]
static const char *const critical_xpm[]
static const char *const warning_xpm[]
static const char *const check_list_controller_xpm[]
static QString clearText16IconPath()
static const char *const filedialog_start_xpm[]
static const char *const tb_extension_arrow_h_xpm[]
static const char *const tb_extension_arrow_v_xpm[]
static QT_BEGIN_NAMESPACE qreal dpr(const QWindow *w)
The QTileRules class provides the rules used to draw a pixmap or image split into nine segments.
Qt::TileRule vertical
Qt::TileRule horizontal
QTileRules(Qt::TileRule rule=Qt::StretchTile)
Constructs a QTileRules with the given rule used for both the horizontal rule and the vertical rule.
QTileRules(Qt::TileRule horizontalRule, Qt::TileRule verticalRule)
Constructs a QTileRules with the given horizontalRule and verticalRule.
Q_DECL_CONSTEXPR int size() const