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

QwtPlotGrid Class Reference

Inheritance diagram for QwtPlotGrid:

Inheritance graph
[legend]
Collaboration diagram for QwtPlotGrid:

Collaboration graph
[legend]
List of all members.

Detailed Description

A class which draws a coordinate grid.

The QwtPlotGrid class can be used to draw a coordinate grid. A coordinate grid consists of major and minor vertical and horizontal gridlines. The locations of the gridlines are determined by the X and Y scale divisions which can be assigned with QwtPlotGrid::setXDiv and QwtPlotGrid::setYDiv() The draw() member draws the grid within a bounding rectangle.

Definition at line 34 of file qwt_plot_grid.h.

Public Member Functions

 QwtPlotGrid ()
virtual ~QwtPlotGrid ()
virtual int rtti () const
void enableX (bool tf)
bool xEnabled () const
void enableY (bool tf)
bool yEnabled () const
void enableXMin (bool tf)
bool xMinEnabled () const
void enableYMin (bool tf)
bool yMinEnabled () const
void setXDiv (const QwtScaleDiv &sx)
const QwtScaleDivxScaleDiv () const
void setYDiv (const QwtScaleDiv &sy)
const QwtScaleDivyScaleDiv () const
void setPen (const QPen &p)
void setMajPen (const QPen &p)
const QPen & majPen () const
void setMinPen (const QPen &p)
const QPen & minPen () const
virtual void draw (QPainter *p, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRect &rect) const
virtual void updateScaleDiv (const QwtScaleDiv &, const QwtScaleDiv &)

Protected Member Functions

virtual void gridChanged ()


Constructor & Destructor Documentation

QwtPlotGrid::QwtPlotGrid  )  [explicit]
 

Enables major grid, disables minor grid.

Definition at line 41 of file qwt_plot_grid.cpp.

References QwtPlotItem::setZ().

QwtPlotGrid::~QwtPlotGrid  )  [virtual]
 

dtor

Definition at line 48 of file qwt_plot_grid.cpp.


Member Function Documentation

void QwtPlotGrid::draw QPainter *  painter,
const QwtScaleMap mx,
const QwtScaleMap my,
const QRect &  r
const [virtual]
 

Draw the grid.

The grid is drawn into the bounding rectangle such that gridlines begin and end at the rectangle's borders. The X and Y maps are used to map the scale divisions into the drawing region screen.

Parameters:
painter Painter
mx X axis map
my Y axis
r Contents rect of the plot canvas

Implements QwtPlotItem.

Definition at line 200 of file qwt_plot_grid.cpp.

void QwtPlotGrid::enableX bool  tf  ) 
 

Enable or disable vertical gridlines.

Parameters:
tf Enable (true) or disable
See also:
Minor gridlines can be enabled or disabled with QwtPlotGrid::enableXMin()

Definition at line 65 of file qwt_plot_grid.cpp.

References gridChanged().

void QwtPlotGrid::enableXMin bool  tf  ) 
 

Enable or disable minor vertical gridlines.

Parameters:
tf Enable (true) or disable
See also:
QwtPlotGrid::enableX()

Definition at line 93 of file qwt_plot_grid.cpp.

References gridChanged().

void QwtPlotGrid::enableY bool  tf  ) 
 

Enable or disable horizontal gridlines.

Parameters:
tf Enable (true) or disable
See also:
Minor gridlines can be enabled or disabled with QwtPlotGrid::enableYMin()

Definition at line 79 of file qwt_plot_grid.cpp.

References gridChanged().

void QwtPlotGrid::enableYMin bool  tf  ) 
 

Enable or disable minor horizontal gridlines.

Parameters:
tf Enable (true) or disable
See also:
QwtPlotGrid::enableY()

Definition at line 107 of file qwt_plot_grid.cpp.

References gridChanged().

void QwtPlotGrid::gridChanged  )  [protected, virtual]
 

Notify a change of attributes.

This virtual function is called when an attribute of the grid has changed. It can be redefined by derived classes. The default implementation does nothing.

