QCPPolarGraph
Public Types | |
enum | LineStyle { lsNone , lsLine } |
Public Types inherited from QObject | |
typedef | QObjectList |
Signals | |
void | selectableChanged (QCP::SelectionType selectable) |
void | selectionChanged (bool selected) |
void | selectionChanged (const QCPDataSelection &selection) |
Signals inherited from QCPLayerable | |
void | layerChanged (QCPLayer *newLayer) |
Public Member Functions | |
QCPPolarGraph (QCPPolarAxisAngular *keyAxis, QCPPolarAxisRadial *valueAxis) | |
void | addData (const QVector< double > &keys, const QVector< double > &values, bool alreadySorted=false) |
void | addData (double key, double value) |
bool | addToLegend () |
bool | addToLegend (QCPLegend *legend) |
bool | antialiasedFill () const |
bool | antialiasedScatters () const |
QBrush | brush () const |
const QPointF | coordsToPixels (double key, double value) const |
void | coordsToPixels (double key, double value, double &x, double &y) const |
QSharedPointer< QCPGraphDataContainer > | data () const |
virtual QCPRange | getKeyRange (bool &foundRange, QCP::SignDomain inSignDomain=QCP::sdBoth) const |
virtual QCPRange | getValueRange (bool &foundRange, QCP::SignDomain inSignDomain=QCP::sdBoth, const QCPRange &inKeyRange=QCPRange()) const |
virtual QCPPlottableInterface1D * | interface1D () |
QCPPolarAxisAngular * | keyAxis () const |
LineStyle | lineStyle () const |
QString | name () const |
QPen | pen () const |
bool | periodic () const |
void | pixelsToCoords (const QPointF &pixelPos, double &key, double &value) const |
void | pixelsToCoords (double x, double y, double &key, double &value) const |
bool | removeFromLegend () const |
bool | removeFromLegend (QCPLegend *legend) const |
void | rescaleAxes (bool onlyEnlarge=false) const |
void | rescaleKeyAxis (bool onlyEnlarge=false) const |
void | rescaleValueAxis (bool onlyEnlarge=false, bool inKeyRange=false) const |
QCPScatterStyle | scatterStyle () const |
QCP::SelectionType | selectable () const |
bool | selected () const |
QCPDataSelection | selection () const |
virtual double | selectTest (const QPointF &pos, bool onlySelectable, QVariant *details=0) const override |
void | setAntialiasedFill (bool enabled) |
void | setAntialiasedScatters (bool enabled) |
void | setBrush (const QBrush &brush) |
void | setData (const QVector< double > &keys, const QVector< double > &values, bool alreadySorted=false) |
void | setData (QSharedPointer< QCPGraphDataContainer > data) |
void | setKeyAxis (QCPPolarAxisAngular *axis) |
void | setLineStyle (LineStyle ls) |
void | setName (const QString &name) |
void | setPen (const QPen &pen) |
void | setPeriodic (bool enabled) |
void | setScatterStyle (const QCPScatterStyle &style) |
Q_SLOT void | setSelectable (QCP::SelectionType selectable) |
Q_SLOT void | setSelection (QCPDataSelection selection) |
void | setValueAxis (QCPPolarAxisRadial *axis) |
QCPPolarAxisRadial * | valueAxis () 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 |
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 | |
void | applyDefaultAntialiasingHint (QCPPainter *painter) const override |
void | applyFillAntialiasingHint (QCPPainter *painter) const |
void | applyScattersAntialiasingHint (QCPPainter *painter) const |
virtual QRect | clipRect () const override |
virtual int | dataCount () const |
QVector< QPointF > | dataToLines (const QVector< QCPGraphData > &data) const |
virtual void | deselectEvent (bool *selectionStateChanged) override |
virtual void | draw (QCPPainter *painter) override |
virtual void | drawFill (QCPPainter *painter, QVector< QPointF > *lines) const |
virtual void | drawLegendIcon (QCPPainter *painter, const QRectF &rect) const |
virtual void | drawLinePlot (QCPPainter *painter, const QVector< QPointF > &lines) const |
void | drawPolyline (QCPPainter *painter, const QVector< QPointF > &lineData) const |
virtual void | drawScatterPlot (QCPPainter *painter, const QVector< QPointF > &scatters, const QCPScatterStyle &style) const |
void | getDataSegments (QList< QCPDataRange > &selectedSegments, QList< QCPDataRange > &unselectedSegments) const |
void | getLines (QVector< QPointF > *lines, const QCPDataRange &dataRange) const |
void | getOptimizedLineData (QVector< QCPGraphData > *lineData, const QCPGraphDataContainer::const_iterator &begin, const QCPGraphDataContainer::const_iterator &end) const |
void | getOptimizedScatterData (QVector< QCPGraphData > *scatterData, QCPGraphDataContainer::const_iterator begin, QCPGraphDataContainer::const_iterator end) const |
void | getScatters (QVector< QPointF > *scatters, const QCPDataRange &dataRange) const |
void | getVisibleDataBounds (QCPGraphDataContainer::const_iterator &begin, QCPGraphDataContainer::const_iterator &end, const QCPDataRange &rangeRestriction) const |
double | pointDistance (const QPointF &pixelPoint, QCPGraphDataContainer::const_iterator &closestData) const |
virtual void | selectEvent (QMouseEvent *event, bool additive, const QVariant &details, bool *selectionStateChanged) override |
virtual QCP::Interaction | selectionCategory () const override |
Protected Member Functions inherited from QCPLayerable | |
void | applyAntialiasingHint (QCPPainter *painter, bool localAntialiased, QCP::AntialiasedElement overrideElement) const |
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) |
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 | mAntialiasedFill |
bool | mAntialiasedScatters |
QBrush | mBrush |
QSharedPointer< QCPGraphDataContainer > | mDataContainer |
QPointer< QCPPolarAxisAngular > | mKeyAxis |
LineStyle | mLineStyle |
QString | mName |
QPen | mPen |
bool | mPeriodic |
QCPScatterStyle | mScatterStyle |
QCP::SelectionType | mSelectable |
QCPDataSelection | mSelection |
QPointer< QCPPolarAxisRadial > | mValueAxis |
Protected Attributes inherited from QCPLayerable | |
bool | mAntialiased |
QCPLayer * | mLayer |
QPointer< QCPLayerable > | mParentLayerable |
QCustomPlot * | mParentPlot |
bool | mVisible |
Additional Inherited Members | |
Properties inherited from QObject | |
objectName | |
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
A radial graph used to display data in polar plots.
- Warning
- In this QCustomPlot version, polar plots are a tech preview. Expect documentation and functionality to be incomplete, as well as changing public interfaces in the future.
Definition at line 7636 of file qcustomplot.h.
Member Enumeration Documentation
◆ LineStyle
Defines how the graph's line is represented visually in the plot. The line is drawn with the current pen of the graph (setPen).
- See also
- setLineStyle
Enumerator | |
---|---|
lsNone | data points are not connected with any lines (e.g. data only represented with symbols according to the scatter style, see setScatterStyle) |
lsLine | data points are connected by a straight line |
Definition at line 7648 of file qcustomplot.h.
Constructor & Destructor Documentation
◆ QCPPolarGraph()
QCPPolarGraph::QCPPolarGraph | ( | QCPPolarAxisAngular * | keyAxis, |
QCPPolarAxisRadial * | valueAxis ) |
Constructs a graph which uses keyAxis as its angular and valueAxis as its radial axis. keyAxis and valueAxis must reside in the same QCustomPlot, and the radial axis must be associated with the angular axis. If either of these restrictions is violated, a corresponding message is printed to the debug output (qDebug), the construction is not aborted, though.
The created QCPPolarGraph is automatically registered with the QCustomPlot instance inferred from keyAxis. This QCustomPlot instance takes ownership of the QCPPolarGraph, so do not delete it manually but use QCPPolarAxisAngular::removeGraph() instead.
To directly create a QCPPolarGraph inside a plot, you shoud use the QCPPolarAxisAngular::addGraph method.
Definition at line 34458 of file qcustomplot.cpp.
◆ ~QCPPolarGraph()
|
virtual |
Definition at line 34484 of file qcustomplot.cpp.
Member Function Documentation
◆ addData() [1/2]
void QCPPolarGraph::addData | ( | const QVector< double > & | keys, |
const QVector< double > & | values, | ||
bool | alreadySorted = false ) |
Definition at line 34704 of file qcustomplot.cpp.
◆ addData() [2/2]
void QCPPolarGraph::addData | ( | double | key, |
double | value ) |
Definition at line 34723 of file qcustomplot.cpp.
◆ addToLegend() [1/2]
bool QCPPolarGraph::addToLegend | ( | ) |
Definition at line 34884 of file qcustomplot.cpp.
◆ addToLegend() [2/2]
bool QCPPolarGraph::addToLegend | ( | QCPLegend * | legend | ) |
Definition at line 34863 of file qcustomplot.cpp.
◆ antialiasedFill()
|
inline |
Definition at line 7659 of file qcustomplot.h.
◆ antialiasedScatters()
|
inline |
Definition at line 7660 of file qcustomplot.h.
◆ applyDefaultAntialiasingHint()
|
overrideprotectedvirtual |
This function applies the default antialiasing setting to the specified painter, using the function applyAntialiasingHint. It is the antialiasing state the painter is put in, when draw is called on the layerable. If the layerable has multiple entities whose antialiasing setting may be specified individually, this function should set the antialiasing state of the most prominent entity. In this case however, the draw function usually calls the specialized versions of this function before drawing each entity, effectively overriding the setting of the default antialiasing hint.
First example: QCPGraph has multiple entities that have an antialiasing setting: The graph line, fills and scatters. Those can be configured via QCPGraph::setAntialiased, QCPGraph::setAntialiasedFill and QCPGraph::setAntialiasedScatters. Consequently, there isn't only the QCPGraph::applyDefaultAntialiasingHint function (which corresponds to the graph line's antialiasing), but specialized ones like QCPGraph::applyFillAntialiasingHint and QCPGraph::applyScattersAntialiasingHint. So before drawing one of those entities, QCPGraph::draw calls the respective specialized applyAntialiasingHint function.
Second example: QCPItemLine consists only of a line so there is only one antialiasing setting which can be controlled with QCPItemLine::setAntialiased. (This function is inherited by all layerables. The specialized functions, as seen on QCPGraph, must be added explicitly to the respective layerable subclass.) Consequently it only has the normal QCPItemLine::applyDefaultAntialiasingHint. The QCPItemLine::draw function doesn't need to care about setting any antialiasing states, because the default antialiasing hint is already set on the painter when the draw function is called, and that's the state it wants to draw the line with.
Implements QCPLayerable.
Definition at line 35043 of file qcustomplot.cpp.
◆ applyFillAntialiasingHint()
|
protected |
Definition at line 35179 of file qcustomplot.cpp.
◆ applyScattersAntialiasingHint()
|
protected |
Definition at line 35184 of file qcustomplot.cpp.
◆ brush()
|
inline |
Definition at line 7662 of file qcustomplot.h.
◆ clipRect()
|
overrideprotectedvirtual |
Returns the clipping rectangle of this layerable object. By default, this is the viewport of the parent QCustomPlot. Specific subclasses may reimplement this function to provide different clipping rects.
The returned clipping rect is set on the painter before the draw function of the respective object is called.
Reimplemented from QCPLayerable.
Definition at line 34962 of file qcustomplot.cpp.
◆ coordsToPixels() [1/2]
const QPointF QCPPolarGraph::coordsToPixels | ( | double | key, |
double | value ) const |
Definition at line 34769 of file qcustomplot.cpp.
◆ coordsToPixels() [2/2]
void QCPPolarGraph::coordsToPixels | ( | double | key, |
double | value, | ||
double & | x, | ||
double & | y ) const |
Use this method to set an own QCPSelectionDecorator (subclass) instance. This allows you to customize the visual representation of selected data ranges further than by using the default QCPSelectionDecorator.
The plottable takes ownership of the decorator.
The currently set decorator can be accessed via selectionDecorator.
Definition at line 34756 of file qcustomplot.cpp.
◆ data()
|
inline |
Definition at line 7670 of file qcustomplot.h.
◆ dataCount()
|
protectedvirtual |
Definition at line 35236 of file qcustomplot.cpp.
◆ dataToLines()
|
protected |
Takes raw data points in plot coordinates as data, and returns a vector containing pixel coordinate points which are suitable for drawing the line style lsLine.
The source of data is usually getOptimizedLineData, and this method is called in getLines if the line style is set accordingly.
- See also
- dataToStepLeftLines, dataToStepRightLines, dataToStepCenterLines, dataToImpulseLines, getLines, drawLinePlot
Definition at line 35516 of file qcustomplot.cpp.
◆ deselectEvent()
|
overrideprotectedvirtual |
This event is called when the layerable shall be deselected, either as consequence of a user interaction or a call to QCustomPlot::deselectAll. Subclasses should react to it by unsetting their selection appropriately.
just as in selectEvent, the output parameter selectionStateChanged (if non-null), must return true or false when the selection state of this layerable has changed or not changed, respectively.
- See also
- selectTest, selectEvent
Reimplemented from QCPLayerable.
Definition at line 35080 of file qcustomplot.cpp.
◆ draw()
|
overrideprotectedvirtual |
This function draws the layerable with the specified painter. It is only called by QCustomPlot, if the layerable is visible (setVisible).
Before this function is called, the painter's antialiasing state is set via applyDefaultAntialiasingHint, see the documentation there. Further, the clipping rectangle was set to clipRect.
Implements QCPLayerable.
Definition at line 34970 of file qcustomplot.cpp.
◆ drawFill()
|
protectedvirtual |
Draws the fill of the graph using the specified painter, with the currently set brush.
Depending on whether a normal fill or a channel fill (setChannelFillGraph) is needed, getFillPolygon or getChannelFillPolygon are used to find the according fill polygons.
In order to handle NaN Data points correctly (the fill needs to be split into disjoint areas), this method first determines a list of non-NaN segments with getNonNanSegments, on which to operate. In the channel fill case, getOverlappingSegments is used to consolidate the non-NaN segments of the two involved graphs, before passing the overlapping pairs to getChannelFillPolygon.
Pass the points of this graph's line as lines, in pixel coordinates.
- See also
- drawLinePlot, drawImpulsePlot, drawScatterPlot
Definition at line 35123 of file qcustomplot.cpp.
◆ drawLegendIcon()
|
protectedvirtual |
Definition at line 35145 of file qcustomplot.cpp.
◆ drawLinePlot()
|
protectedvirtual |
Draws lines between the points in lines, given in pixel coordinates.
- See also
- drawScatterPlot, drawImpulsePlot, QCPAbstractPlottable1D::drawPolyline
Definition at line 35097 of file qcustomplot.cpp.
◆ drawPolyline()
|
protected |
Definition at line 35260 of file qcustomplot.cpp.
◆ drawScatterPlot()
|
protectedvirtual |
Draws scatter symbols at every point passed in scatters, given in pixel coordinates. The scatters will be drawn with painter and have the appearance as specified in style.
- See also
- drawLinePlot, drawImpulsePlot
Definition at line 35137 of file qcustomplot.cpp.
◆ getDataSegments()
|
protected |
Definition at line 35241 of file qcustomplot.cpp.
◆ getKeyRange()
|
virtual |
Definition at line 34950 of file qcustomplot.cpp.
◆ getLines()
|
protected |
This method retrieves an optimized set of data points via getOptimizedLineData, an branches out to the line style specific functions such as dataToLines, dataToStepLeftLines, etc. according to the line style of the graph.
lines will be filled with points in pixel coordinates, that can be drawn with the according draw functions like drawLinePlot and drawImpulsePlot. The points returned in lines aren't necessarily the original data points. For example, step line styles require additional points to form the steps when drawn. If the line style of the graph is lsNone, the lines vector will be empty.
dataRange specifies the beginning and ending data indices that will be taken into account for conversion. In this function, the specified range may exceed the total data bounds without harm: a correspondingly trimmed data range will be used. This takes the burden off the user of this function to check for valid indices in dataRange, e.g. when extending ranges coming from getDataSegments.
- See also
- getScatters
Definition at line 35351 of file qcustomplot.cpp.
◆ getOptimizedLineData()
|
protected |
Definition at line 35399 of file qcustomplot.cpp.
◆ getOptimizedScatterData()
|
protected |
Definition at line 35488 of file qcustomplot.cpp.
◆ getScatters()
|
protected |
Definition at line 35373 of file qcustomplot.cpp.
◆ getValueRange()
|
virtual |
Definition at line 34956 of file qcustomplot.cpp.
◆ getVisibleDataBounds()
|
protected |
Definition at line 35305 of file qcustomplot.cpp.
◆ interface1D()
|
inlinevirtual |
Definition at line 7708 of file qcustomplot.h.
◆ keyAxis()
|
inline |
Definition at line 7664 of file qcustomplot.h.
◆ lineStyle()
|
inline |
Definition at line 7671 of file qcustomplot.h.
◆ name()
|
inline |
Definition at line 7658 of file qcustomplot.h.
◆ pen()
|
inline |
Definition at line 7661 of file qcustomplot.h.
◆ periodic()
|
inline |
Definition at line 7663 of file qcustomplot.h.
◆ pixelsToCoords() [1/2]
void QCPPolarGraph::pixelsToCoords | ( | const QPointF & | pixelPos, |
double & | key, | ||
double & | value ) const |
Definition at line 34792 of file qcustomplot.cpp.
◆ pixelsToCoords() [2/2]
void QCPPolarGraph::pixelsToCoords | ( | double | x, |
double | y, | ||
double & | key, | ||
double & | value ) const |
Definition at line 34781 of file qcustomplot.cpp.
◆ pointDistance()
|
protected |
Definition at line 35189 of file qcustomplot.cpp.
◆ removeFromLegend() [1/2]
bool QCPPolarGraph::removeFromLegend | ( | ) | const |
Definition at line 34920 of file qcustomplot.cpp.
◆ removeFromLegend() [2/2]
bool QCPPolarGraph::removeFromLegend | ( | QCPLegend * | legend | ) | const |
Definition at line 34892 of file qcustomplot.cpp.
◆ rescaleAxes()
void QCPPolarGraph::rescaleAxes | ( | bool | onlyEnlarge = false | ) | const |
Definition at line 34803 of file qcustomplot.cpp.
◆ rescaleKeyAxis()
void QCPPolarGraph::rescaleKeyAxis | ( | bool | onlyEnlarge = false | ) | const |
Definition at line 34809 of file qcustomplot.cpp.
◆ rescaleValueAxis()
void QCPPolarGraph::rescaleValueAxis | ( | bool | onlyEnlarge = false, |
bool | inKeyRange = false ) const |
Definition at line 34830 of file qcustomplot.cpp.
◆ scatterStyle()
|
inline |
Definition at line 7672 of file qcustomplot.h.
◆ selectable()
|
inline |
Definition at line 7666 of file qcustomplot.h.
◆ selected()
|
inline |
Definition at line 7667 of file qcustomplot.h.
◆ selectEvent()
|
overrideprotectedvirtual |
This event is called when the layerable shall be selected, as a consequence of a click by the user. Subclasses should react to it by setting their selection state appropriately. The default implementation does nothing.
event is the mouse event that caused the selection. additive indicates, whether the user was holding the multi-select-modifier while performing the selection (see QCustomPlot::setMultiSelectModifier). if additive is true, the selection state must be toggled (i.e. become selected when unselected and unselected when selected).
Every selectEvent is preceded by a call to selectTest, which has returned positively (i.e. returned a value greater than 0 and less than the selection tolerance of the parent QCustomPlot). The details data you output from selectTest is fed back via details here. You may use it to transport any kind of information from the selectTest to the possibly subsequent selectEvent. Usually details is used to transfer which part was clicked, if it is a layerable that has multiple individually selectable parts (like QCPAxis). This way selectEvent doesn't need to do the calculation again to find out which part was actually clicked.
selectionStateChanged is an output parameter. If the pointer is non-null, this function must set the value either to true or false, depending on whether the selection state of this layerable was actually changed. For layerables that only are selectable as a whole and not in parts, this is simple: if additive is true, selectionStateChanged must also be set to true, because the selection toggles. If additive is false, selectionStateChanged is only set to true, if the layerable was previously unselected and now is switched to the selected state.
- See also
- selectTest, deselectEvent
Reimplemented from QCPLayerable.
Definition at line 35049 of file qcustomplot.cpp.
◆ selection()
|
inline |
Definition at line 7668 of file qcustomplot.h.
◆ selectionCategory()
|
overrideprotectedvirtual |
Returns the selection category this layerable shall belong to. The selection category is used in conjunction with QCustomPlot::setInteractions to control which objects are selectable and which aren't.
Subclasses that don't fit any of the normal QCP::Interaction values can use QCP::iSelectOther. This is what the default implementation returns.
- See also
- QCustomPlot::setInteractions
Reimplemented from QCPLayerable.
Definition at line 35038 of file qcustomplot.cpp.
◆ selectTest()
|
overridevirtual |
This function is used to decide whether a click hits a layerable object or not.
pos is a point in pixel coordinates on the QCustomPlot surface. This function returns the shortest pixel distance of this point to the object. If the object is either invisible or the distance couldn't be determined, -1.0 is returned. Further, if onlySelectable is true and the object is not selectable, -1.0 is returned, too.
If the object is represented not by single lines but by an area like a QCPItemText or the bars of a QCPBars plottable, a click inside the area should also be considered a hit. In these cases this function thus returns a constant value greater zero but still below the parent plot's selection tolerance. (typically the selectionTolerance multiplied by 0.99).
Providing a constant value for area objects allows selecting line objects even when they are obscured by such area objects, by clicking close to the lines (i.e. closer than 0.99*selectionTolerance).
The actual setting of the selection state is not done by this function. This is handled by the parent QCustomPlot when the mouseReleaseEvent occurs, and the finally selected object is notified via the selectEvent/ deselectEvent methods.
details is an optional output parameter. Every layerable subclass may place any information in details. This information will be passed to selectEvent when the parent QCustomPlot decides on the basis of this selectTest call, that the object was successfully selected. The subsequent call to selectEvent will carry the details. This is useful for multi-part objects (like QCPAxis). This way, a possibly complex calculation to decide which part was clicked is only done once in selectTest. The result (i.e. the actually clicked part) can then be placed in details. So in the subsequent selectEvent, the decision which part was selected doesn't have to be done a second time for a single selection operation.
In the case of 1D Plottables (QCPAbstractPlottable1D, like QCPGraph or QCPBars) details will be set to a QCPDataSelection, describing the closest data point to pos.
You may pass nullptr
as details to indicate that you are not interested in those selection details.
- See also
- selectEvent, deselectEvent, mousePressEvent, wheelEvent, QCustomPlot::setInteractions, QCPAbstractPlottable1D::selectTestRect
Reimplemented from QCPLayerable.
Definition at line 34928 of file qcustomplot.cpp.
◆ setAntialiasedFill()
void QCPPolarGraph::setAntialiasedFill | ( | bool | enabled | ) |
Sets whether fills of this plottable are drawn antialiased or not.
Note that this setting may be overridden by QCustomPlot::setAntialiasedElements and QCustomPlot::setNotAntialiasedElements.
Definition at line 34510 of file qcustomplot.cpp.
◆ setAntialiasedScatters()
void QCPPolarGraph::setAntialiasedScatters | ( | bool | enabled | ) |
Sets whether the scatter symbols of this plottable are drawn antialiased or not.
Note that this setting may be overridden by QCustomPlot::setAntialiasedElements and QCustomPlot::setNotAntialiasedElements.
Definition at line 34521 of file qcustomplot.cpp.
◆ setBrush()
void QCPPolarGraph::setBrush | ( | const QBrush & | brush | ) |
The brush is used to draw basic fills of the plottable representation in the plot. The Fill can be a color, gradient or texture, see the usage of QBrush.
For example, the QCPGraph subclass draws the fill under the graph with this brush, when it's not set to Qt::NoBrush.
- See also
- setPen
Definition at line 34548 of file qcustomplot.cpp.
◆ setData() [1/2]
void QCPPolarGraph::setData | ( | const QVector< double > & | keys, |
const QVector< double > & | values, | ||
bool | alreadySorted = false ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Replaces the current data with the provided points in keys and values. The provided vectors should have equal length. Else, the number of added points will be the size of the smallest vector.
If you can guarantee that the passed data points are sorted by keys in ascending order, you can set alreadySorted to true, to improve performance by saving a sorting run.
- See also
- addData
Definition at line 34676 of file qcustomplot.cpp.
◆ setData() [2/2]
void QCPPolarGraph::setData | ( | QSharedPointer< QCPGraphDataContainer > | data | ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Replaces the current data container with the provided data container.
Since a QSharedPointer is used, multiple QCPPolarGraphs may share the same data container safely. Modifying the data in the container will then affect all graphs that share the container. Sharing can be achieved by simply exchanging the data containers wrapped in shared pointers:
If you do not wish to share containers, but create a copy from an existing container, rather use the QCPDataContainer<DataType>::set method on the graph's data container directly:
- See also
- addData
Definition at line 34660 of file qcustomplot.cpp.
◆ setKeyAxis()
void QCPPolarGraph::setKeyAxis | ( | QCPPolarAxisAngular * | axis | ) |
The key axis of a plottable can be set to any axis of a QCustomPlot, as long as it is orthogonal to the plottable's value axis. This function performs no checks to make sure this is the case. The typical mathematical choice is to use the x-axis (QCustomPlot::xAxis) as key axis and the y-axis (QCustomPlot::yAxis) as value axis.
Normally, the key and value axes are set in the constructor of the plottable (or QCustomPlot::addGraph when working with QCPGraphs through the dedicated graph interface).
- See also
- setValueAxis
Definition at line 34569 of file qcustomplot.cpp.
◆ setLineStyle()
void QCPPolarGraph::setLineStyle | ( | LineStyle | ls | ) |
Sets how the single data points are connected in the plot. For scatter-only plots, set ls to lsNone and setScatterStyle to the desired scatter style.
- See also
- setScatterStyle
Definition at line 34688 of file qcustomplot.cpp.
◆ setName()
void QCPPolarGraph::setName | ( | const QString & | name | ) |
The name is the textual representation of this plottable as it is displayed in the legend (QCPLegend). It may contain any UTF-8 characters, including newlines.
Definition at line 34499 of file qcustomplot.cpp.
◆ setPen()
void QCPPolarGraph::setPen | ( | const QPen & | pen | ) |
The pen is used to draw basic lines that make up the plottable representation in the plot.
For example, the QCPGraph subclass draws its graph lines with this pen.
- See also
- setBrush
Definition at line 34534 of file qcustomplot.cpp.
◆ setPeriodic()
void QCPPolarGraph::setPeriodic | ( | bool | enabled | ) |
Definition at line 34553 of file qcustomplot.cpp.
◆ setScatterStyle()
void QCPPolarGraph::setScatterStyle | ( | const QCPScatterStyle & | style | ) |
Sets the visual appearance of single data points in the plot. If set to QCPScatterStyle::ssNone, no scatter points are drawn (e.g. for line-only-plots with appropriate line style).
- See also
- QCPScatterStyle, setLineStyle
Definition at line 34699 of file qcustomplot.cpp.
◆ setSelectable()
void QCPPolarGraph::setSelectable | ( | QCP::SelectionType | selectable | ) |
Sets whether and to which granularity this plottable can be selected.
A selection can happen by clicking on the QCustomPlot surface (When QCustomPlot::setInteractions contains QCP::iSelectPlottables), by dragging a selection rect (When QCustomPlot::setSelectionRectMode is QCP::srmSelect), or programmatically by calling setSelection.
- See also
- setSelection, QCP::SelectionType
Definition at line 34600 of file qcustomplot.cpp.
◆ setSelection()
void QCPPolarGraph::setSelection | ( | QCPDataSelection | selection | ) |
Sets which data ranges of this plottable are selected. Selected data ranges are drawn differently (e.g. color) in the plot. This can be controlled via the selection decorator (see selectionDecorator).
The entire selection mechanism for plottables is handled automatically when QCustomPlot::setInteractions contains iSelectPlottables. You only need to call this function when you wish to change the selection state programmatically.
Using setSelectable you can further specify for each plottable whether and to which granularity it is selectable. If selection is not compatible with the current QCP::SelectionType set via setSelectable, the resulting selection will be adjusted accordingly (see QCPDataSelection::enforceType).
emits the selectionChanged signal when selected is different from the previous selection state.
- See also
- setSelectable, selectTest
Definition at line 34634 of file qcustomplot.cpp.
◆ setValueAxis()
void QCPPolarGraph::setValueAxis | ( | QCPPolarAxisRadial * | axis | ) |
The value axis of a plottable can be set to any axis of a QCustomPlot, as long as it is orthogonal to the plottable's key axis. This function performs no checks to make sure this is the case. The typical mathematical choice is to use the x-axis (QCustomPlot::xAxis) as key axis and the y-axis (QCustomPlot::yAxis) as value axis.
Normally, the key and value axes are set in the constructor of the plottable (or QCustomPlot::addGraph when working with QCPGraphs through the dedicated graph interface).
- See also
- setKeyAxis
Definition at line 34585 of file qcustomplot.cpp.
◆ valueAxis()
|
inline |
Definition at line 7665 of file qcustomplot.h.
Member Data Documentation
◆ mAntialiasedFill
|
protected |
Definition at line 7723 of file qcustomplot.h.
◆ mAntialiasedScatters
|
protected |
Definition at line 7723 of file qcustomplot.h.
◆ mBrush
|
protected |
Definition at line 7725 of file qcustomplot.h.
◆ mDataContainer
|
protected |
Definition at line 7719 of file qcustomplot.h.
◆ mKeyAxis
|
protected |
Definition at line 7727 of file qcustomplot.h.
◆ mLineStyle
|
protected |
Definition at line 7720 of file qcustomplot.h.
◆ mName
|
protected |
Definition at line 7722 of file qcustomplot.h.
◆ mPen
|
protected |
Definition at line 7724 of file qcustomplot.h.
◆ mPeriodic
|
protected |
Definition at line 7726 of file qcustomplot.h.
◆ mScatterStyle
|
protected |
Definition at line 7721 of file qcustomplot.h.
◆ mSelectable
|
protected |
Definition at line 7729 of file qcustomplot.h.
◆ mSelection
|
protected |
Definition at line 7730 of file qcustomplot.h.
◆ mValueAxis
|
protected |
Definition at line 7728 of file qcustomplot.h.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Dec 27 2024 11:51:47 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.