Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Attributes | Static Private Attributes | List of all members
QwtPaintBuffer Class Reference

Paint buffer for Qwt widgets. More...

#include <qwt_paint_buffer.h>

Collaboration diagram for QwtPaintBuffer:
Collaboration graph
[legend]

Public Member Functions

void close ()
 
const QPaintDevicedevice ()
 
void open (QPaintDevice *, const QRect &, QPainter *painter=NULL)
 
QPainterpainter ()
 
 QwtPaintBuffer ()
 Default constructor. More...
 
 QwtPaintBuffer (QPaintDevice *, const QRect &, QPainter *painter=NULL)
 
virtual ~QwtPaintBuffer ()
 

Static Public Member Functions

static bool isEnabled ()
 
static void setEnabled (bool enable)
 

Protected Member Functions

void flush ()
 

Private Attributes

QPaintDeviced_device
 
QPainterd_devicePainter
 
QPainterd_painter
 
QPixmap d_pixBuffer
 
QRect d_rect
 

Static Private Attributes

static bool d_enabled = TRUE
 

Detailed Description

Paint buffer for Qwt widgets.

QwtPaintBuffer offers a simple way to en/disable double buffering. Double buffering is enabled as default and in general there will be no reason to change this.

Definition at line 38 of file qwt_paint_buffer.h.

Constructor & Destructor Documentation

◆ QwtPaintBuffer() [1/2]

Default constructor.

Definition at line 42 of file qwt_paint_buffer.cpp.

◆ QwtPaintBuffer() [2/2]

QwtPaintBuffer ( QPaintDevice device,
const QRect rect,
QPainter painter = NULL 
)

Create an open paint buffer

Parameters
deviceDevice to paint on
rectRect to paint on
painterPainter to paint on device. In case of 0 QwtPaintBuffer uses an internal painter
See also
QwtPaintBuffer::open()

Definition at line 59 of file qwt_paint_buffer.cpp.

References QwtPaintBuffer::open().

◆ ~QwtPaintBuffer()

~QwtPaintBuffer ( )
virtual

Closes the buffer

See also
QwtPaintBuffer::close()

Definition at line 72 of file qwt_paint_buffer.cpp.

References QwtPaintBuffer::close().

Member Function Documentation

◆ close()

void close ( )

◆ device()

const QPaintDevice * device ( )
Returns
Device to paint on

Definition at line 91 of file qwt_paint_buffer.cpp.

References QwtPaintBuffer::d_device.

Referenced by QwtPaintBuffer::flush(), and QwtPaintBuffer::open().

◆ flush()

void flush ( )
protected

◆ isEnabled()

bool isEnabled ( )
static
Returns
TRUE if double buffering is enabled, FALSE otherwise.

Definition at line 109 of file qwt_paint_buffer.cpp.

References QwtPaintBuffer::d_enabled.

Referenced by QwtPaintBuffer::open().

◆ open()

void open ( QPaintDevice device,
const QRect rect,
QPainter painter = NULL 
)

◆ painter()

QPainter * painter ( )
Returns
Depending on isEnabled() the painter connected to an internal pixmap buffer otherwise the painter connected to the device.

Definition at line 83 of file qwt_paint_buffer.cpp.

References QwtPaintBuffer::d_painter.

Referenced by QwtPaintBuffer::open(), and QtViewWidget::paintEvent().

◆ setEnabled()

void setEnabled ( bool  enable)
static

Enable/Disable double buffering. Please note that this is a global switch for all QwtPaintBuffers, but won't change opened buffers.

Definition at line 101 of file qwt_paint_buffer.cpp.

References QwtPaintBuffer::d_enabled.

Member Data Documentation

◆ d_device

QPaintDevice* d_device
private

◆ d_devicePainter

QPainter* d_devicePainter
private

◆ d_enabled

bool d_enabled = TRUE
staticprivate

◆ d_painter

QPainter* d_painter
private

◆ d_pixBuffer

QPixmap d_pixBuffer
private

◆ d_rect

QRect d_rect
private

Definition at line 60 of file qwt_paint_buffer.h.

Referenced by QwtPaintBuffer::flush(), and QwtPaintBuffer::open().


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

Generated for HippoDraw Class Library by doxygen