Main Page | Class Hierarchy | Alphabetical List | Compound List | File List | Compound Members | File Members | Related Pages

QwtPaintBuffer Class Reference

Paint buffer for Qwt widgets. More...

#include <qwt_paint_buffer.h>

List of all members.

Public Member Functions

 QwtPaintBuffer ()
 QwtPaintBuffer (QPaintDevice *, const QRect &, QPainter *p=NULL)
virtual ~QwtPaintBuffer ()
void open (QPaintDevice *, const QRect &, QPainter *p=NULL)
void close ()
QPainter * painter ()
const QPaintDevice * device ()

Static Public Member Functions

void setEnabled (bool enable)
bool isEnabled ()

Protected Member Functions

void flush ()

Private Attributes

QPixmap d_pixBuffer
QRect d_rect
QPaintDevice * d_device
QPainter * d_painter
QPainter * d_devicePainter

Static Private Attributes

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 26 of file qwt_paint_buffer.h.


Constructor & Destructor Documentation

QwtPaintBuffer::QwtPaintBuffer  ) 
 

Default constructor.

Definition at line 17 of file qwt_paint_buffer.cpp.

QwtPaintBuffer::QwtPaintBuffer QPaintDevice *  device,
const QRect &  rect,
QPainter *  painter = NULL
 

Create an open paint buffer

Parameters:
device Device to paint on
rect Rect to paint on
painter Painter to paint on device. In case of 0 QwtPaintBuffer uses an internal painter
See also:
QwtPaintBuffer::open()

Definition at line 34 of file qwt_paint_buffer.cpp.

References open(), and painter().

QwtPaintBuffer::~QwtPaintBuffer  )  [virtual]
 

Closes the buffer

See also:
QwtPaintBuffer::close()

Definition at line 47 of file qwt_paint_buffer.cpp.

References close().


Member Function Documentation

void QwtPaintBuffer::close  ) 
 

Flush the internal pixmap buffer to the device and close the buffer.

Definition at line 172 of file qwt_paint_buffer.cpp.

References d_device, d_devicePainter, d_painter, d_pixBuffer, and flush().

Referenced by open(), and ~QwtPaintBuffer().

const QPaintDevice * QwtPaintBuffer::device  ) 
 

Returns:
Device to paint on

Definition at line 66 of file qwt_paint_buffer.cpp.

References d_device.

Referenced by flush().

void QwtPaintBuffer::flush  )  [protected]
 

Flush the internal pixmap buffer to the device.

Definition at line 145 of file qwt_paint_buffer.cpp.

References d_device, d_devicePainter, d_enabled, d_pixBuffer, d_rect, and device().

Referenced by close().

bool QwtPaintBuffer::isEnabled  )  [static]
 

Returns:
TRUE if double buffering is enabled, FALSE otherwise.

Definition at line 84 of file qwt_paint_buffer.cpp.

References d_enabled.

Referenced by open().

void QwtPaintBuffer::open QPaintDevice *  device,
const QRect &  rect,
QPainter *  painter = NULL
 

Open the buffer

Parameters:
device Device to paint on
rect Rect to paint on
painter Painter to paint on device. In case of 0 QwtPaintBuffer uses an internal painter

Definition at line 97 of file qwt_paint_buffer.cpp.

References close(), d_device, d_devicePainter, d_painter, d_pixBuffer, d_rect, and isEnabled().

Referenced by QwtPaintBuffer().

QPainter * QwtPaintBuffer::painter  ) 
 

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

Definition at line 58 of file qwt_paint_buffer.cpp.

References d_painter.

Referenced by QwtPlotCanvas::drawContents(), QwtWheel::paintEvent(), QwtThermo::paintEvent(), QwtSlider::paintEvent(), QwtScale::paintEvent(), QwtKnob::paintEvent(), QwtDial::paintEvent(), QwtPaintBuffer(), and QwtPlot::replot().

void QwtPaintBuffer::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 76 of file qwt_paint_buffer.cpp.

References d_enabled.


Member Data Documentation

QPaintDevice* QwtPaintBuffer::d_device [private]
 

Definition at line 50 of file qwt_paint_buffer.h.

Referenced by close(), device(), flush(), and open().

QPainter* QwtPaintBuffer::d_devicePainter [private]
 

Definition at line 52 of file qwt_paint_buffer.h.

Referenced by close(), flush(), and open().

bool QwtPaintBuffer::d_enabled = TRUE [static, private]
 

Definition at line 14 of file qwt_paint_buffer.cpp.

Referenced by flush(), isEnabled(), and setEnabled().

QPainter* QwtPaintBuffer::d_painter [private]
 

Definition at line 51 of file qwt_paint_buffer.h.

Referenced by close(), open(), and painter().

QPixmap QwtPaintBuffer::d_pixBuffer [private]
 

Definition at line 47 of file qwt_paint_buffer.h.

Referenced by close(), flush(), and open().

QRect QwtPaintBuffer::d_rect [private]
 

Definition at line 48 of file qwt_paint_buffer.h.

Referenced by flush(), and open().


The documentation for this class was generated from the following files:
Generated on Fri Nov 7 14:11:48 2003 for Qwt Developer's Guide by doxygen 1.3.2