QwtPlotGrid Class Reference
A class which draws a coordinate grid.
More...
#include <qwt_plot_grid.h>
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 setXDiv() and setYDiv(). The draw() member draws the grid within a bounding rectangle.
Constructor & Destructor Documentation
QwtPlotGrid::QwtPlotGrid |
( |
|
) |
[explicit] |
Enables major grid, disables minor grid.
QwtPlotGrid::~QwtPlotGrid |
( |
|
) |
[virtual] |
Member Function Documentation
void QwtPlotGrid::draw |
( |
QPainter * |
painter, |
|
|
const QwtScaleMap & |
xMap, |
|
|
const QwtScaleMap & |
yMap, |
|
|
const QRectF & |
canvasRect | |
|
) |
| | 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 |
| xMap | X axis map |
| yMap | Y axis |
| canvasRect | Contents rect of the plot canvas |
Implements QwtPlotItem.
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 enableXMin()
void QwtPlotGrid::enableXMin |
( |
bool |
tf |
) |
|
Enable or disable minor vertical gridlines.
- Parameters:
-
| tf | Enable (true) or disable |
- See also:
- enableX()
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 enableYMin()
void QwtPlotGrid::enableYMin |
( |
bool |
tf |
) |
|
Enable or disable minor horizontal gridlines.
- Parameters:
-
| tf | Enable (true) or disable |
- See also:
- enableY()
const QPen & QwtPlotGrid::majPen |
( |
|
) |
const |
const QPen & QwtPlotGrid::minPen |
( |
|
) |
const |
int QwtPlotGrid::rtti |
( |
|
) |
const [virtual] |
- Returns:
- QwtPlotItem::Rtti_PlotGrid
Reimplemented from QwtPlotItem.
void QwtPlotGrid::setMajPen |
( |
const QPen & |
pen |
) |
|
void QwtPlotGrid::setMinPen |
( |
const QPen & |
pen |
) |
|
void QwtPlotGrid::setPen |
( |
const QPen & |
pen |
) |
|
Assign a pen for both major and minor gridlines
- Parameters:
-
- See also:
- setMajPen(), setMinPen(), QwtPainter::scaledPen()
void QwtPlotGrid::setXDiv |
( |
const QwtScaleDiv & |
scaleDiv |
) |
|
Assign an x axis scale division
- Parameters:
-
void QwtPlotGrid::setYDiv |
( |
const QwtScaleDiv & |
scaleDiv |
) |
|
Assign a y axis division
- Parameters:
-
Update the grid to changes of the axes scale division
- Parameters:
-
| xScaleDiv | Scale division of the x-axis |
| yScaleDiv | Scale division of the y-axis |
- See also:
- QwtPlot::updateAxes()
Reimplemented from QwtPlotItem.
bool QwtPlotGrid::xEnabled |
( |
|
) |
const |
- Returns:
- true if vertical gridlines are enabled
- See also:
- enableX()
bool QwtPlotGrid::xMinEnabled |
( |
|
) |
const |
- Returns:
- true if minor vertical gridlines are enabled
- See also:
- enableXMin()
- Returns:
- the scale division of the x axis
bool QwtPlotGrid::yEnabled |
( |
|
) |
const |
- Returns:
- true if horizontal gridlines are enabled
- See also:
- enableY()
bool QwtPlotGrid::yMinEnabled |
( |
|
) |
const |
- Returns:
- true if minor horizontal gridlines are enabled
- See also:
- enableYMin()
- Returns:
- the scale division of the y axis