QCPGrid
Public Member Functions | |
QCPGrid (QCPAxis *parentAxis) | |
bool | antialiasedSubGrid () const |
bool | antialiasedZeroLine () const |
QPen | pen () const |
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 | |
QCPLayerable (QCustomPlot *plot, QString targetLayer=QString(), QCPLayerable *parentLayerable=nullptr) | |
bool | antialiased () const |
QCPLayer * | layer () const |
QCPLayerable * | parentLayerable () const |
QCustomPlot * | parentPlot () const |
bool | realVisibility () const |
virtual double | selectTest (const QPointF &pos, bool onlySelectable, QVariant *details=nullptr) const |
void | setAntialiased (bool enabled) |
bool | setLayer (const QString &layerName) |
Q_SLOT bool | setLayer (QCPLayer *layer) |
void | setVisible (bool on) |
bool | visible () const |
Public Member Functions inherited from QObject | |
QObject (QObject *parent) | |
QBindable< QString > | bindableObjectName () |
bool | blockSignals (bool block) |
const QObjectList & | children () const const |
QMetaObject::Connection | connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const const |
void | deleteLater () |
void | destroyed (QObject *obj) |
bool | disconnect (const char *signal, const QObject *receiver, const char *method) const const |
bool | disconnect (const QObject *receiver, const char *method) const const |
void | dumpObjectInfo () const const |
void | dumpObjectTree () const const |
QList< QByteArray > | dynamicPropertyNames () const const |
virtual bool | event (QEvent *e) |
virtual bool | eventFilter (QObject *watched, QEvent *event) |
T | findChild (const QString &name, Qt::FindChildOptions options) const const |
QList< T > | findChildren (const QRegularExpression &re, Qt::FindChildOptions options) const const |
QList< T > | findChildren (const QString &name, Qt::FindChildOptions options) const const |
QList< T > | findChildren (Qt::FindChildOptions options) const const |
bool | inherits (const char *className) const const |
void | installEventFilter (QObject *filterObj) |
bool | isQuickItemType () const const |
bool | isWidgetType () const const |
bool | isWindowType () const const |
void | killTimer (int id) |
virtual const QMetaObject * | metaObject () const const |
void | moveToThread (QThread *targetThread) |
QString | objectName () const const |
void | objectNameChanged (const QString &objectName) |
QObject * | parent () const const |
QVariant | property (const char *name) const const |
Q_CLASSINFO (Name, Value) | |
Q_EMIT Q_EMIT | |
Q_ENUM (...) | |
Q_ENUM_NS (...) | |
Q_ENUMS (...) | |
Q_FLAG (...) | |
Q_FLAG_NS (...) | |
Q_FLAGS (...) | |
Q_GADGET Q_GADGET | |
Q_GADGET_EXPORT (EXPORT_MACRO) | |
Q_INTERFACES (...) | |
Q_INVOKABLE Q_INVOKABLE | |
Q_MOC_INCLUDE Q_MOC_INCLUDE | |
Q_NAMESPACE Q_NAMESPACE | |
Q_NAMESPACE_EXPORT (EXPORT_MACRO) | |
Q_OBJECT Q_OBJECT | |
Q_PROPERTY (...) | |
Q_REVISION Q_REVISION | |
Q_SET_OBJECT_NAME (Object) | |
Q_SIGNAL Q_SIGNAL | |
Q_SIGNALS Q_SIGNALS | |
Q_SLOT Q_SLOT | |
Q_SLOTS Q_SLOTS | |
T | qobject_cast (const QObject *object) |
T | qobject_cast (QObject *object) |
QT_NO_NARROWING_CONVERSIONS_IN_CONNECT QT_NO_NARROWING_CONVERSIONS_IN_CONNECT | |
void | removeEventFilter (QObject *obj) |
void | setObjectName (const QString &name) |
void | setObjectName (QAnyStringView name) |
void | setParent (QObject *parent) |
bool | setProperty (const char *name, const QVariant &value) |
bool | setProperty (const char *name, QVariant &&value) |
bool | signalsBlocked () const const |
int | startTimer (int interval, Qt::TimerType timerType) |
int | startTimer (std::chrono::milliseconds interval, Qt::TimerType timerType) |
QThread * | thread () const const |
Protected Member Functions | |
virtual void | applyDefaultAntialiasingHint (QCPPainter *painter) const override |
virtual void | draw (QCPPainter *painter) 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 Member Functions inherited from QObject | |
virtual void | childEvent (QChildEvent *event) |
virtual void | connectNotify (const QMetaMethod &signal) |
virtual void | customEvent (QEvent *event) |
virtual void | disconnectNotify (const QMetaMethod &signal) |
bool | isSignalConnected (const QMetaMethod &signal) const const |
int | receivers (const char *signal) const const |
QObject * | sender () const const |
int | senderSignalIndex () const const |
virtual void | timerEvent (QTimerEvent *event) |
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 |
Additional Inherited Members | |
Public Types inherited from QObject | |
typedef | QObjectList |
Properties inherited from QObject | |
objectName | |
Signals inherited from QCPLayerable | |
void | layerChanged (QCPLayer *newLayer) |
Static Public Member Functions inherited from QObject | |
QMetaObject::Connection | connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type) |
QMetaObject::Connection | connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type) |
QMetaObject::Connection | connect (const QObject *sender, PointerToMemberFunction signal, const QObject *context, Functor functor, Qt::ConnectionType type) |
QMetaObject::Connection | connect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method, Qt::ConnectionType type) |
QMetaObject::Connection | connect (const QObject *sender, PointerToMemberFunction signal, Functor functor) |
bool | disconnect (const QMetaObject::Connection &connection) |
bool | disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method) |
bool | disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method) |
bool | disconnect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method) |
QString | tr (const char *sourceText, const char *disambiguation, int n) |
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 2069 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 7861 of file qcustomplot.cpp.
Member Function Documentation
◆ antialiasedSubGrid()
|
inline |
Definition at line 2085 of file qcustomplot.h.
◆ antialiasedZeroLine()
|
inline |
Definition at line 2086 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 7945 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 7955 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 7970 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 8043 of file qcustomplot.cpp.
◆ pen()
|
inline |
Definition at line 2087 of file qcustomplot.h.
◆ setAntialiasedSubGrid()
void QCPGrid::setAntialiasedSubGrid | ( | bool | enabled | ) |
Sets whether sub grid lines are drawn antialiased.
Definition at line 7892 of file qcustomplot.cpp.
◆ setAntialiasedZeroLine()
void QCPGrid::setAntialiasedZeroLine | ( | bool | enabled | ) |
Sets whether zero lines are drawn antialiased.
Definition at line 7900 of file qcustomplot.cpp.
◆ setPen()
void QCPGrid::setPen | ( | const QPen & | pen | ) |
Sets the pen with which (major) grid lines are drawn.
Definition at line 7908 of file qcustomplot.cpp.
◆ setSubGridPen()
void QCPGrid::setSubGridPen | ( | const QPen & | pen | ) |
Sets the pen with which sub grid lines are drawn.
Definition at line 7916 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 7884 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 7927 of file qcustomplot.cpp.
◆ subGridPen()
|
inline |
Definition at line 2088 of file qcustomplot.h.
◆ subGridVisible()
|
inline |
Definition at line 2084 of file qcustomplot.h.
◆ zeroLinePen()
|
inline |
Definition at line 2089 of file qcustomplot.h.
Member Data Documentation
◆ mAntialiasedSubGrid
|
protected |
Definition at line 2102 of file qcustomplot.h.
◆ mAntialiasedZeroLine
|
protected |
Definition at line 2102 of file qcustomplot.h.
◆ mParentAxis
|
protected |
Definition at line 2106 of file qcustomplot.h.
◆ mPen
|
protected |
Definition at line 2103 of file qcustomplot.h.
◆ mSubGridPen
|
protected |
Definition at line 2103 of file qcustomplot.h.
◆ mSubGridVisible
|
protected |
Definition at line 2101 of file qcustomplot.h.
◆ mZeroLinePen
|
protected |
Definition at line 2103 of file qcustomplot.h.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 17:04:48 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.