Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
QCPGrid Class Reference

Responsible for drawing the grid of a QCPAxis. More...

#include <qcustomplot.h>

Inheritance diagram for QCPGrid:
Inheritance graph
[legend]

Public Member Functions

bool antialiasedSubGrid () const
 
bool antialiasedZeroLine () const
 
QPen pen () const
 
 QCPGrid (QCPAxis *parentAxis)
 
void setAntialiasedSubGrid (bool enabled)
 
void setAntialiasedZeroLine (bool enabled)
 
void setPen (const QPen &pen)
 
void setSubGridPen (const QPen &pen)
 
void setSubGridVisible (bool visible)
 
void setZeroLinePen (const QPen &pen)
 
QPen subGridPen () const
 
bool subGridVisible () const
 
QPen zeroLinePen () const
 
- Public Member Functions inherited from QCPLayerable
bool antialiased () const
 
QCPLayerlayer () const
 
QCPLayerableparentLayerable () const
 
QCustomPlotparentPlot () const
 
 QCPLayerable (QCustomPlot *plot, QString targetLayer=QString(), QCPLayerable *parentLayerable=0)
 
bool realVisibility () const
 
virtual double selectTest (const QPointF &pos, bool onlySelectable, QVariant *details=0) const
 
void setAntialiased (bool enabled)
 
Q_SLOT bool setLayer (QCPLayer *layer)
 
bool setLayer (const QString &layerName)
 
void setVisible (bool on)
 
bool visible () const
 
virtual ~QCPLayerable ()
 

Protected Member Functions

virtual void applyDefaultAntialiasingHint (QCPPainter *painter) const Q_DECL_OVERRIDE
 
virtual void draw (QCPPainter *painter) Q_DECL_OVERRIDE
 
void drawGridLines (QCPPainter *painter) const
 
void drawSubGridLines (QCPPainter *painter) const
 
- Protected Member Functions inherited from QCPLayerable
void applyAntialiasingHint (QCPPainter *painter, bool localAntialiased, QCP::AntialiasedElement overrideElement) const
 
virtual QRect clipRect () const
 
virtual void deselectEvent (bool *selectionStateChanged)
 
void initializeParentPlot (QCustomPlot *parentPlot)
 
virtual void mouseDoubleClickEvent (QMouseEvent *event, const QVariant &details)
 
virtual void mouseMoveEvent (QMouseEvent *event, const QPointF &startPos)
 
virtual void mousePressEvent (QMouseEvent *event, const QVariant &details)
 
virtual void mouseReleaseEvent (QMouseEvent *event, const QPointF &startPos)
 
bool moveToLayer (QCPLayer *layer, bool prepend)
 
virtual void parentPlotInitialized (QCustomPlot *parentPlot)
 
virtual void selectEvent (QMouseEvent *event, bool additive, const QVariant &details, bool *selectionStateChanged)
 
virtual QCP::Interaction selectionCategory () const
 
void setParentLayerable (QCPLayerable *parentLayerable)
 
virtual void wheelEvent (QWheelEvent *event)
 

Protected Attributes

bool mAntialiasedSubGrid
 
bool mAntialiasedZeroLine
 
QCPAxismParentAxis
 
QPen mPen
 
QPen mSubGridPen
 
bool mSubGridVisible
 
QPen mZeroLinePen
 
- Protected Attributes inherited from QCPLayerable
bool mAntialiased
 
QCPLayermLayer
 
QPointer< QCPLayerablemParentLayerable
 
QCustomPlotmParentPlot
 
bool mVisible
 

Friends

class QCPAxis
 

Additional Inherited Members

- Signals inherited from QCPLayerable
void layerChanged (QCPLayer *newLayer)
 

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 1868 of file qcustomplot.h.

Constructor & Destructor Documentation

◆ QCPGrid()

QCPGrid::QCPGrid ( QCPAxis parentAxis)
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 7168 of file qcustomplot.cpp.

Member Function Documentation

