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
qsgsoftwareinternalrectanglenode_p.h
Go to the documentation of this file.
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 QSGSOFTWAREINTERNALRECTANGLENODE_H
5#define QSGSOFTWAREINTERNALRECTANGLENODE_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <private/qsgadaptationlayer_p.h>
19
20#include <QPen>
21#include <QBrush>
22#include <QPixmap>
23
25
27{
28public:
30
31 void setRect(const QRectF &rect) override;
32 void setColor(const QColor &color) override;
33 void setPenColor(const QColor &color) override;
34 void setPenWidth(qreal width) override;
35 void setGradientStops(const QGradientStops &stops) override;
36 void setGradientVertical(bool vertical) override;
37 void setRadius(qreal radius) override;
38 void setTopLeftRadius(qreal radius) override;
39 void setTopRightRadius(qreal radius) override;
40 void setBottomLeftRadius(qreal radius) override;
41 void setBottomRightRadius(qreal radius) override;
42 void setAntialiasing(bool antialiasing) override { Q_UNUSED(antialiasing); }
43 void setAligned(bool aligned) override;
44
45 void update() override;
46
47 void paint(QPainter *);
48
49 bool isOpaque() const;
50 QRectF rect() const;
51private:
52 void paintRectangle(QPainter *painter, const QRect &rect);
53 void paintRectangleIndividualCorners(QPainter *painter, const QRect &rect);
54 void generateCornerPixmap();
55
56 QRect m_rect;
57 QColor m_color;
58 QColor m_penColor;
59 qreal m_penWidth;
60 QGradientStops m_stops;
61 qreal m_radius;
62 qreal m_topLeftRadius;
63 qreal m_topRightRadius;
64 qreal m_bottomLeftRadius;
65 qreal m_bottomRightRadius;
66 QPen m_pen;
67 QBrush m_brush;
68 bool m_vertical;
69
70 bool m_cornerPixmapIsDirty;
71 QPixmap m_cornerPixmap;
72
73 qreal m_devicePixelRatio;
74};
75
77
78#endif // QSGSOFTWAREINTERNALRECTANGLENODE_H
\inmodule QtGui
Definition qbrush.h:30
The QColor class provides colors based on RGB, HSV or CMYK values.
Definition qcolor.h:31
The QPainter class performs low-level painting on widgets and other paint devices.
Definition qpainter.h:46
\inmodule QtGui
Definition qpen.h:28
Returns a copy of the pixmap that is transformed using the given transformation transform and transfo...
Definition qpixmap.h:27
\inmodule QtCore\reentrant
Definition qrect.h:484
\inmodule QtCore\reentrant
Definition qrect.h:30
void setAntialiasing(bool antialiasing) override
void setColor(const QColor &color) override
void setGradientStops(const QGradientStops &stops) override
void setPenColor(const QColor &color) override
QPainter paint
Combined button and popup list for selecting options.
GLint GLsizei width
GLuint color
[2]
Int aligned(Int v, Int byteAlign)
#define Q_UNUSED(x)
double qreal
Definition qtypes.h:187
QPainter painter(this)
[7]