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
qqc2qdrawutil_p.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 QQC2QDRAWUTIL_P_H
6#define QQC2QDRAWUTIL_P_H
7
8//
9// W A R N I N G
10// -------------
11//
12// This file is not part of the Qt API. It exists purely as an
13// implementation detail. This header file may change from version to
14// version without notice, or even be removed.
15//
16// We mean it.
17//
18
19#include <QtGui/qpixmap.h>
20
21#include <QtCore/qmargins.h>
22#include <QtCore/qnamespace.h>
23#include <QtCore/qstring.h> // char*->QString conversion
24
25#if QT_CONFIG(settings)
26#include <QtCore/qsettings.h>
27#endif
28
29QT_BEGIN_NAMESPACE
30
31
32class QPainter;
33class QPalette;
34class QPoint;
35class QColor;
36class QBrush;
37class QRect;
38
39namespace QQC2 {
40
41//
42// Standard shade drawing
43//
44
45void qDrawShadeLine(QPainter *p, int x1, int y1, int x2, int y2,
46 const QPalette &pal, bool sunken = true,
47 int lineWidth = 1, int midLineWidth = 0);
48
49void qDrawShadeLine(QPainter *p, const QPoint &p1, const QPoint &p2,
50 const QPalette &pal, bool sunken = true,
51 int lineWidth = 1, int midLineWidth = 0);
52
53void qDrawShadeRect(QPainter *p, int x, int y, int w, int h,
54 const QPalette &pal, bool sunken = false,
55 int lineWidth = 1, int midLineWidth = 0,
56 const QBrush *fill = nullptr);
57
58void qDrawShadeRect(QPainter *p, const QRect &r,
59 const QPalette &pal, bool sunken = false,
60 int lineWidth = 1, int midLineWidth = 0,
61 const QBrush *fill = nullptr);
62
63void qDrawShadePanel(QPainter *p, int x, int y, int w, int h,
64 const QPalette &pal, bool sunken = false,
65 int lineWidth = 1, const QBrush *fill = nullptr);
66
67void qDrawShadePanel(QPainter *p, const QRect &r,
68 const QPalette &pal, bool sunken = false,
69 int lineWidth = 1, const QBrush *fill = nullptr);
70
71void qDrawWinButton(QPainter *p, int x, int y, int w, int h,
72 const QPalette &pal, bool sunken = false,
73 const QBrush *fill = nullptr);
74
75void qDrawWinButton(QPainter *p, const QRect &r,
76 const QPalette &pal, bool sunken = false,
77 const QBrush *fill = nullptr);
78
79void qDrawWinPanel(QPainter *p, int x, int y, int w, int h,
80 const QPalette &pal, bool sunken = false,
81 const QBrush *fill = nullptr);
82
83void qDrawWinPanel(QPainter *p, const QRect &r,
84 const QPalette &pal, bool sunken = false,
85 const QBrush *fill = nullptr);
86
87void qDrawPlainRect(QPainter *p, int x, int y, int w, int h, const QColor &,
88 int lineWidth = 1, const QBrush *fill = nullptr);
89
90void qDrawPlainRect(QPainter *p, const QRect &r, const QColor &,
91 int lineWidth = 1, const QBrush *fill = nullptr);
92
93
94
96{
97 inline QTileRules(Qt::TileRule horizontalRule, Qt::TileRule verticalRule)
99 inline QTileRules(Qt::TileRule rule = Qt::StretchTile)
103};
104
105#ifndef Q_QDOC
106// For internal use only.
128#endif
129
131 const QRect &targetRect,
132 const QMargins &targetMargins,
133 const QPixmap &pixmap,
134 const QRect &sourceRect,
135 const QMargins &sourceMargins,
136 const QTileRules &rules = QTileRules()
137#ifndef Q_QDOC
139#endif
140 );
141
142inline void qDrawBorderPixmap(QPainter *painter,
143 const QRect &target,
144 const QMargins &margins,
145 const QPixmap &pixmap)
146{
147 qDrawBorderPixmap(painter, target, margins, pixmap, pixmap.rect(), margins);
148}
149
150} // namespace QQC2
151
152QT_END_NAMESPACE
153
154#endif // QQC2QDRAWUTIL_P_H
friend class QPainter
\inmodule QtCore\reentrant
Definition qpoint.h:30
void qDrawPlainRect(QPainter *p, const QRect &r, const QColor &c, int lineWidth, const QBrush *fill)
void qDrawShadeRect(QPainter *p, int x, int y, int w, int h, const QPalette &pal, bool sunken, int lineWidth, int midLineWidth, const QBrush *fill)
void qDrawShadeLine(QPainter *p, int x1, int y1, int x2, int y2, const QPalette &pal, bool sunken, int lineWidth, int midLineWidth)
void qDrawShadeRect(QPainter *p, const QRect &r, const QPalette &pal, bool sunken, int lineWidth, int midLineWidth, const QBrush *fill)
void qDrawPlainRect(QPainter *p, int x, int y, int w, int h, const QColor &c, int lineWidth, const QBrush *fill)
void qDrawBorderPixmap(QPainter *painter, const QRect &target, const QMargins &margins, const QPixmap &pixmap)
The qDrawBorderPixmap function is for drawing a pixmap into the margins of a rectangle.
void qDrawShadeLine(QPainter *p, const QPoint &p1, const QPoint &p2, const QPalette &pal, bool sunken, int lineWidth, int midLineWidth)
void qDrawWinButton(QPainter *p, const QRect &r, const QPalette &pal, bool sunken, const QBrush *fill)
static void qDrawWinShades(QPainter *p, int x, int y, int w, int h, const QColor &c1, const QColor &c2, const QColor &c3, const QColor &c4, const QBrush *fill)
void qDrawWinPanel(QPainter *p, const QRect &r, const QPalette &pal, bool sunken, const QBrush *fill)
void qDrawBorderPixmap(QPainter *painter, const QRect &targetRect, const QMargins &targetMargins, const QPixmap &pixmap, const QRect &sourceRect, const QMargins &sourceMargins, const QTileRules &rules, QDrawBorderPixmap::DrawingHints hints)
void qDrawShadePanel(QPainter *p, const QRect &r, const QPalette &pal, bool sunken, int lineWidth, const QBrush *fill)
QVarLengthArray< QPainter::PixmapFragment, 16 > QPixmapFragmentsArray
void qDrawWinPanel(QPainter *p, int x, int y, int w, int h, const QPalette &pal, bool sunken, const QBrush *fill)
void qDrawWinButton(QPainter *p, int x, int y, int w, int h, const QPalette &pal, bool sunken, const QBrush *fill)
void qDrawShadePanel(QPainter *p, int x, int y, int w, int h, const QPalette &pal, bool sunken, int lineWidth, const QBrush *fill)
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)
QTileRules(Qt::TileRule horizontalRule, Qt::TileRule verticalRule)