QCPPolarGraph

Search for usage in LXR

Inheritance diagram for QCPPolarGraph:

Public Types

enum  LineStyle { lsNone, lsLine }
 

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< QCPGraphDataContainerdata () 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 QCPPlottableInterface1Dinterface1D ()
 
QCPPolarAxisAngularkeyAxis () 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)
 
QCPPolarAxisRadialvalueAxis () const
 
- Public Member Functions inherited from QCPLayerable
 QCPLayerable (QCustomPlot *plot, QString targetLayer=QString(), QCPLayerable *parentLayerable=nullptr)
 
bool antialiased () const
 
QCPLayerlayer () const
 
QCPLayerableparentLayerable () const
 
QCustomPlotparentPlot () 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)
 
bool blockSignals (bool block)
 
const QObjectListchildren () 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 ()
 
void dumpObjectInfo () const const
 
void dumpObjectTree ()
 
void dumpObjectTree () const const
 
QList< QByteArraydynamicPropertyNames () const const
 
virtual bool event (QEvent *e)
 
virtual bool eventFilter (QObject *watched, QEvent *event)
 
findChild (const QString &name, Qt::FindChildOptions options) const const
 
QList< T > findChildren (const QRegExp &regExp, 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
 
bool inherits (const char *className) const const
 
void installEventFilter (QObject *filterObj)
 
bool isWidgetType () const const
 
bool isWindowType () const const
 
void killTimer (int id)
 
virtual const QMetaObjectmetaObject () const const
 
void moveToThread (QThread *targetThread)
 
QString objectName () const const
 
void objectNameChanged (const QString &objectName)
 
QObjectparent () const const
 
QVariant property (const char *name) const const
 
 Q_CLASSINFO (Name, Value)
 
 Q_DISABLE_COPY (Class)
 
 Q_DISABLE_COPY_MOVE (Class)
 
 Q_DISABLE_MOVE (Class)
 
 Q_EMIT Q_EMIT
 
 Q_ENUM (...)
 
 Q_ENUM_NS (...)
 
 Q_ENUMS (...)
 
 Q_FLAG (...)
 
 Q_FLAG_NS (...)
 
 Q_FLAGS (...)
 
 Q_GADGET Q_GADGET
 
 Q_INTERFACES (...)
 
 Q_INVOKABLE Q_INVOKABLE
 
 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
 
qFindChild (const QObject *obj, const QString &name)
 
QList< T > qFindChildren (const QObject *obj, const QRegExp &regExp)
 
QList< T > qFindChildren (const QObject *obj, const QString &name)
 
qobject_cast (const QObject *object)
 
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 setParent (QObject *parent)
 
bool setProperty (const char *name, const QVariant &value)
 
bool signalsBlocked () const const
 
int startTimer (int interval, Qt::TimerType timerType)
 
int startTimer (std::chrono::milliseconds time, Qt::TimerType timerType)
 
QThreadthread () const const
 

Protected Member Functions

virtual 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< QPointFdataToLines (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
 
QObjectsender () const const
 
int senderSignalIndex () const const
 
virtual void timerEvent (QTimerEvent *event)
 

Protected Attributes

bool mAntialiasedFill
 
bool mAntialiasedScatters
 
QBrush mBrush
 
QSharedPointer< QCPGraphDataContainermDataContainer
 
QPointer< QCPPolarAxisAngularmKeyAxis
 
LineStyle mLineStyle
 
QString mName
 
QPen mPen
 
bool mPeriodic
 
QCPScatterStyle mScatterStyle
 
QCP::SelectionType mSelectable
 
QCPDataSelection mSelection
 
QPointer< QCPPolarAxisRadialmValueAxis
 
- Protected Attributes inherited from QCPLayerable
bool mAntialiased
 
QCPLayermLayer
 
QPointer< QCPLayerablemParentLayerable
 
QCustomPlotmParentPlot
 
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)
 
QString trUtf8 (const char *sourceText, const char *disambiguation, int n)
 
- Public Attributes inherited from QObject
typedef QObjectList
 

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 7582 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 7594 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 34438 of file qcustomplot.cpp.

Member Function Documentation

◆ applyDefaultAntialiasingHint()

void QCPPolarGraph::applyDefaultAntialiasingHint ( QCPPainter painter) const
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 35023 of file qcustomplot.cpp.

◆ clipRect()

QRect QCPPolarGraph::clipRect ( ) const
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 34942 of file qcustomplot.cpp.

◆ coordsToPixels()

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

◆ dataToLines()

QVector< QPointF > QCPPolarGraph::dataToLines ( const QVector< QCPGraphData > &  data) const
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 35496 of file qcustomplot.cpp.

◆ deselectEvent()

void QCPPolarGraph::deselectEvent ( bool *  selectionStateChanged)
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 35060 of file qcustomplot.cpp.

◆ draw()

void QCPPolarGraph::draw ( QCPPainter painter)
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 34950 of file qcustomplot.cpp.

◆ drawFill()

void QCPPolarGraph::drawFill ( QCPPainter painter,
QVector< QPointF > *  lines 
) const
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 35103 of file qcustomplot.cpp.

◆ drawLinePlot()

void QCPPolarGraph::drawLinePlot ( QCPPainter painter,
const QVector< QPointF > &  lines 
) const
protectedvirtual

Draws lines between the points in lines, given in pixel coordinates.

See also
drawScatterPlot, drawImpulsePlot, QCPAbstractPlottable1D::drawPolyline

Definition at line 35077 of file qcustomplot.cpp.

◆ drawScatterPlot()

void QCPPolarGraph::drawScatterPlot ( QCPPainter painter,
const QVector< QPointF > &  scatters,
const QCPScatterStyle style 
) const
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 35117 of file qcustomplot.cpp.

◆ getLines()

void QCPPolarGraph::getLines ( QVector< QPointF > *  lines,
const QCPDataRange dataRange 
) const
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 35331 of file qcustomplot.cpp.

◆ selectEvent()

void QCPPolarGraph::selectEvent ( QMouseEvent event,
bool  additive,
const QVariant details,
bool *  selectionStateChanged 
)
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 35029 of file qcustomplot.cpp.

◆ selectionCategory()

QCP::Interaction QCPPolarGraph::selectionCategory ( ) const
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 35018 of file qcustomplot.cpp.

◆ selectTest()

double QCPPolarGraph::selectTest ( const QPointF pos,
bool  onlySelectable,
QVariant details = 0 
) const
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 34908 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 34490 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 34501 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 34528 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 34656 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 34640 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 34549 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 34668 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 34479 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 34514 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 34679 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 34580 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 34614 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 34565 of file qcustomplot.cpp.


The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Thu Aug 18 2022 03:56:48 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.