SimCenterCommon
Common functionality used within different SimCenter projects
QCPPaintBufferPixmap Class Reference

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

#include <qcustomplot.h>

Inheritance diagram for QCPPaintBufferPixmap:
Collaboration diagram for QCPPaintBufferPixmap:

Public Member Functions

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

Protected Member Functions

virtual void reallocateBuffer () Q_DECL_OVERRIDE
 

Protected Attributes

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

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 547 of file qcustomplot.h.

Constructor & Destructor Documentation

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 656 of file qcustomplot.cpp.

QCPPaintBufferPixmap::~QCPPaintBufferPixmap ( )
virtual

Definition at line 662 of file qcustomplot.cpp.

Member Function Documentation

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

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 684 of file qcustomplot.cpp.

void QCPPaintBufferPixmap::draw ( QCPPainter painter) const
virtual

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 675 of file qcustomplot.cpp.

void QCPPaintBufferPixmap::reallocateBuffer ( )
protectedvirtual

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 690 of file qcustomplot.cpp.

QCPPainter * QCPPaintBufferPixmap::startPainting ( )
virtual

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 667 of file qcustomplot.cpp.

Member Data Documentation

QPixmap QCPPaintBufferPixmap::mBuffer
protected

Definition at line 560 of file qcustomplot.h.


The documentation for this class was generated from the following files: