Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
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
4#ifndef QDRAWUTIL_H
5#define QDRAWUTIL_H
6
7#include <QtCore/qnamespace.h>
8#include <QtCore/qstring.h> // char*->QString conversion
9#include <QtCore/qmargins.h>
10#include <QtGui/qpixmap.h>
11
13
14
15class QPainter;
16class QPalette;
17class QPoint;
18class QColor;
19class QBrush;
20class QRect;
21
22namespace QQC2 {
23
24//
25// Standard shade drawing
26//
27
28void qDrawShadeLine(QPainter *p, int x1, int y1, int x2, int y2,
29 const QPalette &pal, bool sunken = true,
30 int lineWidth = 1, int midLineWidth = 0);
31
32void qDrawShadeLine(QPainter *p, const QPoint &p1, const QPoint &p2,
33 const QPalette &pal, bool sunken = true,
34 int lineWidth = 1, int midLineWidth = 0);
35
36void qDrawShadeRect(QPainter *p, int x, int y, int w, int h,
37 const QPalette &pal, bool sunken = false,
38 int lineWidth = 1, int midLineWidth = 0,
39 const QBrush *fill = nullptr);
40
41void qDrawShadeRect(QPainter *p, const QRect &r,
42 const QPalette &pal, bool sunken = false,
43 int lineWidth = 1, int midLineWidth = 0,
44 const QBrush *fill = nullptr);
45
46void qDrawShadePanel(QPainter *p, int x, int y, int w, int h,
47 const QPalette &pal, bool sunken = false,
48 int lineWidth = 1, const QBrush *fill = nullptr);
49
50void qDrawShadePanel(QPainter *p, const QRect &r,
51 const QPalette &pal, bool sunken = false,
52 int lineWidth = 1, const QBrush *fill = nullptr);
53
54void qDrawWinButton(QPainter *p, int x, int y, int w, int h,
55 const QPalette &pal, bool sunken = false,
56 const QBrush *fill = nullptr);
57
58void qDrawWinButton(QPainter *p, const QRect &r,
59 const QPalette &pal, bool sunken = false,
60 const QBrush *fill = nullptr);
61
62void qDrawWinPanel(QPainter *p, int x, int y, int w, int h,
63 const QPalette &pal, bool sunken = false,
64 const QBrush *fill = nullptr);
65
66void qDrawWinPanel(QPainter *p, const QRect &r,
67 const QPalette &pal, bool sunken = false,
68 const QBrush *fill = nullptr);
69
70void qDrawPlainRect(QPainter *p, int x, int y, int w, int h, const QColor &,
71 int lineWidth = 1, const QBrush *fill = nullptr);
72
73void qDrawPlainRect(QPainter *p, const QRect &r, const QColor &,
74 int lineWidth = 1, const QBrush *fill = nullptr);
75
76
77
79{
80 inline QTileRules(Qt::TileRule horizontalRule, Qt::TileRule verticalRule)
81 : horizontal(horizontalRule), vertical(verticalRule) {}
86};
87
88#ifndef Q_QDOC
89// For internal use only.
111#endif
112
114 const QRect &targetRect,
115 const QMargins &targetMargins,
116 const QPixmap &pixmap,
117 const QRect &sourceRect,
118 const QMargins &sourceMargins,
119 const QTileRules &rules = QTileRules()
120#ifndef Q_QDOC
121 , QDrawBorderPixmap::DrawingHints hints = QDrawBorderPixmap::DrawingHints()
122#endif
123 );
124
126 const QRect &target,
127 const QMargins &margins,
128 const QPixmap &pixmap)
129{
130 qDrawBorderPixmap(painter, target, margins, pixmap, pixmap.rect(), margins);
131}
132
133} // namespace QQC2
134
136
137#endif // QDRAWUTIL_H
\inmodule QtGui
Definition qbrush.h:30
The QColor class provides colors based on RGB, HSV or CMYK values.
Definition qcolor.h:31
\inmodule QtCore
Definition qmargins.h:24
The QPainter class performs low-level painting on widgets and other paint devices.
Definition qpainter.h:46
The QPalette class contains color groups for each widget state.
Definition qpalette.h:19
Returns a copy of the pixmap that is transformed using the given transformation transform and transfo...
Definition qpixmap.h:27
\inmodule QtCore\reentrant
Definition qpoint.h:25
\inmodule QtCore\reentrant
Definition qrect.h:30
QPixmap p2
QPixmap p1
[0]
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 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 &targetRect, const QMargins &targetMargins, const QPixmap &pixmap, const QRect &sourceRect, const QMargins &sourceMargins, const QTileRules &rules, QDrawBorderPixmap::DrawingHints hints)
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)
Combined button and popup list for selecting options.
TileRule
Definition qnamespace.h:133
@ StretchTile
Definition qnamespace.h:134
DBusConnection const char * rule
#define Q_DECLARE_FLAGS(Flags, Enum)
Definition qflags.h:174
GLint GLint GLint GLint GLint x
[0]
GLfloat GLfloat GLfloat w
[0]
GLuint GLfloat GLfloat GLfloat GLfloat y1
GLboolean r
[2]
GLuint GLfloat GLfloat GLfloat x1
GLenum target
GLint y
GLfloat GLfloat GLfloat GLfloat h
GLfixed GLfixed GLfixed y2
GLfixed GLfixed x2
GLfloat GLfloat p
[1]
ba fill(true)
widget render & pixmap
QPainter painter(this)
[7]
The QTileRules class provides the rules used to draw a pixmap or image split into nine segments.
QTileRules(Qt::TileRule horizontalRule, Qt::TileRule verticalRule)
Constructs a QTileRules with the given horizontalRule and verticalRule.
QTileRules(Qt::TileRule rule=Qt::StretchTile)
Constructs a QTileRules with the given rule used for both the horizontal rule and the vertical rule.
Qt::TileRule vertical
Qt::TileRule horizontal
The QTileRules class provides the rules used to draw a pixmap or image split into nine segments.
Definition qdrawutil.h:88