iCub-main
|
Responsible for drawing the grid of a QCPAxis. More...
#include <qcustomplot.h>
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. More... | |
void | setAntialiasedZeroLine (bool enabled) |
Sets whether zero lines are drawn antialiased. More... | |
void | setPen (const QPen &pen) |
Sets the pen with which (major) grid lines are drawn. More... | |
void | setSubGridPen (const QPen &pen) |
Sets the pen with which sub grid lines are drawn. More... | |
void | setZeroLinePen (const QPen &pen) |
Sets the pen with which zero lines are drawn. More... | |
Public Member Functions inherited from QCPLayerable | |
QCPLayerable (QCustomPlot *plot, QString targetLayer="", QCPLayerable *parentLayerable=0) | |
Creates a new QCPLayerable instance. More... | |
~QCPLayerable () | |
bool | visible () const |
QCustomPlot * | parentPlot () const |
QCPLayerable * | parentLayerable () const |
Returns the parent layerable of this layerable. More... | |
QCPLayer * | layer () const |
bool | antialiased () const |
void | setVisible (bool on) |
Sets the visibility of this layerable object. More... | |
Q_SLOT 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... | |
virtual double | selectTest (const QPointF &pos, bool onlySelectable, QVariant *details=0) const |
This function is used to decide whether a click hits a layerable object or not. More... | |
bool | realVisibility () const |
Returns whether this layerable is visible, taking the visibility of the layerable parent and the visibility of the layer this layerable is on into account. 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 |
Protected Member Functions inherited from QCPLayerable | |
virtual void | parentPlotInitialized (QCustomPlot *parentPlot) |
virtual QCP::Interaction | selectionCategory () const |
virtual QRect | clipRect () const |
virtual void | selectEvent (QMouseEvent *event, bool additive, const QVariant &details, bool *selectionStateChanged) |
virtual void | deselectEvent (bool *selectionStateChanged) |
void | initializeParentPlot (QCustomPlot *parentPlot) |
void | setParentLayerable (QCPLayerable *parentLayerable) |
bool | moveToLayer (QCPLayer *layer, bool prepend) |
void | applyAntialiasingHint (QCPPainter *painter, bool localAntialiased, QCP::AntialiasedElement overrideElement) const |
Protected Attributes | |
bool | mSubGridVisible |
bool | mAntialiasedSubGrid |
bool | mAntialiasedZeroLine |
QPen | mPen |
QPen | mSubGridPen |
QPen | mZeroLinePen |
QCPAxis * | mParentAxis |
Protected Attributes inherited from QCPLayerable | |
bool | mVisible |
QCustomPlot * | mParentPlot |
QPointer< QCPLayerable > | mParentLayerable |
QCPLayer * | mLayer |
bool | mAntialiased |
Friends | |
class | QCPAxis |
Additional Inherited Members | |
Signals inherited from QCPLayerable | |
void | layerChanged (QCPLayer *newLayer) |
This signal is emitted when the layer of this layerable changes, i.e. More... | |
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 929 of file qcustomplot.h.
QCPGrid::QCPGrid | ( | QCPAxis * | parentAxis | ) |
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 3805 of file qcustomplot.cpp.
|
inline |
Definition at line 945 of file qcustomplot.h.
|
inline |
Definition at line 946 of file qcustomplot.h.
|
protectedvirtual |
Implements QCPLayerable.
Definition at line 3886 of file qcustomplot.cpp.
|
protectedvirtual |
Implements QCPLayerable.
Definition at line 3896 of file qcustomplot.cpp.
|
protected |
Definition at line 3911 of file qcustomplot.cpp.
|
protected |
Definition at line 3985 of file qcustomplot.cpp.
|
inline |
Definition at line 947 of file qcustomplot.h.
void QCPGrid::setAntialiasedSubGrid | ( | bool | enabled | ) |
Sets whether sub grid lines are drawn antialiased.
Definition at line 3833 of file qcustomplot.cpp.
void QCPGrid::setAntialiasedZeroLine | ( | bool | enabled | ) |
Sets whether zero lines are drawn antialiased.
Definition at line 3841 of file qcustomplot.cpp.
void QCPGrid::setPen | ( | const QPen & | pen | ) |
Sets the pen with which (major) grid lines are drawn.
Definition at line 3849 of file qcustomplot.cpp.
void QCPGrid::setSubGridPen | ( | const QPen & | pen | ) |
Sets the pen with which sub grid lines are drawn.
Definition at line 3857 of file qcustomplot.cpp.
void QCPGrid::setSubGridVisible | ( | bool | visible | ) |
Sets whether grid lines at sub tick marks are drawn.
Definition at line 3825 of file qcustomplot.cpp.
void QCPGrid::setZeroLinePen | ( | const QPen & | pen | ) |
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 3868 of file qcustomplot.cpp.
|
inline |
Definition at line 948 of file qcustomplot.h.
|
inline |
Definition at line 944 of file qcustomplot.h.
|
inline |
Definition at line 949 of file qcustomplot.h.
|
friend |
Definition at line 975 of file qcustomplot.h.
|
protected |
Definition at line 962 of file qcustomplot.h.
|
protected |
Definition at line 962 of file qcustomplot.h.
|
protected |
Definition at line 965 of file qcustomplot.h.
|
protected |
Definition at line 963 of file qcustomplot.h.
|
protected |
Definition at line 963 of file qcustomplot.h.
|
protected |
Definition at line 961 of file qcustomplot.h.
|
protected |
Definition at line 963 of file qcustomplot.h.