GobChartsWidget
1.0
|
Generates and manages grid and axes lines. More...
#include <gobchartsgrid.h>
Signals | |
void | lastDebugLogMsg (QString) |
Broadcast debug messages. | |
Public Member Functions | |
GobChartsGrid (QObject *parent=0) | |
Constructor. | |
virtual | ~GobChartsGrid () |
Destructor. | |
void | addGridToScene (QGraphicsScene *scene) |
Adds the axes and grid lines (if any) to "scene". | |
void | removeGridFromScene (QGraphicsScene *scene) |
Removes the axes and grid lines (if any) from "scene". | |
void | constructGrid () |
Constructs grid and axes lines. | |
void | setGridRectF (const QRectF &rect) |
Sets the grid's spatial dimensions. | |
void | setGridLineStyle (Qt::PenStyle style) |
Set the pen style used to draw the grid lines. | |
void | setHorizontalGridLines (bool set, int number) |
Set horizontal grid lines. | |
void | setVerticalGridLines (bool set, int number) |
Set horizontal grid lines. | |
void | setGridColour (QColor colour) |
Sets the grid line's colour to "colour". | |
qreal | gridWidth () const |
Returns the grid's width. | |
void | setDebugLoggingOn (bool logging) |
Turn debug logging "on" or "off" (default "off"). | |
Generates and manages grid and axes lines.
GobChartsGrid maintains a list of all grid lines as well as the chart's x and y axes. Line lengths and positions are recalculated when constructGrid() is called, are determined by the dimensions and restricted to the boundaries of the grid's rectangle. The class furthermore provides the functionality to add or remove the lines to a QGraphicsScene.
Definition at line 40 of file gobchartsgrid.h.
void GobChartsGrid::addGridToScene | ( | QGraphicsScene * | scene | ) |
Adds the axes and grid lines (if any) to "scene".
Definition at line 69 of file gobchartsgrid.cpp.
void GobChartsGrid::constructGrid | ( | ) |
Constructs grid and axes lines.
Deletes all existing line items, recalculates the grid's dimensions and creates the new axes and grid lines according to the geometric settings and custom grid specifications.
Definition at line 109 of file gobchartsgrid.cpp.
qreal GobChartsGrid::gridWidth | ( | ) | const |
Returns the grid's width.
Definition at line 187 of file gobchartsgrid.cpp.
|
signal |
Broadcast debug messages.
This signal broadcasts the last debug log message and will only be emitted when debug logging is turned "on".
void GobChartsGrid::removeGridFromScene | ( | QGraphicsScene * | scene | ) |
Removes the axes and grid lines (if any) from "scene".
Definition at line 89 of file gobchartsgrid.cpp.
void GobChartsGrid::setDebugLoggingOn | ( | bool | logging | ) |
Turn debug logging "on" or "off" (default "off").
Definition at line 224 of file gobchartsgrid.cpp.
void GobChartsGrid::setGridColour | ( | QColor | colour | ) |
Sets the grid line's colour to "colour".
Definition at line 210 of file gobchartsgrid.cpp.
void GobChartsGrid::setGridLineStyle | ( | Qt::PenStyle | style | ) |
Set the pen style used to draw the grid lines.
style | - dashed, dotted, solid, etc. (see Qt API documentation for details on the enum). |
Definition at line 217 of file gobchartsgrid.cpp.
void GobChartsGrid::setGridRectF | ( | const QRectF & | rect | ) |
Sets the grid's spatial dimensions.
The grid will be confined to the dimensions of the given rectangle.
Definition at line 180 of file gobchartsgrid.cpp.
void GobChartsGrid::setHorizontalGridLines | ( | bool | set, |
int | number | ||
) |
Set horizontal grid lines.
Turn horizontal grid lines "on" or "off" and also sets the number of grid lines.
Definition at line 194 of file gobchartsgrid.cpp.
void GobChartsGrid::setVerticalGridLines | ( | bool | set, |
int | number | ||
) |
Set horizontal grid lines.
Turn vertical grid lines "on" or "off" and also sets the number of grid lines.
Definition at line 202 of file gobchartsgrid.cpp.