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

QwtPlotCanvas Class Reference

List of all members.

Detailed Description

Canvas of a QwtPlot.

See also:
QwtPlot


Public Types

enum  FocusIndicator {
  NoFocusIndicator,
  CanvasFocusIndicator,
  ItemFocusIndicator
}

Public Member Functions

void setFocusIndicator (FocusIndicator)
FocusIndicator focusIndicator () const
void setCacheMode (bool on)
bool cacheMode () const
const QPixmap * cache () const
void enableOutline (bool tf)
bool outlineEnabled () const
void setOutlinePen (const QPen &p)
const QPen & outlinePen () const
void setOutlineStyle (Qwt::Shape os)
Qwt::Shape outlineStyle () const

Protected Member Functions

 QwtPlotCanvas (QwtPlot *)
QPixmap * cache ()
virtual void frameChanged ()
virtual void drawContents (QPainter *)
virtual void drawFocusIndicator (QPainter *, const QRect &)
void drawCanvas (QPainter *painter=NULL)
void mousePressed (const QMouseEvent &e)
void mouseReleased (const QMouseEvent &e)
void mouseMoved (const QMouseEvent &e)
virtual void mousePressEvent (QMouseEvent *)
virtual void mouseReleaseEvent (QMouseEvent *)
virtual void mouseMoveEvent (QMouseEvent *)

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()


Constructor & Destructor Documentation

QwtPlotCanvas::QwtPlotCanvas QwtPlot  )  [protected]
 

Sets a cross cursor, and an invisible red outline.


Member Function Documentation

QPixmap * QwtPlotCanvas::cache  )  [protected]
 

Return the paint cache, might be null.

const QPixmap * QwtPlotCanvas::cache  )  const
 

Return the paint cache, might be null.

bool QwtPlotCanvas::cacheMode  )  const
 

Returns:
Cache mode
See also:
setCacheMode

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()

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

Redraw the canvas, and focus rect.

void QwtPlotCanvas::enableOutline bool  tf  ) 
 

Enables or disables outline drawing. When the outline feature is enabled, a shape will be drawn in the plotting region when the user presses or drags the mouse. It can be used to implement crosshairs, mark a selected region, etc.

Parameters:
tf TRUE (enabled) or FALSE (disabled)
Warning:
An outline style has to be specified.
See also:
QwtPlotCanvas::setOutlineStyle()

QwtPlotCanvas::FocusIndicator QwtPlotCanvas::focusIndicator  )  const
 

Returns:
Focus indicator
See also:
FocusIndicator, setFocusIndicator

void QwtPlotCanvas::frameChanged  )  [protected, virtual]
 

Requires layout updates of the parent plot.

void QwtPlotCanvas::mouseMoved const QMouseEvent &  e  )  [protected]
 

A signal which is emitted when the mouse is moved in the canvas.

Parameters:
e Mouse event object

void QwtPlotCanvas::mouseMoveEvent QMouseEvent *   )  [protected, virtual]
 

mouseMoveEvent

void QwtPlotCanvas::mousePressed const QMouseEvent &  e  )  [protected]
 

A signal which is emitted when the mouse is pressed in the canvas.

Parameters:
e Mouse event object

void QwtPlotCanvas::mousePressEvent QMouseEvent *   )  [protected, virtual]
 

mousePressEvent

void QwtPlotCanvas::mouseReleased const QMouseEvent &  e  )  [protected]
 

A signal which is emitted when a mouse button has been released in the canvas.

Parameters:
e Mouse event object

void QwtPlotCanvas::mouseReleaseEvent QMouseEvent *   )  [protected, virtual]
 

mouseReleaseEvent

bool QwtPlotCanvas::outlineEnabled  )  const
 

Returns:
TRUE if the outline feature is enabled
See also:
QwtPlotCanvas::enableOutline

const QPen & QwtPlotCanvas::outlinePen  )  const
 

Returns:
the pen used to draw outlines
See also:
QwtPlotCanvas::setOutlinePen

Qwt::Shape QwtPlotCanvas::outlineStyle  )  const
 

Returns:
the outline style
See also:
QwtPlotCanvas::setOutlineStyle()

void QwtPlotCanvas::setCacheMode bool  on  ) 
 

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()

void QwtPlotCanvas::setFocusIndicator FocusIndicator  focusIndicator  ) 
 

Set the focus indicator

See also:
FocusIndicator, focusIndicator

void QwtPlotCanvas::setOutlinePen const QPen &  pen  ) 
 

Specify a pen for the outline.

Parameters:
pen new pen
See also:
QwtPlotCanvas::outlinePen

void QwtPlotCanvas::setOutlineStyle Qwt::Shape  os  ) 
 

Specify the style of the outline.

The outline style determines which kind of shape is drawn in the plotting region when the user presses a mouse button or drags the mouse. Valid Styles are:

Parameters:
os Outline Style. Valid values are: Qwt::HLine, Qwt::VLine, Qwt::Cross, Qwt::Rect, Qwt::Ellipse
Qwt::Cros
Cross hairs are drawn across the plotting area when the user presses a mouse button. The lines intersect at the point where the mouse was pressed and move with the mouse pointer.
Qwt::HLine, Qwt::VLine
A horizontal or vertical line appears when the user presses a mouse button. This is useful for moving line markers.
Qwt::Rect
A rectangle is displayed when the user drags the mouse. One corner is fixed at the point where the mouse was pressed, and the opposite corner moves with the mouse pointer. This can be used for selecting regions.
Qwt::Ellipse
Similar to Qwt::Rect, but with an ellipse inside a bounding rectangle.
See also:
QwtPlotCanvas::enableOutline(), QwtPlotCanvas::outlineStyle()


Generated on Tue Nov 4 09:53:50 2003 for Qwt User's Guide by doxygen 1.3.4