◆ antialiasedSubGrid()

bool QCPGrid::antialiasedSubGrid ( ) const
inline

Definition at line 1884 of file qcustomplot.h.

◆ antialiasedZeroLine()

bool QCPGrid::antialiasedZeroLine ( ) const
inline

Definition at line 1885 of file qcustomplot.h.

◆ applyDefaultAntialiasingHint()

void QCPGrid::applyDefaultAntialiasingHint ( QCPPainter painter) const
protectedvirtual

Implements QCPLayerable.

Definition at line 7249 of file qcustomplot.cpp.

◆ draw()

void QCPGrid::draw ( QCPPainter painter)
protectedvirtual

Implements QCPLayerable.

Definition at line 7259 of file qcustomplot.cpp.

◆ drawGridLines()

void QCPGrid::drawGridLines ( QCPPainter painter) const
protected

Definition at line 7274 of file qcustomplot.cpp.

◆ drawSubGridLines()

void QCPGrid::drawSubGridLines ( QCPPainter painter) const
protected

Definition at line 7347 of file qcustomplot.cpp.

◆ pen()

QPen QCPGrid::pen ( ) const
inline

Definition at line 1886 of file qcustomplot.h.

◆ setAntialiasedSubGrid()

void QCPGrid::setAntialiasedSubGrid ( bool  enabled)

Sets whether sub grid lines are drawn antialiased.

Definition at line 7196 of file qcustomplot.cpp.

◆ setAntialiasedZeroLine()

void QCPGrid::setAntialiasedZeroLine ( bool  enabled)

Sets whether zero lines are drawn antialiased.

Definition at line 7204 of file qcustomplot.cpp.

◆ setPen()

void QCPGrid::setPen ( const QPen &  pen)

Sets the pen with which (major) grid lines are drawn.

Definition at line 7212 of file qcustomplot.cpp.

◆ setSubGridPen()

void QCPGrid::setSubGridPen ( const QPen &  pen)

Sets the pen with which sub grid lines are drawn.

Definition at line 7220 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 7188 of file qcustomplot.cpp.

◆ setZeroLinePen()

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 7231 of file qcustomplot.cpp.

◆ subGridPen()

QPen QCPGrid::subGridPen ( ) const
inline

Definition at line 1887 of file qcustomplot.h.

◆ subGridVisible()

bool QCPGrid::subGridVisible ( ) const
inline

Definition at line 1883 of file qcustomplot.h.

◆ zeroLinePen()

QPen QCPGrid::zeroLinePen ( ) const
inline

Definition at line 1888 of file qcustomplot.h.

Friends And Related Function Documentation

◆ QCPAxis

friend class QCPAxis
friend

Definition at line 1915 of file qcustomplot.h.

Member Data Documentation

◆ mAntialiasedSubGrid

bool QCPGrid::mAntialiasedSubGrid
protected

Definition at line 1901 of file qcustomplot.h.

◆ mAntialiasedZeroLine

bool QCPGrid::mAntialiasedZeroLine
protected

Definition at line 1901 of file qcustomplot.h.

◆ mParentAxis

QCPAxis* QCPGrid::mParentAxis
protected

Definition at line 1905 of file qcustomplot.h.

◆ mPen

QPen QCPGrid::mPen
protected

Definition at line 1902 of file qcustomplot.h.

◆ mSubGridPen

QPen QCPGrid::mSubGridPen
protected

Definition at line 1902 of file qcustomplot.h.

◆ mSubGridVisible

bool QCPGrid::mSubGridVisible
protected

Definition at line 1900 of file qcustomplot.h.

◆ mZeroLinePen

QPen QCPGrid::mZeroLinePen
protected

Definition at line 1902 of file qcustomplot.h.


The documentation for this class was generated from the following files:


graph_rviz_plugin
Author(s): Édouard Pronier, Victor Lamoine - Institut Maupertuis
autogenerated on Mon Feb 28 2022 22:27:31