![]() |
.Simulation
|
Responsible for drawing the grid of a QCPAxis. More...
Public Member Functions | |
QCPGrid (QCPAxis *parentAxis) | |
Creates a QCPGrid instance and sets default values. More... | |
bool | subGridVisible () const |
bool | antialiasedSubGrid () const |
bool | antialiasedZeroLine () const |
QPen | pen () const |
QPen | subGridPen () const |
QPen | zeroLinePen () const |
void | setSubGridVisible (bool visible) |
Sets whether grid lines at sub tick marks are drawn. More... | |
void | setAntialiasedSubGrid (bool enabled) |
Sets whether sub grid lines are drawn antialiased. | |
void | setAntialiasedZeroLine (bool enabled) |
Sets whether zero lines are drawn antialiased. | |
void | setPen (const QPen &pen) |
Sets the pen with which (major) grid lines are drawn. | |
void | setSubGridPen (const QPen &pen) |
Sets the pen with which sub grid lines are drawn. | |
void | setZeroLinePen (const QPen &pen) |
Sets the pen with which zero lines are drawn. More... | |
![]() | |
QCPLayerable (QCustomPlot *parentPlot) | |
Creates a new QCPLayerable instance. More... | |
bool | visible () const |
QCustomPlot * | parentPlot () const |
QCPLayer * | layer () const |
bool | antialiased () const |
void | setVisible (bool on) |
Sets the visibility of this layerable object. More... | |
bool | setLayer (QCPLayer *layer) |
Sets the layer of this layerable object. More... | |
bool | setLayer (const QString &layerName) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Sets the layer of this layerable object by name. More... | |
void | setAntialiased (bool enabled) |
Sets whether this object will be drawn antialiased or not. More... | |
Protected Member Functions | |
virtual void | applyDefaultAntialiasingHint (QCPPainter *painter) const |
virtual void | draw (QCPPainter *painter) |
void | drawGridLines (QCPPainter *painter) const |
void | drawSubGridLines (QCPPainter *painter) const |
![]() | |
bool | moveToLayer (QCPLayer *layer, bool prepend) |
void | applyAntialiasingHint (QCPPainter *painter, bool localAntialiased, QCP::AntialiasedElement overrideElement) const |
virtual QRect | clipRect () const |
Protected Attributes | |
QCPAxis * | mParentAxis |
bool | mSubGridVisible |
bool | mAntialiasedSubGrid |
bool | mAntialiasedZeroLine |
QPen | mPen |
QPen | mSubGridPen |
QPen | mZeroLinePen |
![]() | |
bool | mVisible |
QCustomPlot * | mParentPlot |
QCPLayer * | mLayer |
bool | mAntialiased |
Friends | |
class | QCPAxis |
Responsible for drawing the grid of a QCPAxis.
This class is tightly bound to QCPAxis. Every axis owns a grid instance internally and uses it to draw the grid. Normally, you don't need to interact with the QCPGrid instance, because QCPAxis reproduces the grid interface in its own interface.
The axis and grid drawing was split into two classes to allow them to be placed on different layers (both QCPAxis and QCPGrid inherit from QCPLayerable). So it is possible to have the grid at the background and the axes in the foreground, and any plottables/items in between. This described situation is the default setup, see QCPLayer documentation.
QCPlot::QCPGrid::QCPGrid | ( | QCPAxis * | parentAxis | ) |
void QCPlot::QCPGrid::setSubGridVisible | ( | bool | visible | ) |
Sets whether grid lines at sub tick marks are drawn.
void QCPlot::QCPGrid::setZeroLinePen | ( | const QPen & | pen | ) |
Sets the pen with which zero lines are drawn.
Zero lines are lines at coordinate 0 which may be drawn with a different pen than other grid lines. To disable zero lines and just draw normal grid lines at zero, set pen to Qt::NoPen.