Definition at line 345 of file qwt_plot_grid.cpp.

References QwtPlotItem::itemChanged().

Referenced by enableX(), enableXMin(), enableY(), enableYMin(), setMajPen(), setMinPen(), setPen(), setXDiv(), and setYDiv().

const QPen & QwtPlotGrid::majPen  )  const
 

Returns:
the pen for the major gridlines
See also:
QwtPlotGrid::setMinPen, QwtPlotGrid::setPen

Definition at line 268 of file qwt_plot_grid.cpp.

Referenced by QwtPlotPrintFilter::apply(), and QwtPlotPrintFilter::reset().

const QPen & QwtPlotGrid::minPen  )  const
 

Returns:
the pen for the minor gridlines
See also:
QwtPlotGrid::setMinPen, QwtPlotGrid::setPen

Definition at line 277 of file qwt_plot_grid.cpp.

Referenced by QwtPlotPrintFilter::apply(), and QwtPlotPrintFilter::reset().

void QwtPlotGrid::setMajPen const QPen &  p  ) 
 

Assign a pen for the major gridlines.

Parameters:
p Pen

Definition at line 166 of file qwt_plot_grid.cpp.

References gridChanged().

Referenced by QwtPlotPrintFilter::apply(), and QwtPlotPrintFilter::reset().

void QwtPlotGrid::setMinPen const QPen &  p  ) 
 

Assign a pen for the minor gridlines.

Parameters:
p Pen

Definition at line 179 of file qwt_plot_grid.cpp.

References gridChanged().

Referenced by QwtPlotPrintFilter::apply(), and QwtPlotPrintFilter::reset().

void QwtPlotGrid::setPen const QPen &  p  ) 
 

Assign a pen for both major and minor gridlines.

Parameters:
p Pen

Definition at line 152 of file qwt_plot_grid.cpp.

References gridChanged().

void QwtPlotGrid::setXDiv const QwtScaleDiv sx  ) 
 

Assign an x axis scale division.

Parameters:
sx Scale division
Warning:
QwtPlotGrid uses implicit sharing (see Qt Manual) for the scale divisions.
See also:
QwtScaleDiv

Definition at line 123 of file qwt_plot_grid.cpp.

References gridChanged().

Referenced by updateScaleDiv().

void QwtPlotGrid::setYDiv const QwtScaleDiv sy  ) 
 

Assign a y axis division.

Parameters:
sy Scale division
Warning:
QwtPlotGrid uses implicit sharing (see Qt Manual) for the scale divisions.
See also:
QwtScaleDiv

Definition at line 139 of file qwt_plot_grid.cpp.

References gridChanged().

Referenced by updateScaleDiv().

bool QwtPlotGrid::xEnabled  )  const
 

Returns:
true if vertical gridlines are enabled
See also:
QwtPlotGrid::enableX

Definition at line 286 of file qwt_plot_grid.cpp.

bool QwtPlotGrid::xMinEnabled  )  const
 

Returns:
true if minor vertical gridlines are enabled
See also:
QwtPlotGrid::enableXMin

Definition at line 295 of file qwt_plot_grid.cpp.

const QwtScaleDiv & QwtPlotGrid::xScaleDiv  )  const
 

Returns:
the scale division of the x axis

Definition at line 320 of file qwt_plot_grid.cpp.

bool QwtPlotGrid::yEnabled  )  const
 

Returns:
true if horizontal gridlines are enabled
See also:
QwtPlotGrid::enableY

Definition at line 304 of file qwt_plot_grid.cpp.

bool QwtPlotGrid::yMinEnabled  )  const
 

Returns:
true if minor horizontal gridlines are enabled
See also:
QwtPlotGrid::enableYMin

Definition at line 313 of file qwt_plot_grid.cpp.

const QwtScaleDiv & QwtPlotGrid::yScaleDiv  )  const
 

Returns:
the scale division of the y axis

Definition at line 326 of file qwt_plot_grid.cpp.


Generated on Mon Jan 30 22:17:28 2006 for Qwt User's Guide by  doxygen 1.4.4