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

QwtPlotCanvas Class Reference

Canvas of a QwtPlot. More...

#include <qwt_plot_canvas.h>

List of all members.

Signals

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

Public Member Functions

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 void frameChanged ()
virtual void drawContents (QPainter *)
virtual void mousePressEvent (QMouseEvent *e)
virtual void mouseReleaseEvent (QMouseEvent *e)
virtual void mouseMoveEvent (QMouseEvent *e)

Private Member Functions

void drawOutline (QPainter &p)

Private Attributes

Q_OBJECT friend class QwtPlot
bool d_outlineEnabled
bool d_outlineActive
bool d_mousePressed
Qwt::Shape d_outline
QPen d_pen
QPoint d_entryPoint
QPoint d_lastPoint


Detailed Description

Canvas of a QwtPlot.

See also:
QwtPlot

Definition at line 24 of file qwt_plot_canvas.h.


Constructor & Destructor Documentation

QwtPlotCanvas::QwtPlotCanvas QwtPlot  )  [protected]
 

Sets a cross cursor, and an invisible red outline.

Definition at line 21 of file qwt_plot_canvas.cpp.


Member Function Documentation

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

Redraw the canvas.

Definition at line 44 of file qwt_plot_canvas.cpp.

References d_outlineActive, drawOutline(), and QwtPaintBuffer::painter().

void QwtPlotCanvas::drawOutline QPainter &  p  )  [private]
 

draw an outline

Definition at line 258 of file qwt_plot_canvas.cpp.

References Qwt::Cross, d_entryPoint, d_lastPoint, d_outline, d_pen, QwtPainter::drawLine(), QwtPainter::drawRect(), Qwt::Ellipse, Qwt::HLine, Qwt::Rect, and Qwt::VLine.

Referenced by drawContents(), enableOutline(), mouseMoveEvent(), mousePressEvent(), mouseReleaseEvent(), and setOutlineStyle().

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

Definition at line 151 of file qwt_plot_canvas.cpp.

References d_mousePressed, d_outlineActive, d_outlineEnabled, and drawOutline().

Referenced by QwtPlot::enableOutline().

void QwtPlotCanvas::frameChanged  )  [protected, virtual]
 

Requires layout updates of the parent plot.

Definition at line 33 of file qwt_plot_canvas.cpp.

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

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

Parameters:
e Mouse event object

Referenced by mouseMoveEvent().

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

mouseMoveEvent

Definition at line 124 of file qwt_plot_canvas.cpp.

References d_lastPoint, d_outlineActive, drawOutline(), and mouseMoved().

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

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

Parameters:
e Mouse event object

Referenced by mousePressEvent().

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

mousePressEvent

Definition at line 73 of file qwt_plot_canvas.cpp.

References d_entryPoint, d_lastPoint, d_mousePressed, d_outlineActive, d_outlineEnabled, drawOutline(), and mousePressed().

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

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

Parameters:
e Mouse event object

Referenced by mouseReleaseEvent().

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

mouseReleaseEvent

Definition at line 106 of file qwt_plot_canvas.cpp.

References d_mousePressed, d_outlineActive, drawOutline(), and mouseReleased().

bool QwtPlotCanvas::outlineEnabled  )  const
 

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

Definition at line 172 of file qwt_plot_canvas.cpp.

References d_outlineEnabled.

Referenced by QwtPlot::outlineEnabled().

const QPen & QwtPlotCanvas::outlinePen  )  const
 

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

Definition at line 250 of file qwt_plot_canvas.cpp.

References d_pen.

Referenced by QwtPlot::outlinePen().

Qwt::Shape QwtPlotCanvas::outlineStyle  )  const
 

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

Definition at line 229 of file qwt_plot_canvas.cpp.

References d_outline, and Qwt::Shape.

Referenced by QwtPlot::outlineStyle().

void QwtPlotCanvas::setOutlinePen const QPen &  pen  ) 
 

Specify a pen for the outline.

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

Definition at line 240 of file qwt_plot_canvas.cpp.

References d_pen.

Referenced by QwtPlot::setOutlinePen().

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

Definition at line 208 of file qwt_plot_canvas.cpp.

References d_outline, d_outlineActive, and drawOutline().

Referenced by QwtPlot::setOutlineStyle().


Member Data Documentation

QPoint QwtPlotCanvas::d_entryPoint [private]
 

Definition at line 79 of file qwt_plot_canvas.h.

Referenced by drawOutline(), and mousePressEvent().

QPoint QwtPlotCanvas::d_lastPoint [private]
 

Definition at line 80 of file qwt_plot_canvas.h.

Referenced by drawOutline(), mouseMoveEvent(), and mousePressEvent().

bool QwtPlotCanvas::d_mousePressed [private]
 

Definition at line 75 of file qwt_plot_canvas.h.

Referenced by enableOutline(), mousePressEvent(), and mouseReleaseEvent().

Qwt::Shape QwtPlotCanvas::d_outline [private]
 

Definition at line 76 of file qwt_plot_canvas.h.

Referenced by drawOutline(), outlineStyle(), and setOutlineStyle().

bool QwtPlotCanvas::d_outlineActive [private]
 

Definition at line 74 of file qwt_plot_canvas.h.

Referenced by drawContents(), enableOutline(), mouseMoveEvent(), mousePressEvent(), mouseReleaseEvent(), and setOutlineStyle().

bool QwtPlotCanvas::d_outlineEnabled [private]
 

Definition at line 73 of file qwt_plot_canvas.h.

Referenced by enableOutline(), mousePressEvent(), and outlineEnabled().

QPen QwtPlotCanvas::d_pen [private]
 

Definition at line 78 of file qwt_plot_canvas.h.

Referenced by drawOutline(), outlinePen(), and setOutlinePen().

Q_OBJECT friend class QwtPlotCanvas::QwtPlot [private]
 

Definition at line 27 of file qwt_plot_canvas.h.


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