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

QwtPlotCanvas Class Reference

List of all members.

Detailed Description

Canvas of a QwtPlot.

See also:
QwtPlot

Definition at line 28 of file qwt_plot_canvas.h.

Public Types

enum  PaintAttribute {
  PaintCached = 1,
  PaintPacked = 2
}
enum  FocusIndicator {
  NoFocusIndicator,
  CanvasFocusIndicator,
  ItemFocusIndicator
}

Public Member Functions

void setFocusIndicator (FocusIndicator)
FocusIndicator focusIndicator () const
void setPaintAttribute (PaintAttribute, bool on=true)
bool testPaintAttribute (PaintAttribute) const
QPixmap * cache ()
const QPixmap * cache () const
void invalidateCache ()

Protected Member Functions

 QwtPlotCanvas (QwtPlot *)
virtual ~QwtPlotCanvas ()
virtual void hideEvent (QHideEvent *)
virtual void paintEvent (QPaintEvent *)
virtual void drawContents (QPainter *)
virtual void drawFocusIndicator (QPainter *)
void drawCanvas (QPainter *painter=NULL)

Friends

class QwtPlot


Member Enumeration Documentation

enum QwtPlotCanvas::FocusIndicator
 

Focus indicator.

  • NoFocusIndicator
    Donīt paint a focus indicator

  • CanvasFocusIndicator
    The focus is related to the complete canvas. Paint the focus indicator using paintFocus()

  • ItemFocusIndicator
    The focus is related to an item (curve, point, ...) on the canvas. It is up to the application to display a focus indication using f.e. highlighting.

See also:
setFocusIndicator(), focusIndicator(), paintFocus()

Definition at line 76 of file qwt_plot_canvas.h.

enum QwtPlotCanvas::PaintAttribute
 

Paint attributes.

  • PaintCached
    Paint double buffered and reuse the content of the pixmap buffer for some spontaneous repaints. Disabling the cache mode will will improve the performance for incremental paints (like QwtPlotCurve::draw).

  • PaintPacked
    Suppress system background repaints and paint it together with the canvas contents. Painting packed might avoid flickering for expensive repaints, when there is a notable gap between painting the background and the plot contents. This might be necessary, when using a complex QwtPlotPicker.

Definition at line 52 of file qwt_plot_canvas.h.


Constructor & Destructor Documentation

QwtPlotCanvas::QwtPlotCanvas QwtPlot  )  [explicit, protected]
 

Sets a cross cursor, enables QwtPlotCanvas::PaintCached.

Definition at line 50 of file qwt_plot_canvas.cpp.

References setPaintAttribute().

QwtPlotCanvas::~QwtPlotCanvas  )  [protected, virtual]
 

Destructor.

Definition at line 86 of file qwt_plot_canvas.cpp.


Member Function Documentation

const QPixmap * QwtPlotCanvas::cache  )  const
 

Return the paint cache, might be null.

Definition at line 172 of file qwt_plot_canvas.cpp.

QPixmap * QwtPlotCanvas::cache  ) 
 

Return the paint cache, might be null.

Definition at line 166 of file qwt_plot_canvas.cpp.

Referenced by QwtPlotCurve::draw().

void QwtPlotCanvas::drawCanvas QPainter *  painter = NULL  )  [protected]
 

Draw the the canvas

Paints all plot items to the contentsRect(), using QwtPlot::drawCanvas and updates the cache.

See also:
QwtPlot::drawCanvas, setCacheMode(), cacheMode()

Definition at line 268 of file qwt_plot_canvas.cpp.

Referenced by drawContents().

void QwtPlotCanvas::drawContents QPainter *   )  [protected, virtual]
 

Redraw the canvas, and focus rect.

Definition at line 245 of file qwt_plot_canvas.cpp.

References drawCanvas(), drawFocusIndicator(), and focusIndicator().

void QwtPlotCanvas::drawFocusIndicator QPainter *   )  [protected, virtual]
 

Draw the focus indication.

Definition at line 339 of file qwt_plot_canvas.cpp.

Referenced by drawContents().

QwtPlotCanvas::FocusIndicator QwtPlotCanvas::focusIndicator  )  const
 

Returns:
Focus indicator
See also:
FocusIndicator, setFocusIndicator

Definition at line 199 of file qwt_plot_canvas.cpp.

Referenced by drawContents().

void QwtPlotCanvas::invalidateCache  ) 
 

Invalidate the internal paint cache.

Definition at line 178 of file qwt_plot_canvas.cpp.

Referenced by QwtPlot::replot().

void QwtPlotCanvas::setFocusIndicator FocusIndicator  focusIndicator  ) 
 

Set the focus indicator

See also:
FocusIndicator, focusIndicator

Definition at line 189 of file qwt_plot_canvas.cpp.

void QwtPlotCanvas::setPaintAttribute PaintAttribute  attribute,
bool  on = true
 

En/Disable caching.

When cache mode is enabled the canvas contents are copied to a pixmap that is used for trivial repaints. Such repaints happen when a plot gets unhidden, deiconified or changes the focus.

The win of caching depends on the costs of QwtPlot::drawCanvas. In case of plots with huge data it might be significant. The price of caching is wasting memory for the cache, what is a pixmap in size of contentsRect(). In case of QwtPaintBuffer::isEnabled() updating the cache produces no performance overhead as it reuses the temporary paintbuffer of the double buffering. Otherwise canvas updates have to painted twice to widget and cache.

Parameters:
on Enable caching, when true
See also:
cacheMode(), drawCanvas(), drawContents(), cache()

Definition at line 110 of file qwt_plot_canvas.cpp.

Referenced by QwtPlotCanvas().


Generated on Wed Aug 31 23:03:35 2005 for Qwt User's Guide by  doxygen 1.4.1