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
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;
46 void setAntialiasing(bool antialiasing) override { Q_UNUSED(antialiasing); }
47 void setAligned(bool aligned) override;
48
49 void update() override;
50
51 void paint(QPainter *);
52
53 bool isOpaque() const;
54 QRectF rect() const;
55private:
56 void paintRectangle(QPainter *painter, const QRect &rect);
57 void paintRectangleIndividualCorners(QPainter *painter, const QRect &rect);
58 void generateCornerPixmap();
59
60 QRect m_rect;
61 QColor m_color;
62 QColor m_penColor;
63 qreal m_penWidth;
64 QGradientStops m_stops;
65 qreal m_radius;
66 qreal m_topLeftRadius;
67 qreal m_topRightRadius;
68 qreal m_bottomLeftRadius;
69 qreal m_bottomRightRadius;
70 QPen m_pen;
71 QBrush m_brush;
72 QPixmap m_cornerPixmap;
73 qreal m_devicePixelRatio;
74
75 uint m_vertical : 1;
76 uint m_cornerPixmapIsDirty : 1;
77 uint m_isTopLeftRadiusSet : 1;
78 uint m_isTopRightRadiusSet : 1;
79 uint m_isBottomLeftRadiusSet : 1;
80 uint m_isBottomRightRadiusSet : 1;
81};
82
83QT_END_NAMESPACE
84
85#endif // QSGSOFTWAREINTERNALRECTANGLENODE_H
void setAntialiasing(bool antialiasing) override
void setColor(const QColor &color) override
void setGradientStops(const QGradientStops &stops) override
void setPenColor(const QColor &color) override