QCPGrid
Protected Attributes | |
bool | mAntialiasedSubGrid |
bool | mAntialiasedZeroLine |
QCPAxis * | mParentAxis |
QPen | mPen |
QPen | mSubGridPen |
bool | mSubGridVisible |
QPen | mZeroLinePen |
Protected Attributes inherited from QCPLayerable | |
bool | mAntialiased |
QCPLayer * | mLayer |
QPointer< QCPLayerable > | mParentLayerable |
QCustomPlot * | mParentPlot |
bool | mVisible |
Detailed Description
Responsible for drawing the grid of a QCPAxis.
This class is tightly bound to QCPAxis. Every axis owns a grid instance and uses it to draw the grid lines, sub grid lines and zero-line. You can interact with the grid of an axis via QCPAxis::grid. Normally, you don't need to create an instance of QCPGrid yourself.
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). Thus it is possible to have the grid in the background and the axes in the foreground, and any plottables/items in between. This described situation is the default setup, see the QCPLayer documentation.
Definition at line 2012 of file qcustomplot.h.
Constructor & Destructor Documentation
◆ QCPGrid()
|
explicit |
Creates a QCPGrid instance and sets default values.
You shouldn't instantiate grids on their own, since every QCPAxis brings its own QCPGrid.
Definition at line 7843 of file qcustomplot.cpp.
Member Function Documentation
◆ antialiasedSubGrid()
|
inline |
Definition at line 2028 of file qcustomplot.h.
◆ antialiasedZeroLine()
|
inline |
Definition at line 2029 of file qcustomplot.h.
◆ applyDefaultAntialiasingHint()
|
overrideprotectedvirtual |
A convenience function to easily set the QPainter::Antialiased hint on the provided painter before drawing the major grid lines.
This is the antialiasing state the painter passed to the draw method is in by default.
This function takes into account the local setting of the antialiasing flag as well as the overrides set with QCustomPlot::setAntialiasedElements and QCustomPlot::setNotAntialiasedElements.
- See also
- setAntialiased
Implements QCPLayerable.
Definition at line 7927 of file qcustomplot.cpp.
◆ draw()
|
overrideprotectedvirtual |
Draws grid lines and sub grid lines at the positions of (sub) ticks of the parent axis, spanning over the complete axis rect. Also draws the zero line, if appropriate (setZeroLinePen).
Implements QCPLayerable.
Definition at line 7937 of file qcustomplot.cpp.
◆ drawGridLines()
|
protected |
Draws the main grid lines and possibly a zero line with the specified painter.
This is a helper function called by draw.
Definition at line 7952 of file qcustomplot.cpp.
◆ drawSubGridLines()
|
protected |
Draws the sub grid lines with the specified painter.
This is a helper function called by draw.
Definition at line 8025 of file qcustomplot.cpp.
◆ pen()
|
inline |
Definition at line 2030 of file qcustomplot.h.
◆ setAntialiasedSubGrid()
void QCPGrid::setAntialiasedSubGrid | ( | bool | enabled | ) |
Sets whether sub grid lines are drawn antialiased.
Definition at line 7874 of file qcustomplot.cpp.
◆ setAntialiasedZeroLine()
void QCPGrid::setAntialiasedZeroLine | ( | bool | enabled | ) |
Sets whether zero lines are drawn antialiased.
Definition at line 7882 of file qcustomplot.cpp.
◆ setPen()
Sets the pen with which (major) grid lines are drawn.
Definition at line 7890 of file qcustomplot.cpp.
◆ setSubGridPen()
Sets the pen with which sub grid lines are drawn.
Definition at line 7898 of file qcustomplot.cpp.
◆ setSubGridVisible()
void QCPGrid::setSubGridVisible | ( | bool | visible | ) |
Sets whether grid lines at sub tick marks are drawn.
- See also
- setSubGridPen
Definition at line 7866 of file qcustomplot.cpp.
◆ setZeroLinePen()
Sets the pen with which zero lines are drawn.
Zero lines are lines at value 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.
Definition at line 7909 of file qcustomplot.cpp.
◆ subGridPen()
|
inline |
Definition at line 2031 of file qcustomplot.h.
◆ subGridVisible()
|
inline |
Definition at line 2027 of file qcustomplot.h.
◆ zeroLinePen()
|
inline |
Definition at line 2032 of file qcustomplot.h.
Member Data Documentation
◆ mAntialiasedSubGrid
|
protected |
Definition at line 2045 of file qcustomplot.h.
◆ mAntialiasedZeroLine
|
protected |
Definition at line 2045 of file qcustomplot.h.
◆ mParentAxis
|
protected |
Definition at line 2049 of file qcustomplot.h.
◆ mPen
|
protected |
Definition at line 2046 of file qcustomplot.h.
◆ mSubGridPen
|
protected |
Definition at line 2046 of file qcustomplot.h.
◆ mSubGridVisible
|
protected |
Definition at line 2044 of file qcustomplot.h.
◆ mZeroLinePen
|
protected |
Definition at line 2046 of file qcustomplot.h.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2024 The KDE developers.
Generated on Tue Mar 26 2024 11:19:05 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.