QCPPaintBufferPixmap

Search for usage in LXR

Inheritance diagram for QCPPaintBufferPixmap:

Public Member Functions

 QCPPaintBufferPixmap (const QSize &size, double devicePixelRatio)
 
void clear (const QColor &color) override
 
virtual void draw (QCPPainter *painter) const override
 
virtual QCPPainterstartPainting () override
 
- Public Member Functions inherited from QCPAbstractPaintBuffer
 QCPAbstractPaintBuffer (const QSize &size, double devicePixelRatio)
 
double devicePixelRatio () const
 
virtual void donePainting ()
 
bool invalidated () const
 
void setDevicePixelRatio (double ratio)
 
void setInvalidated (bool invalidated=true)
 
void setSize (const QSize &size)
 
QSize size () const
 

Protected Member Functions

virtual void reallocateBuffer () override
 
- Protected Member Functions inherited from QCPAbstractPaintBuffer

Protected Attributes

QPixmap mBuffer
 
- Protected Attributes inherited from QCPAbstractPaintBuffer
double mDevicePixelRatio
 
bool mInvalidated
 
QSize mSize
 

Detailed Description

A paint buffer based on QPixmap, using software raster rendering.

This paint buffer is the default and fall-back paint buffer which uses software rendering and QPixmap as internal buffer. It is used if QCustomPlot::setOpenGl is false.

Definition at line 609 of file qcustomplot.h.

Constructor & Destructor Documentation

◆ QCPPaintBufferPixmap()

QCPPaintBufferPixmap::QCPPaintBufferPixmap ( const QSize & size,
double devicePixelRatio )
explicit

Creates a pixmap paint buffer instancen with the specified size and devicePixelRatio, if applicable.

Definition at line 667 of file qcustomplot.cpp.

◆ ~QCPPaintBufferPixmap()

QCPPaintBufferPixmap::~QCPPaintBufferPixmap ( )
overridevirtual

Definition at line 673 of file qcustomplot.cpp.

Member Function Documentation

◆ clear()

void QCPPaintBufferPixmap::clear ( const QColor & color)
overridevirtual

Fills the entire buffer with the provided color. To have an empty transparent buffer, use the named color Qt::transparent.

This method must not be called if there is currently a painter (acquired with startPainting) active.

Implements QCPAbstractPaintBuffer.

Definition at line 697 of file qcustomplot.cpp.

◆ draw()

void QCPPaintBufferPixmap::draw ( QCPPainter * painter) const
overridevirtual

Draws the contents of this buffer with the provided painter. This is the method that is used to finally join all paint buffers and draw them onto the screen.

Implements QCPAbstractPaintBuffer.

Definition at line 688 of file qcustomplot.cpp.

◆ reallocateBuffer()

void QCPPaintBufferPixmap::reallocateBuffer ( )
overrideprotectedvirtual

Reallocates the internal buffer with the currently configured size (setSize) and device pixel ratio, if applicable (setDevicePixelRatio). It is called as soon as any of those properties are changed on this paint buffer.

Note
Subclasses of QCPAbstractPaintBuffer must call their reimplementation of this method in their constructor, to perform the first allocation (this can not be done by the base class because calling pure virtual methods in base class constructors is not possible).

Implements QCPAbstractPaintBuffer.

Definition at line 703 of file qcustomplot.cpp.

◆ startPainting()

QCPPainter * QCPPaintBufferPixmap::startPainting ( )
overridevirtual

Returns a QCPPainter which is ready to draw to this buffer. The ownership and thus the responsibility to delete the painter after the painting operations are complete is given to the caller of this method.

Once you are done using the painter, delete the painter and call donePainting.

While a painter generated with this method is active, you must not call setSize, setDevicePixelRatio or clear.

This method may return 0, if a painter couldn't be activated on the buffer. This usually indicates a problem with the respective painting backend.

Implements QCPAbstractPaintBuffer.

Definition at line 678 of file qcustomplot.cpp.

Member Data Documentation

◆ mBuffer

QPixmap QCPPaintBufferPixmap::mBuffer
protected

Definition at line 622 of file qcustomplot.h.


The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 17:04:48 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.