QwtPlotCanvas(3)

NAME
QwtPlotCanvas -

SYNOPSIS

Detailed Description

Canvas of a QwtPlot. See also:
    QwtPlot

Definition at line 29 of file qwt_plot_canvas.h.

  Public Types
enum FocusIndicator { NoFocusIndicator, CanvasFocusIndicator, ItemFocusIndicator }

  Signals
void mousePressed (const QMouseEvent &e)
void mouseReleased (const QMouseEvent &e)
void mouseMoved (const QMouseEvent &e)

  Public Member Functions
void setFocusIndicator (FocusIndicator)
FocusIndicator focusIndicator () const
void setCacheMode (bool on)
bool cacheMode () const
const QPixmap * cache () const
void invalidateCache ()
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 *)
virtual ~QwtPlotCanvas ()
QPixmap * cache ()
virtual void frameChanged ()
virtual void drawContents (QPainter *)
virtual void drawFocusIndicator (QPainter *, const QRect &)
void drawCanvas (QPainter *painter=NULL)
virtual void mousePressEvent (QMouseEvent *)
virtual void mouseReleaseEvent (QMouseEvent *)
virtual void mouseMoveEvent (QMouseEvent *)

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 51 of file qwt_plot_canvas.h.

Referenced by focusIndicator().

Constructor & Destructor Documentation

  QwtPlotCanvas::QwtPlotCanvas (QwtPlot *) [protected]

Sets a cross cursor, and an invisible red outline.

Definition at line 25 of file qwt_plot_canvas.cpp.

  QwtPlotCanvas::~QwtPlotCanvas () [protected, virtual]

Destructor.

Definition at line 42 of file qwt_plot_canvas.cpp.

Member Function Documentation

  QPixmap * QwtPlotCanvas::cache () [protected]

Return the paint cache, might be null.

Definition at line 89 of file qwt_plot_canvas.cpp.

  const QPixmap * QwtPlotCanvas::cache () const

Return the paint cache, might be null.

Definition at line 95 of file qwt_plot_canvas.cpp.

Referenced by QwtPlot::drawCurve().

  bool QwtPlotCanvas::cacheMode () const

Returns:
    Cache mode

See also:
    setCacheMode

Definition at line 83 of file qwt_plot_canvas.cpp.

Referenced by drawCanvas(), drawContents(), and QwtPlot::drawCurve().

  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 174 of file qwt_plot_canvas.cpp.

References QwtPaintBuffer::buffer(), cacheMode(), QwtPaintBuffer::isEnabled(), and QwtPaintBuffer::painter().

Referenced by drawContents().

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

Redraw the canvas, and focus rect.

Definition at line 139 of file qwt_plot_canvas.cpp.

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

  void QwtPlotCanvas::drawFocusIndicator (QPainter *, const QRect &) [protected, virtual]

Draw the focus indication.

Definition at line 221 of file qwt_plot_canvas.cpp.

Referenced by drawContents().

  void QwtPlotCanvas::enableOutline (bool tf)

Enables or disables outline drawing.

Warning:
    Outlining functionality is obsolete: use QwtPlotPicker or QwtPlotZoomer.

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

Definition at line 315 of file qwt_plot_canvas.cpp.

Referenced by QwtPlot::enableOutline().

  QwtPlotCanvas::FocusIndicator QwtPlotCanvas::focusIndicator () const

Returns:
    Focus indicator

See also:
    FocusIndicator, setFocusIndicator

Definition at line 122 of file qwt_plot_canvas.cpp.

References FocusIndicator.

Referenced by drawContents().

  void QwtPlotCanvas::frameChanged () [protected, virtual]

Requires layout updates of the parent plot.

Definition at line 128 of file qwt_plot_canvas.cpp.

  void QwtPlotCanvas::invalidateCache ()

Invalidate the internal paint cache.

Definition at line 101 of file qwt_plot_canvas.cpp.

Referenced by QwtPlot::replot().

  void QwtPlotCanvas::mouseMoved (const QMouseEvent & e) [signal]

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

Warning:
    Outlining functionality is obsolete: use QwtPlotPicker or QwtPlotZoomer.

Parameters:
    e Mouse event object

Referenced by mouseMoveEvent().

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

Mouse event handler.

Definition at line 284 of file qwt_plot_canvas.cpp.

References mouseMoved().

  void QwtPlotCanvas::mousePressed (const QMouseEvent & e) [signal]

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

Warning:
    Outlining functionality is obsolete: use QwtPlotPicker or QwtPlotZoomer.

Parameters:
    e Mouse event object

Referenced by mousePressEvent().

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

Mouse event handler.

Definition at line 234 of file qwt_plot_canvas.cpp.

References mousePressed().

  void QwtPlotCanvas::mouseReleased (const QMouseEvent & e) [signal]

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

Warning:
    Outlining functionality is obsolete: use QwtPlotPicker or QwtPlotZoomer.

Parameters:
    e Mouse event object

Referenced by mouseReleaseEvent().

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

Mouse event handler.

Definition at line 266 of file qwt_plot_canvas.cpp.

References mouseReleased().

  bool QwtPlotCanvas::outlineEnabled () const

Returns:
    TRUE if the outline feature is enabled

Warning:
    Outlining functionality is obsolete: use QwtPlotPicker or QwtPlotZoomer.

See also:
    QwtPlotCanvas::enableOutline

Definition at line 340 of file qwt_plot_canvas.cpp.

Referenced by QwtPlot::outlineEnabled().

  const QPen & QwtPlotCanvas::outlinePen () const

Returns:
    the pen used to draw outlines

Warning:
    Outlining functionality is obsolete: use QwtPlotPicker or QwtPlotZoomer.

See also:
    QwtPlotCanvas::setOutlinePen

Definition at line 433 of file qwt_plot_canvas.cpp.

Referenced by QwtPlot::outlinePen().

  Qwt::Shape QwtPlotCanvas::outlineStyle () const

Returns:
    the outline style

Warning:
    Outlining functionality is obsolete: use QwtPlotPicker or QwtPlotZoomer.

See also:
    QwtPlotCanvas::setOutlineStyle()

Definition at line 404 of file qwt_plot_canvas.cpp.

Referenced by QwtPlot::outlineStyle().

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

Definition at line 66 of file qwt_plot_canvas.cpp.

  void QwtPlotCanvas::setFocusIndicator (FocusIndicator focusIndicator)

Set the focus indicator

See also:
    FocusIndicator, focusIndicator

Definition at line 112 of file qwt_plot_canvas.cpp.

  void QwtPlotCanvas::setOutlinePen (const QPen & pen)

Specify a pen for the outline.

Warning:
    Outlining functionality is obsolete: use QwtPlotPicker or QwtPlotZoomer.

Parameters:
    pen new pen

See also:
    QwtPlotCanvas::outlinePen

Definition at line 419 of file qwt_plot_canvas.cpp.

Referenced by QwtPlot::setOutlinePen().

  void QwtPlotCanvas::setOutlineStyle (Qwt::Shape os)

Specify the style of the outline.

Warning:
    Outlining functionality is obsolete: use QwtPlotPicker or QwtPlotZoomer.

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

Definition at line 379 of file qwt_plot_canvas.cpp.

Referenced by QwtPlot::setOutlineStyle().

Author

Generated automatically by Doxygen for Qwt User's Guide from the source code.