15 , m_dirtyContents(
false)
16 , m_opaquePainting(
false)
17 , m_linear_filtering(
false)
19 , m_smoothPainting(
false)
20 , m_fastFBOResizing(
false)
21 , m_fillColor(
Qt::transparent)
22 , m_contentsScale(1.0)
23 , m_dirtyGeometry(
false)
36 if (m_preferredRenderTarget ==
target)
39 m_preferredRenderTarget =
target;
49 m_dirtyGeometry =
true;
54 m_dirtyContents =
true;
55 m_dirtyRect = dirtyRect;
61 if (opaque == m_opaquePainting)
64 m_opaquePainting = opaque;
85 if (
s == m_smoothPainting)
102 if (
s == m_contentsScale)
111 m_fastFBOResizing = dynamic;
121 if (m_dirtyGeometry) {
122 m_pixmap =
QPixmap(m_textureSize);
123 if (!m_opaquePainting)
134 m_dirtyGeometry =
false;
135 m_dirtyContents =
false;
150 if (m_smoothPainting) {
156 if (m_contentsScale == 1) {
160 clipRect = dirtyRect;
165 qFloor(dirtyRect.
y()/m_contentsScale),
166 qCeil(dirtyRect.
width()/m_contentsScale+dirtyRect.
x()/m_contentsScale-
qFloor(dirtyRect.
x()/m_contentsScale)),
167 qCeil(dirtyRect.
height()/m_contentsScale+dirtyRect.
y()/m_contentsScale-
qFloor(dirtyRect.
y()/m_contentsScale)));
172 if (!m_dirtyRect.
isNull())
182 m_dirtyRect =
QRect();
188 if (
size == m_textureSize)
191 m_textureSize =
size;
192 m_dirtyGeometry =
true;
The QColor class provides colors based on RGB, HSV or CMYK values.
The QPainter class performs low-level painting on widgets and other paint devices.
void setClipRect(const QRectF &, Qt::ClipOperation op=Qt::ReplaceClip)
Enables clipping, and sets the clip region to the given rectangle using the given clip operation.
bool begin(QPaintDevice *)
Begins painting the paint device and returns true if successful; otherwise returns false.
void scale(qreal sx, qreal sy)
Scales the coordinate system by ({sx}, {sy}).
void setCompositionMode(CompositionMode mode)
Sets the composition mode to the given mode.
void drawPixmap(const QRectF &targetRect, const QPixmap &pixmap, const QRectF &sourceRect)
Draws the rectangular portion source of the given pixmap into the given target in the paint device.
@ CompositionMode_SourceOver
void setRenderHints(RenderHints hints, bool on=true)
void fillRect(const QRectF &, const QBrush &)
Fills the given rectangle with the brush specified.
Returns a copy of the pixmap that is transformed using the given transformation transform and transfo...
QImage toImage() const
Converts the pixmap to a QImage.
void fill(const QColor &fillColor=Qt::white)
Fills the pixmap with the given color.
The QQuickPaintedItem class provides a way to use the QPainter API in the QML Scene Graph.
virtual void paint(QPainter *painter)=0
This function, which is usually called by the QML Scene Graph, paints the contents of an item in loca...
RenderTarget
This enum describes QQuickPaintedItem's render targets.
\inmodule QtCore\reentrant
constexpr int height() const noexcept
Returns the height of the rectangle.
constexpr bool isNull() const noexcept
Returns true if the rectangle is a null rectangle, otherwise returns false.
constexpr int x() const noexcept
Returns the x-coordinate of the rectangle's left edge.
constexpr int width() const noexcept
Returns the width of the rectangle.
constexpr int y() const noexcept
Returns the y-coordinate of the rectangle's top edge.
void setGeometry(QSGGeometry *geometry)
Sets the geometry of this node to geometry.
void setMaterial(QSGMaterial *material)
Sets the material of this geometry node to material.
The QSGGeometry class provides low-level storage for graphics primitives in the \l{Qt Quick Scene Gra...
The QSGMaterial class encapsulates rendering state for a shader program.
void markDirty(DirtyState bits)
Notifies all connected renderers that the node has dirty bits.
void setDirty(const QRect &dirtyRect=QRect()) override
void setTextureSize(const QSize &size) override
void setPreferredRenderTarget(QQuickPaintedItem::RenderTarget target) override
bool linearFiltering() const
void setOpaquePainting(bool opaque) override
~QSGSoftwarePainterNode()
void setSmoothPainting(bool s) override
void setMipmapping(bool mipmapping) override
QImage toImage() const override
void setContentsScale(qreal s) override
void setFillColor(const QColor &c) override
void setLinearFiltering(bool linearFiltering) override
void setFastFBOResizing(bool dynamic) override
QSGSoftwarePainterNode(QQuickPaintedItem *item)
void setSize(const QSize &size) override
constexpr int height() const noexcept
Returns the height.
constexpr int width() const noexcept
Returns the width.
Combined button and popup list for selecting options.
GLenum GLuint GLintptr GLsizeiptr size
[1]