Kstars
qcustomplot.h
140class QCP { // when in moc-run, make it look like a class, so we get Q_GADGET, Q_ENUMS/Q_FLAGS features in namespace
162 \see QCustomPlot::savePng, QCustomPlot::saveJpg, QCustomPlot::saveBmp, QCustomPlot::saveRastered
167 };
174enum ExportPen { epNoCosmetic ///< Cosmetic pens are converted to pens with pixel width 1 when exporting
175 ,epAllowCosmetic ///< Cosmetic pens are exported normally (e.g. in PDF exports, cosmetic pens always appear as 1 pixel on screen, independent of viewer zoom level)
176 };
188 };
201 };
205 Defines what objects of a plot can be forcibly drawn antialiased/not antialiased. If an object is
206 neither forcibly drawn antialiased nor forcibly drawn not antialiased, it is up to the respective
220 ,aeScatters = 0x0080 ///< <tt>0x0080</tt> Scatter symbols of plottables (excluding scatter symbols of type ssPixmap)
223 ,aeOther = 0x8000 ///< <tt>0x8000</tt> Other elements that don't fit into any of the existing categories
226 };
235 ,phFastPolylines = 0x001 ///< <tt>0x001</tt> Graph/Curve lines are drawn with a faster method. This reduces the quality especially of the line segment
236 ///< joins, thus is most effective for pen sizes larger than 1. It is only used for solid line pens.
237 ,phImmediateRefresh = 0x002 ///< <tt>0x002</tt> causes an immediate repaint() instead of a soft update() when QCustomPlot::replot() is called with parameter \ref QCustomPlot::rpRefreshHint.
238 ///< This is set by default to prevent the plot from freezing on fast consecutive replots (e.g. user drags ranges with mouse).
239 ,phCacheLabels = 0x004 ///< <tt>0x004</tt> axis (tick) labels will be cached as pixmaps, increasing replot performance.
240 };
251 ,iRangeDrag = 0x001 ///< <tt>0x001</tt> Axis ranges are draggable (see \ref QCPAxisRect::setRangeDrag, \ref QCPAxisRect::setRangeDragAxes)
252 ,iRangeZoom = 0x002 ///< <tt>0x002</tt> Axis ranges are zoomable with the mouse wheel (see \ref QCPAxisRect::setRangeZoom, \ref QCPAxisRect::setRangeZoomAxes)
253 ,iMultiSelect = 0x004 ///< <tt>0x004</tt> The user can select multiple objects by holding the modifier set by \ref QCustomPlot::setMultiSelectModifier while clicking
254 ,iSelectPlottables = 0x008 ///< <tt>0x008</tt> Plottables are selectable (e.g. graphs, curves, bars,... see QCPAbstractPlottable)
255 ,iSelectAxes = 0x010 ///< <tt>0x010</tt> Axes are selectable (or parts of them, see QCPAxis::setSelectableParts)
256 ,iSelectLegend = 0x020 ///< <tt>0x020</tt> Legends are selectable (or their child items, see QCPLegend::setSelectableParts)
257 ,iSelectItems = 0x040 ///< <tt>0x040</tt> Items are selectable (Rectangles, Arrows, Textitems, etc. see \ref QCPAbstractItem)
258 ,iSelectOther = 0x080 ///< <tt>0x080</tt> All other objects are selectable (e.g. your own derived layerables, other layout elements,...)
259 ,iSelectPlottablesBeyondAxisRect = 0x100 ///< <tt>0x100</tt> When performing plottable selection/hit tests, this flag extends the sensitive area beyond the axis rect
260 };
268enum SelectionRectMode { srmNone ///< The selection rect is disabled, and all mouse events are forwarded to the underlying objects, e.g. for axis range dragging
269 ,srmZoom ///< When dragging the mouse, a selection rect becomes active. Upon releasing, the axes that are currently set as range zoom axes (\ref QCPAxisRect::setRangeZoomAxes) will have their ranges zoomed accordingly.
270 ,srmSelect ///< When dragging the mouse, a selection rect becomes active. Upon releasing, plottable data points that were within the selection rect are selected, if the plottable's selectability setting permits. (See \ref dataselection "data selection mechanism" for details.)
271 ,srmCustom ///< When dragging the mouse, a selection rect becomes active. It is the programmer's responsibility to connect according slots to the selection rect's signals (e.g. \ref QCPSelectionRect::accepted) in order to process the user interaction.
272 };
293 ,stWhole ///< Selection behaves like \ref stMultipleDataRanges, but if there are any data points selected, the entire plottable is drawn as selected.
297 };
360extern const QMetaObject staticMetaObject; // in moc-run we create a static meta object for QCP "fake" object. This line is the link to it via QCP::staticMetaObject in normal operation as namespace
435inline const QCPVector2D operator*(double factor, const QCPVector2D &vec) { return QCPVector2D(vec.mX*factor, vec.mY*factor); }
436inline const QCPVector2D operator*(const QCPVector2D &vec, double factor) { return QCPVector2D(vec.mX*factor, vec.mY*factor); }
437inline const QCPVector2D operator/(const QCPVector2D &vec, double divisor) { return QCPVector2D(vec.mX/divisor, vec.mY/divisor); }
438inline const QCPVector2D operator+(const QCPVector2D &vec1, const QCPVector2D &vec2) { return QCPVector2D(vec1.mX+vec2.mX, vec1.mY+vec2.mY); }
439inline const QCPVector2D operator-(const QCPVector2D &vec1, const QCPVector2D &vec2) { return QCPVector2D(vec1.mX-vec2.mX, vec1.mY-vec2.mY); }
440inline const QCPVector2D operator-(const QCPVector2D &vec) { return QCPVector2D(-vec.mX, -vec.mY); }
463 Defines special modes the painter can operate in. They disable or enable certain subsets of features/fixes/workarounds,
466 enum PainterMode { pmDefault = 0x00 ///< <tt>0x00</tt> Default mode for painting on screen devices
467 ,pmVectorized = 0x01 ///< <tt>0x01</tt> Mode for vectorized painting (e.g. PDF export). For example, this prevents some antialiasing fixes.
468 ,pmNoCaching = 0x02 ///< <tt>0x02</tt> Mode for all sorts of exports (e.g. PNG, PDF,...). For example, this prevents using cached pixmap labels
469 ,pmNonCosmetic = 0x04 ///< <tt>0x04</tt> Turns pen widths 0 to 1, i.e. disables cosmetic pens. (A cosmetic pen is always drawn with width 1 pixel in the vector image/pdf viewer, independent of zoom.)
470 };
599 explicit QCPPaintBufferGlFbo(const QSize &size, double devicePixelRatio, QWeakPointer<QOpenGLContext> glContext, QWeakPointer<QOpenGLPaintDevice> glPaintDevice);
705 QCPLayerable(QCustomPlot *plot, QString targetLayer=QString(), QCPLayerable *parentLayerable=nullptr);
722 virtual double selectTest(const QPointF &pos, bool onlySelectable, QVariant *details=nullptr) const;
745 virtual void selectEvent(QMouseEvent *event, bool additive, const QVariant &details, bool *selectionStateChanged);
758 void applyAntialiasingHint(QCPPainter *painter, bool localAntialiased, QCP::AntialiasedElement overrideElement) const;
782 bool operator==(const QCPRange& other) const { return lower == other.lower && upper == other.upper; }
898 bool operator==(const QCPDataRange& other) const { return mBegin == other.mBegin && mEnd == other.mEnd; }
917 QCPDataRange adjusted(int changeBegin, int changeEnd) const { return QCPDataRange(mBegin+changeBegin, mEnd+changeEnd); }
941 friend inline const QCPDataSelection operator+(const QCPDataSelection& a, const QCPDataSelection& b);
942 friend inline const QCPDataSelection operator+(const QCPDataRange& a, const QCPDataSelection& b);
943 friend inline const QCPDataSelection operator+(const QCPDataSelection& a, const QCPDataRange& b);
945 friend inline const QCPDataSelection operator-(const QCPDataSelection& a, const QCPDataSelection& b);
946 friend inline const QCPDataSelection operator-(const QCPDataRange& a, const QCPDataSelection& b);
947 friend inline const QCPDataSelection operator-(const QCPDataSelection& a, const QCPDataRange& b);
972 inline static bool lessThanDataRangeBegin(const QCPDataRange &a, const QCPDataRange &b) { return a.begin() < b.begin(); }
978 Return a \ref QCPDataSelection with the data points in \a a joined with the data points in \a b.
989 Return a \ref QCPDataSelection with the data points in \a a joined with the data points in \a b.
1000 Return a \ref QCPDataSelection with the data points in \a a joined with the data points in \a b.
1011 Return a \ref QCPDataSelection with the data points in \a a joined with the data points in \a b.
1158 QList<QCPLayoutElement*> elements(QCP::MarginSide side) const { return mChildren.value(side); }
1192 Q_PROPERTY(SizeConstraintRect sizeConstraintRect READ sizeConstraintRect WRITE setSizeConstraintRect)
1199 enum UpdatePhase { upPreparation ///< Phase used for any type of preparation that needs to be done before margin calculation and layout
1202 };
1208 margins (e.g. in the case of a QCPAxisRect the axis labels), whereas the inner rect (\ref rect)
1213 enum SizeConstraintRect { scrInnerRect ///< Minimum/Maximum size constraints apply to inner rect
1214 , scrOuterRect ///< Minimum/Maximum size constraints apply to outer rect, thus include layout element margins
1215 };
1231 QCPMarginGroup *marginGroup(QCP::MarginSide side) const { return mMarginGroups.value(side, nullptr); }
1253 virtual double selectTest(const QPointF &pos, bool onlySelectable, QVariant *details=nullptr) const Q_DECL_OVERRIDE;
1270 virtual void applyDefaultAntialiasingHint(QCPPainter *painter) const Q_DECL_OVERRIDE { Q_UNUSED(painter) }
1314 QVector<int> getSectionSizes(QVector<int> maxSizes, QVector<int> minSizes, QVector<double> stretchFactors, int totalSize) const;
1330 Q_PROPERTY(QList<double> columnStretchFactors READ columnStretchFactors WRITE setColumnStretchFactors)
1346 enum FillOrder { foRowsFirst ///< Rows are filled first, and a new element is wrapped to the next column if the row count would exceed \ref setWrap.
1347 ,foColumnsFirst ///< Columns are filled first, and a new element is wrapped to the next row if the column count would exceed \ref setWrap.
1348 };
1422 enum InsetPlacement { ipFree ///< The element may be positioned/sized arbitrarily, see \ref setInsetRect
1423 ,ipBorderAligned ///< The element is aligned to one of the layout sides, see \ref setInsetAlignment
1424 };
1481 and \ref setLength. Some decorations like \ref esDisc, \ref esSquare, \ref esDiamond and \ref esBar only
1484 \see QCPItemLine::setHead, QCPItemLine::setTail, QCPItemCurve::setHead, QCPItemCurve::setTail, QCPAxis::setLowerEnding, QCPAxis::setUpperEnding
1621 QTransform transform; // the transform about the label anchor which is at (0, 0). Does not contain final absolute x/y positioning on the plot/axis
1638 double mRotation; // this is the rotation applied uniformly to all labels, not the heterogeneous rotation in amCircularRotated mode
1644 QByteArray mLabelParameterHash; // to determine whether mLabelCache needs to be cleared due to changed parameters
1650 virtual void drawLabelMaybeCached(QCPPainter *painter, const QFont &font, const QColor &color, const QPointF &pos, AnchorSide side, double rotation, const QString &text);
1651 virtual QByteArray generateLabelParameterHash() const; // TODO: get rid of this in favor of invalidation flag upon setters?
1656 LabelData getTickLabelData(const QFont &font, const QColor &color, double rotation, AnchorSide side, const QString &text) const;
1658 //void getMaxTickLabelSize(const QFont &font, const QString &text, QSize *tickLabelsSize) const;
1660 QByteArray cacheKey(const QString &text, const QColor &color, double rotation, AnchorSide side) const;
1661 AnchorSide skewedAnchorSide(const QPointF &tickPos, double sideExpandHorz, double sideExpandVert) const;
1680 Defines the strategies that the axis ticker may follow when choosing the size of the tick step.
1686 tssReadability ///< A nicely readable tick step is prioritized over matching the requested number of ticks (see \ref setTickCount)
1687 ,tssMeetTickCount ///< Less readable tick steps are allowed which in turn facilitates getting closer to the requested tick count
1688 };
1705 virtual void generate(const QCPRange &range, const QLocale &locale, QChar formatChar, int precision, QVector<double> &ticks, QVector<double> *subTicks, QVector<QString> *tickLabels);
1716 virtual QString getTickLabel(double tick, const QLocale &locale, QChar formatChar, int precision);
1719 virtual QVector<QString> createLabelVector(const QVector<double> &ticks, const QLocale &locale, QChar formatChar, int precision);
1758 void setTickOrigin(double origin); // hides base class method but calls baseclass implementation ("using" throws off IDEs and doxygen)
1779 virtual QString getTickLabel(double tick, const QLocale &locale, QChar formatChar, int precision) Q_DECL_OVERRIDE;
1780 virtual QVector<double> createTickVector(double tickStep, const QCPRange &range) Q_DECL_OVERRIDE;
1798 enum TimeUnit { tuMilliseconds ///< Milliseconds, one thousandth of a second (%%z in \ref setTimeFormat)
1803 };
1851 enum ScaleStrategy { ssNone ///< Modifications are not allowed, the specified tick step is absolutely fixed. This might cause a high tick density and overlapping labels if the axis range is zoomed out.
1852 ,ssMultiples ///< An integer multiple of the specified tick step is allowed. The used factor follows the base class properties of \ref setTickStepStrategy and \ref setTickCount.
1854 };
1911 virtual QString getTickLabel(double tick, const QLocale &locale, QChar formatChar, int precision) Q_DECL_OVERRIDE;
1912 virtual QVector<double> createTickVector(double tickStep, const QCPRange &range) Q_DECL_OVERRIDE;
1930 enum FractionStyle { fsFloatingPoint ///< Fractions are displayed as regular decimal floating point numbers, e.g. "0.25" or "0.125".
1931 ,fsAsciiFractions ///< Fractions are written as rationals using ASCII characters only, e.g. "1/4" or "1/8"
1932 ,fsUnicodeFractions ///< Fractions are written using sub- and superscript UTF-8 digits and the fraction symbol.
1933 };
2003 virtual QVector<double> createTickVector(double tickStep, const QCPRange &range) Q_DECL_OVERRIDE;
2098 Q_PROPERTY(SelectableParts selectedParts READ selectedParts WRITE setSelectedParts NOTIFY selectionChanged)
2099 Q_PROPERTY(SelectableParts selectableParts READ selectableParts WRITE setSelectableParts NOTIFY selectableChanged)
2100 Q_PROPERTY(QFont selectedTickLabelFont READ selectedTickLabelFont WRITE setSelectedTickLabelFont)
2102 Q_PROPERTY(QColor selectedTickLabelColor READ selectedTickLabelColor WRITE setSelectedTickLabelColor)
2116 enum AxisType { atLeft = 0x01 ///< <tt>0x01</tt> Axis is vertical and on the left side of the axis rect
2120 };
2129 enum LabelSide { lsInside ///< Tick labels will be displayed inside the axis rect and clipped to the inner axis rect
2131 };
2138 ,stLogarithmic ///< Logarithmic scaling with correspondingly transformed axis coordinates (possibly also \ref setTicker to a \ref QCPAxisTickerLog instance).
2139 };
2149 };
2249 virtual double selectTest(const QPointF &pos, bool onlySelectable, QVariant *details=nullptr) const Q_DECL_OVERRIDE;
2253 int pixelOrientation() const { return rangeReversed() != (orientation()==Qt::Vertical) ? -1 : 1; }
2267 static Qt::Orientation orientation(AxisType type) { return type==atBottom || type==atTop ? Qt::Horizontal : Qt::Vertical; }
2335 virtual void selectEvent(QMouseEvent *event, bool additive, const QVariant &details, bool *selectionStateChanged) Q_DECL_OVERRIDE;
2395 int tickLengthIn, tickLengthOut, subTickLengthIn, subTickLengthOut; // directly accessed by QCPAxis setters/getters
2421 QByteArray mLabelParameterHash; // to determine whether mLabelCache needs to be cleared due to changed parameters
2427 virtual void placeTickLabel(QCPPainter *painter, double position, int distanceToAxis, const QString &text, QSize *tickLabelsSize);
2428 virtual void drawTickLabel(QCPPainter *painter, double x, double y, const TickLabelData &labelData) const;
2458 };
2470 enum ScatterShape { ssNone ///< no scatter symbols are drawn (e.g. in QCPGraph, data only represented with lines)
2471 ,ssDot ///< \enumimage{ssDot.png} a single pixel (use \ref ssDisc or \ref ssCircle if you want a round shape with a certain radius)
2475 ,ssDisc ///< \enumimage{ssDisc.png} a circle which is filled with the pen's color (not the brush as with ssCircle)
2478 ,ssStar ///< \enumimage{ssStar.png} a star with eight arms, i.e. a combination of cross and plus
2480 ,ssTriangleInverted ///< \enumimage{ssTriangleInverted.png} an equilateral triangle, standing on corner
2485 ,ssPeace ///< \enumimage{ssPeace.png} a circle, with one vertical and two downward diagonal lines
2486 ,ssPixmap ///< a custom pixmap specified by \ref setPixmap, centered on the data point coordinates
2487 ,ssCustom ///< custom painter operations are performed per scatter (As QPainterPath, see \ref setCustomPath)
2488 };
2497 QCPScatterStyle(const QPainterPath &customPath, const QPen &pen, const QBrush &brush=Qt::NoBrush, double size=6);
2553inline bool qcpLessThanSortKey(const DataType &a, const DataType &b) { return a.sortKey() < b.sortKey(); }
2556class QCPDataContainer // no QCP_LIB_DECL, template class ends up in header (cpp included below)
2594 QCPRange valueRange(bool &foundRange, QCP::SignDomain signDomain=QCP::sdBoth, const QCPRange &inKeyRange=QCPRange());
2596 void limitIteratorsToDataRange(const_iterator &begin, const_iterator &end, const QCPDataRange &dataRange) const;
2615////////////////////////////////////////////////////////////////////////////////////////////////////
2617////////////////////////////////////////////////////////////////////////////////////////////////////
2622 This class template provides a fast container for data storage of one-dimensional data. The data
2626 The data is stored in a sorted fashion, which allows very quick lookups by the sorted key as well
2627 as retrieval of ranges (see \ref findBegin, \ref findEnd, \ref keyRange) using binary search. The
2631 using the fact that existing data is always sorted. The user can further improve performance by
2632 specifying that added data is already itself sorted by key, if he can guarantee that this is the
2635 The data can be accessed with the provided const iterators (\ref constBegin, \ref constEnd). If
2636 it is necessary to alter existing data in-place, the non-const iterators can be used (\ref begin,
2637 \ref end). Changing data members that are not the sort key (for most data types called \a key) is
2640 Great care must be taken however if the sort key is modified through the non-const iterators. For
2642 manipulation. It is thus the responsibility of the user to leave the container in a sorted state
2657 \li <tt>double sortKey() const</tt>\n Returns the member variable of this data point that is the
2663 \li <tt>static bool sortKeyIsMainKey()</tt>\n Returns true if the sort key is equal to the main
2664 key (see method \c mainKey below). For most plottables this is the case. It is not the case for
2665 example for \ref QCPCurve, which uses \a t as sort key and \a key as main key. This is the reason
2668 \li <tt>double mainKey() const</tt>\n Returns the variable of this data point considered the main
2669 key. This is commonly the variable that is used as the coordinate of this data point on the key
2677 \li <tt>QCPRange valueRange() const</tt>\n Returns the range this data point spans in the value
2679 both lower and upper set to the main data point value. However if the data points can represent
2681 values at each \a key) this method should return the range those values span. This method is used
2712 You can manipulate the data points in-place through the non-const iterators, but great care must
2721 You can manipulate the data points in-place through the non-const iterators, but great care must
2729 the available elements in this container, returns \ref constEnd, i.e. an iterator past the last
2822 if (oldSize > 0 && !qcpLessThanSortKey<DataType>(*constBegin(), *(data.constEnd()-1))) // prepend if new data keys are all smaller than or equal to existing ones
2859 if (alreadySorted && oldSize > 0 && !qcpLessThanSortKey<DataType>(*constBegin(), *(data.constEnd()-1))) // prepend if new data is sorted and keys are all smaller than or equal to existing ones
2885 if (isEmpty() || !qcpLessThanSortKey<DataType>(data, *(constEnd()-1))) // quickly handle appends if new data key is greater or equal to existing ones
2888 } else if (qcpLessThanSortKey<DataType>(data, *constBegin())) // quickly handle prepends using preallocated space
2896 QCPDataContainer<DataType>::iterator insertionPoint = std::lower_bound(begin(), end(), data, qcpLessThanSortKey<DataType>);
2910 QCPDataContainer<DataType>::iterator itEnd = std::lower_bound(begin(), end(), DataType::fromSortKey(sortKey), qcpLessThanSortKey<DataType>);
2924 QCPDataContainer<DataType>::iterator it = std::upper_bound(begin(), end(), DataType::fromSortKey(sortKey), qcpLessThanSortKey<DataType>);
2944 QCPDataContainer<DataType>::iterator it = std::lower_bound(begin(), end(), DataType::fromSortKey(sortKeyFrom), qcpLessThanSortKey<DataType>);
2945 QCPDataContainer<DataType>::iterator itEnd = std::upper_bound(it, end(), DataType::fromSortKey(sortKeyTo), qcpLessThanSortKey<DataType>);
2963 QCPDataContainer::iterator it = std::lower_bound(begin(), end(), DataType::fromSortKey(sortKey), qcpLessThanSortKey<DataType>);
2991 When setting, adding or removing points using the QCPDataContainer interface (\ref set, \ref add,
2994 points by accessing and modifying it through the non-const iterators (\ref begin, \ref end), it
2995 is your responsibility to bring the container back into a sorted state before any other methods
3012 The parameters \a preAllocation and \a postAllocation control whether pre- and/or post allocation
3037 This can be used in conjunction with \ref findEnd to iterate over data points within a given key
3038 range, including or excluding the bounding data points that are just beyond the specified range.
3048typename QCPDataContainer<DataType>::const_iterator QCPDataContainer<DataType>::findBegin(double sortKey, bool expandedRange) const
3053 QCPDataContainer<DataType>::const_iterator it = std::lower_bound(constBegin(), constEnd(), DataType::fromSortKey(sortKey), qcpLessThanSortKey<DataType>);
3060 Returns an iterator to the element after the data point with a (sort-)key that is equal to, just
3061 above or just below \a sortKey. If \a expandedRange is true, the data point just above \a sortKey
3065 key range, including the bounding data points that are just below and above the specified range.
3075typename QCPDataContainer<DataType>::const_iterator QCPDataContainer<DataType>::findEnd(double sortKey, bool expandedRange) const
3080 QCPDataContainer<DataType>::const_iterator it = std::upper_bound(constBegin(), constEnd(), DataType::fromSortKey(sortKey), qcpLessThanSortKey<DataType>);
3096 If the DataType reports that its main key is equal to the sort key (\a sortKeyIsMainKey), as is
3118 if (DataType::sortKeyIsMainKey()) // if DataType is sorted by main key (e.g. QCPGraph, but not QCPCurve), use faster algorithm by finding just first and last key with non-NaN value
3212 you should not use the returned QCPRange (e.g. the data container is empty or all points have the
3225QCPRange QCPDataContainer<DataType>::valueRange(bool &foundRange, QCP::SignDomain signDomain, const QCPRange &inKeyRange)
3248 if (restrictKeyRange && (it->mainKey() < inKeyRange.lower || it->mainKey() > inKeyRange.upper))
3266 if (restrictKeyRange && (it->mainKey() < inKeyRange.lower || it->mainKey() > inKeyRange.upper))
3269 if ((current.lower < range.lower || !haveLower) && current.lower < 0 && !qIsNaN(current.lower))
3274 if ((current.upper > range.upper || !haveUpper) && current.upper < 0 && !qIsNaN(current.upper))
3284 if (restrictKeyRange && (it->mainKey() < inKeyRange.lower || it->mainKey() > inKeyRange.upper))
3287 if ((current.lower < range.lower || !haveLower) && current.lower > 0 && !qIsNaN(current.lower))
3309 This function doesn't require for \a dataRange to be within the bounds of this data container's
3313void QCPDataContainer<DataType>::limitIteratorsToDataRange(const_iterator &begin, const_iterator &end, const QCPDataRange &dataRange) const
3323 Increases the preallocation pool to have a size of at least \a minimumPreallocSize. Depending on
3327 if \a minimumPreallocSize is smaller than or equal to the current preallocation pool size, this
3348 This method decides, depending on the total allocation size and the size of the unused pre- and
3352 If \ref setAutoSqueeze is enabled, this method is called automatically each time data points are
3368 if (totalAlloc > 650000) // if allocation is larger, shrink earlier with respect to total used size
3370 shrinkPostAllocation = postAllocSize > usedSize*1.5; // QVector grow strategy is 2^n for static data. Watch out not to oscillate!
3372 } else if (totalAlloc > 1000) // below 10 MiB raw data be generous with preallocated memory, below 1k points don't even bother
3400 QCPScatterStyle::ScatterProperties usedScatterProperties() const { return mUsedScatterProperties; }
3405 void setScatterStyle(const QCPScatterStyle &scatterStyle, QCPScatterStyle::ScatterProperties usedProperties=QCPScatterStyle::spPen);
3447 Q_PROPERTY(QCP::SelectionType selectable READ selectable WRITE setSelectable NOTIFY selectableChanged)
3448 Q_PROPERTY(QCPDataSelection selection READ selection WRITE setSelection NOTIFY selectionChanged)
3449 Q_PROPERTY(QCPSelectionDecorator* selectionDecorator READ selectionDecorator WRITE setSelectionDecorator)
3481 virtual double selectTest(const QPointF &pos, bool onlySelectable, QVariant *details=nullptr) const Q_DECL_OVERRIDE = 0; // actually introduced in QCPLayerable as non-pure, but we want to force reimplementation for plottables
3483 virtual QCPRange getKeyRange(bool &foundRange, QCP::SignDomain inSignDomain=QCP::sdBoth) const = 0;
3484 virtual QCPRange getValueRange(bool &foundRange, QCP::SignDomain inSignDomain=QCP::sdBoth, const QCPRange &inKeyRange=QCPRange()) const = 0;
3521 virtual void selectEvent(QMouseEvent *event, bool additive, const QVariant &details, bool *selectionStateChanged) Q_DECL_OVERRIDE;
3550 QCPItemAnchor(QCustomPlot *parentPlot, QCPAbstractItem *parentItem, const QString &name, int anchorId=-1);
3572 void removeChildX(QCPItemPosition *pos); // called from pos when its parent anchor is reset or pos deleted
3574 void removeChildY(QCPItemPosition *pos); // called from pos when its parent anchor is reset or pos deleted
3594 enum PositionType { ptAbsolute ///< Static positioning in pixels, starting from the top left corner of the viewport/widget.
3595 ,ptViewportRatio ///< Static positioning given by a fraction of the viewport size. For example, if you call setCoords(0, 0), the position will be at the top
3596 ///< left corner of the viewport/widget. setCoords(1, 1) will be at the bottom right corner, setCoords(0.5, 0) will be horizontally centered and
3598 ,ptAxisRectRatio ///< Static positioning given by a fraction of the axis rect size (see \ref setAxisRect). For example, if you call setCoords(0, 0), the position will be at the top
3599 ///< left corner of the axis rect. setCoords(1, 1) will be at the bottom right corner, setCoords(0.5, 0) will be horizontally centered and
3600 ///< vertically at the top of the axis rect, etc. You can also go beyond the axis rect by providing negative coordinates or coordinates larger than 1.
3601 ,ptPlotCoords ///< Dynamic positioning at a plot coordinate defined by two axes (see \ref setAxes).
3602 };
3680 virtual double selectTest(const QPointF &pos, bool onlySelectable, QVariant *details=nullptr) const Q_DECL_OVERRIDE = 0;
3707 virtual void selectEvent(QMouseEvent *event, bool additive, const QVariant &details, bool *selectionStateChanged) Q_DECL_OVERRIDE;
3738 Q_PROPERTY(Qt::AspectRatioMode backgroundScaledMode READ backgroundScaledMode WRITE setBackgroundScaledMode)
3740 Q_PROPERTY(bool autoAddPlottableToLegend READ autoAddPlottableToLegend WRITE setAutoAddPlottableToLegend)
3743 Q_PROPERTY(Qt::KeyboardModifier multiSelectModifier READ multiSelectModifier WRITE setMultiSelectModifier)
3754 };
3762 enum RefreshPriority { rpImmediateRefresh ///< Replots immediately and repaints the widget immediately by calling QWidget::repaint() after the replot
3763 ,rpQueuedRefresh ///< Replots immediately, but queues the widget repaint, by calling QWidget::update() after the replot. This way multiple redundant widget repaints can be avoided.
3764 ,rpRefreshHint ///< Whether to use immediate or queued refresh depends on whether the plotting hint \ref QCP::phImmediateRefresh is set, see \ref setPlottingHints.
3765 ,rpQueuedReplot ///< Queues the entire replot for the next event loop iteration. This way multiple redundant replots can be avoided. The actual replot is then done with \ref rpRefreshHint priority.
3766 };
3795 void setBackground(const QPixmap &pm, bool scaled, Qt::AspectRatioMode mode=Qt::KeepAspectRatioByExpanding);
3802 void setNotAntialiasedElement(QCP::AntialiasedElement notAntialiasedElement, bool enabled=true);
3825 PlottableType *plottableAt(const QPointF &pos, bool onlySelectable=false, int *dataIndex=nullptr) const;
3826 QCPAbstractPlottable *plottableAt(const QPointF &pos, bool onlySelectable=false, int *dataIndex=nullptr) const;
3859 bool addLayer(const QString &name, QCPLayer *otherLayer=nullptr, LayerInsertMode insertMode=limAbove);
3875 bool savePdf(const QString &fileName, int width=0, int height=0, QCP::ExportPen exportPen=QCP::epAllowCosmetic, const QString &pdfCreator=QString(), const QString &pdfTitle=QString());
3876 bool savePng(const QString &fileName, int width=0, int height=0, double scale=1.0, int quality=-1, int resolution=96, QCP::ResolutionUnit resolutionUnit=QCP::ruDotsPerInch);
3877 bool saveJpg(const QString &fileName, int width=0, int height=0, double scale=1.0, int quality=-1, int resolution=96, QCP::ResolutionUnit resolutionUnit=QCP::ruDotsPerInch);
3878 bool saveBmp(const QString &fileName, int width=0, int height=0, double scale=1.0, int resolution=96, QCP::ResolutionUnit resolutionUnit=QCP::ruDotsPerInch);
3879 bool saveRastered(const QString &fileName, int width, int height, double scale, const char *format, int quality=-1, int resolution=96, QCP::ResolutionUnit resolutionUnit=QCP::ruDotsPerInch);
3916 QList<QCPGraph*> mGraphs; // extra list of plottables also in mPlottables that are of type QCPGraph
3981 QCPLayerable *layerableAt(const QPointF &pos, bool onlySelectable, QVariant *selectionDetails=nullptr) const;
3982 QList<QCPLayerable*> layerableListAt(const QPointF &pos, bool onlySelectable, QList<QVariant> *selectionDetails=nullptr) const;
4008 Plottables that only consist of single lines (like graphs) have a tolerance band around them, see
4009 \ref setSelectionTolerance. If multiple plottables come into consideration, the one closest to \a
4015 if \a dataIndex is non-null, it is set to the index of the plottable's data point that is closest
4023PlottableType *QCustomPlot::plottableAt(const QPointF &pos, bool onlySelectable, int *dataIndex) const
4027 double resultDistance = mSelectionTolerance; // only regard clicks with distances smaller than mSelectionTolerance as selections, so initialize with that value
4032 if (!currentPlottable || (onlySelectable && !currentPlottable->selectable())) // we could have also passed onlySelectable to the selectTest function, but checking here is faster, because we have access to QCPAbstractPlottable::selectable
4034 if (currentPlottable->clipRect().contains(pos.toPoint())) // only consider clicks where the plottable is actually visible
4057 Returns the item at the pixel position \a pos. The item type (a QCPAbstractItem subclass) that shall be
4058 taken into consideration can be specified via the template parameter. Items that only consist of single
4060 setSelectionTolerance. If multiple items come into consideration, the one closest to \a pos is returned.
4062 If \a onlySelectable is true, only items that are selectable (QCPAbstractItem::setSelectable) are
4073 double resultDistance = mSelectionTolerance; // only regard clicks with distances smaller than mSelectionTolerance as selections, so initialize with that value
4078 if (!currentItem || (onlySelectable && !currentItem->selectable())) // we could have also passed onlySelectable to the selectTest function, but checking here is faster, because we have access to QCPAbstractItem::selectable
4080 if (!currentItem->clipToAxisRect() || currentItem->clipRect().contains(pos.toPoint())) // only consider clicks inside axis cliprect of the item if actually clipped to it
4120class QCPAbstractPlottable1D : public QCPAbstractPlottable, public QCPPlottableInterface1D // no QCP_LIB_DECL, template class ends up in header (cpp included below)
4136 virtual QCPDataSelection selectTestRect(const QRectF &rect, bool onlySelectable) const Q_DECL_OVERRIDE;
4141 virtual double selectTest(const QPointF &pos, bool onlySelectable, QVariant *details=nullptr) const Q_DECL_OVERRIDE;
4149 void getDataSegments(QList<QCPDataRange> &selectedSegments, QList<QCPDataRange> &unselectedSegments) const;
4160////////////////////////////////////////////////////////////////////////////////////////////////////
4162////////////////////////////////////////////////////////////////////////////////////////////////////
4170 For example, it is implemented by the template class \ref QCPAbstractPlottable1D (the preferred
4175 If your plottable doesn't derive from \ref QCPAbstractPlottable1D but still wants to provide a 1d
4182 interface by calling \ref QCPAbstractPlottable::interface1D and testing it for a non-zero return
4194/*! \fn virtual QCPDataSelection QCPPlottableInterface1D::selectTestRect(const QRectF &rect, bool onlySelectable) const = 0;
4196 Returns a data selection containing all the data points of this plottable which are contained (or
4197 hit by) \a rect. This is used mainly in the selection rect interaction for data selection (\ref
4203 \note \a rect must be a normalized rect (positive or zero width and height). This is especially
4205 normalized. Use <tt>QRect::normalized()</tt> when passing a rect which might not be normalized.
4213 qcpdatacontainer-datatype "QCPDataContainer DataType" documentation for details about this naming
4222 qcpdatacontainer-datatype "QCPDataContainer DataType" documentation for details about this naming
4231 qcpdatacontainer-datatype "QCPDataContainer DataType" documentation for details about this naming
4240 qcpdatacontainer-datatype "QCPDataContainer DataType" documentation for details about this naming
4257 Returns whether the sort key (\ref dataSortKey) is identical to the main key (\ref dataMainKey).
4260 qcpdatacontainer-datatype "QCPDataContainer DataType" documentation for details about this naming
4264/*! \fn virtual int QCPPlottableInterface1D::findBegin(double sortKey, bool expandedRange) const = 0
4266 Returns the index of the data point with a (sort-)key that is equal to, just below, or just above
4267 \a sortKey. If \a expandedRange is true, the data point just below \a sortKey will be considered,
4270 This can be used in conjunction with \ref findEnd to iterate over data points within a given key
4271 range, including or excluding the bounding data points that are just beyond the specified range.
4281/*! \fn virtual int QCPPlottableInterface1D::findEnd(double sortKey, bool expandedRange) const = 0
4284 just below \a sortKey. If \a expandedRange is true, the data point just above \a sortKey will be
4288 key range, including the bounding data points that are just below and above the specified range.
4290 If \a expandedRange is true but there are no data points above \a sortKey, the index just above the
4301////////////////////////////////////////////////////////////////////////////////////////////////////
4303////////////////////////////////////////////////////////////////////////////////////////////////////
4308 This template class derives from \ref QCPAbstractPlottable and from the abstract interface \ref
4309 QCPPlottableInterface1D. It serves as a base class for all one-dimensional data (i.e. data with
4313 QCPGraphData or \ref QCPCurveData). The main purpose of this base class is to provide the member
4314 \a mDataContainer (a shared pointer to a \ref QCPDataContainer "QCPDataContainer<DataType>") and
4319 \ref getDataSegments. This is useful when subclasses implement their \ref draw method and need to
4326 again, to provide a more accurate hit test based on their specific data visualization geometry.
4346QCPAbstractPlottable1D<DataType>::QCPAbstractPlottable1D(QCPAxis *keyAxis, QCPAxis *valueAxis) :
4438 const typename QCPDataContainer<DataType>::const_iterator it = mDataContainer->constBegin()+index;
4457 Implements a rect-selection algorithm assuming the data (accessed via the 1D data interface) is
4464QCPDataSelection QCPAbstractPlottable1D<DataType>::selectTestRect(const QRectF &rect, bool onlySelectable) const
4476 QCPRange keyRange(key1, key2); // QCPRange normalizes internally so we don't have to care about whether key1 < key2
4480 if (DataType::sortKeyIsMainKey()) // we can assume that data is sorted by main key, so can reduce the searched key interval:
4488 int currentSegmentBegin = -1; // -1 means we're currently not in a segment that's contained in rect
4495 } else if (!valueRange.contains(it->mainValue()) || !keyRange.contains(it->mainKey())) // segment just ended
4497 result.addDataRange(QCPDataRange(currentSegmentBegin, int(it-mDataContainer->constBegin())), false);
4503 result.addDataRange(QCPDataRange(currentSegmentBegin, int(end-mDataContainer->constBegin())), false);
4528 Implements a point-selection algorithm assuming the data (accessed via the 1D data interface) is
4532 If \a details is not 0, it will be set to a \ref QCPDataSelection, describing the closest data point
4538double QCPAbstractPlottable1D<DataType>::selectTest(const QPointF &pos, bool onlySelectable, QVariant *details) const
4551 if (DataType::sortKeyIsMainKey()) // we can assume that data is sorted by main key, so can reduce the searched key interval:
4553 // determine which key range comes into question, taking selection tolerance around pos into account:
4555 pixelsToCoords(pos-QPointF(mParentPlot->selectionTolerance(), mParentPlot->selectionTolerance()), posKeyMin, dummy);
4556 pixelsToCoords(pos+QPointF(mParentPlot->selectionTolerance(), mParentPlot->selectionTolerance()), posKeyMax, dummy);
4570 if (keyRange.contains(mainKey) && valueRange.contains(mainValue)) // make sure data point is inside visible range, for speedup in cases where sort key isn't main key and we iterate over all points
4572 const double currentDistSqr = QCPVector2D(coordsToPixels(mainKey, mainValue)-pos).lengthSquared();
4600void QCPAbstractPlottable1D<DataType>::getDataSegments(QList<QCPDataRange> &selectedSegments, QList<QCPDataRange> &unselectedSegments) const
4604 if (mSelectable == QCP::stWhole) // stWhole selection type draws the entire plottable with selected style if mSelection isn't empty
4620 A helper method which draws a line with the passed \a painter, according to the pixel data in \a
4621 lineData. NaN points create gaps in the line, as expected from QCustomPlot's plottables (this is
4625 Further it uses a faster line drawing technique based on \ref QCPPainter::drawLine rather than \c
4630void QCPAbstractPlottable1D<DataType>::drawPolyline(QCPPainter *painter, const QVector<QPointF> &lineData) const
4632 // if drawing lines in plot (instead of PDF), reduce 1px lines to cosmetic, because at least in
4633 // Qt6 drawing of "1px" width lines is much slower even though it has same appearance apart from
4653 while (i < lineDataSize && (qIsNaN(lineData.at(i).y()) || qIsNaN(lineData.at(i).x()))) // make sure first point is not NaN
4658 if (!qIsNaN(lineData.at(i).y()) && !qIsNaN(lineData.at(i).x())) // NaNs create a gap in the line
4675 if (qIsNaN(lineData.at(i).y()) || qIsNaN(lineData.at(i).x()) || qIsInf(lineData.at(i).y())) // NaNs create a gap in the line. Also filter Infs which make drawPolyline block
4677 painter->drawPolyline(lineData.constData()+segmentStart, i-segmentStart); // i, because we don't want to include the current NaN point
4703 enum ColorInterpolation { ciRGB ///< Color channels red, green and blue are linearly interpolated
4704 ,ciHSV ///< Color channels hue, saturation and value are linearly interpolated (The hue is interpolated over the shortest angle distance)
4705 };
4713 enum NanHandling { nhNone ///< NaN data points are not explicitly handled and shouldn't occur in the data (this gives slight performance improvement)
4714 ,nhLowestColor ///< NaN data points appear as the lowest color defined in this QCPColorGradient
4715 ,nhHighestColor ///< NaN data points appear as the highest color defined in this QCPColorGradient
4718 };
4725 enum GradientPreset { gpGrayscale ///< Continuous lightness from black to white (suited for non-biased data representation)
4726 ,gpHot ///< Continuous lightness from black over firey colors to white (suited for non-biased data representation)
4727 ,gpCold ///< Continuous lightness from black over icey colors to white (suited for non-biased data representation)
4728 ,gpNight ///< Continuous lightness from black over weak blueish colors to white (suited for non-biased data representation)
4731 ,gpIon ///< Half hue spectrum from black over purple to blue and finally green (creates banding illusion but allows more precise magnitude estimates)
4732 ,gpThermal ///< Colors suitable for thermal imaging, ranging from dark blue over purple to orange, yellow and white
4733 ,gpPolar ///< Colors suitable to emphasize polarity around the center, with blue for negative, black in the middle and red for positive values
4734 ,gpSpectrum ///< An approximation of the visible light spectrum (creates banding illusion but allows more precise magnitude estimates)
4735 ,gpJet ///< Hue variation similar to a spectrum, often used in numerical visualization (creates banding illusion but allows more precise magnitude estimates)
4736 ,gpHues ///< Full hue cycle, with highest and lowest color red (suitable for periodic data, such as angles and phases, see \ref setPeriodic)
4737 };
4763 void colorize(const double *data, const QCPRange &range, QRgb *scanLine, int n, int dataIndexFactor=1, bool logarithmic=false);
4764 void colorize(const double *data, const unsigned char *alpha, const QCPRange &range, QRgb *scanLine, int n, int dataIndexFactor=1, bool logarithmic=false);
4780 QVector<QRgb> mColorBuffer; // have colors premultiplied with alpha (for usage with QImage::Format_ARGB32_Premultiplied)
4809 ,bsHalfEllipse ///< A half ellipse is drawn. The size of the ellipse is given by the bracket width/height properties.
4810 ,bsEllipse ///< An ellipse is drawn. The size of the ellipse is given by the bracket width/height properties.
4812 ,bsUserStyle ///< Start custom bracket styles at this index when subclassing and reimplementing \ref drawBracket.
4813 };
4854 double getTangentAngle(const QCPPlottableInterface1D *interface1d, int dataIndex, int direction) const;
4872 Q_PROPERTY(Qt::AspectRatioMode backgroundScaledMode READ backgroundScaledMode WRITE setBackgroundScaledMode)
4895 void setBackground(const QPixmap &pm, bool scaled, Qt::AspectRatioMode mode=Qt::KeepAspectRatioByExpanding);
5025 virtual double selectTest(const QPointF &pos, bool onlySelectable, QVariant *details=nullptr) const Q_DECL_OVERRIDE;
5046 virtual void selectEvent(QMouseEvent *event, bool additive, const QVariant &details, bool *selectionStateChanged) Q_DECL_OVERRIDE;
5091 Q_PROPERTY(SelectableParts selectableParts READ selectableParts WRITE setSelectableParts NOTIFY selectionChanged)
5092 Q_PROPERTY(SelectableParts selectedParts READ selectedParts WRITE setSelectedParts NOTIFY selectableChanged)
5094 Q_PROPERTY(QPen selectedIconBorderPen READ selectedIconBorderPen WRITE setSelectedIconBorderPen)
5108 };
5150 virtual double selectTest(const QPointF &pos, bool onlySelectable, QVariant *details=nullptr) const Q_DECL_OVERRIDE;
5188 virtual void selectEvent(QMouseEvent *event, bool additive, const QVariant &details, bool *selectionStateChanged) Q_DECL_OVERRIDE;
5226 QCPTextElement(QCustomPlot *parentPlot, const QString &text, const QString &fontFamily, double pointSize);
5250 virtual double selectTest(const QPointF &pos, bool onlySelectable, QVariant *details=nullptr) const Q_DECL_OVERRIDE;
5253 virtual void mouseDoubleClickEvent(QMouseEvent *event, const QVariant &details) Q_DECL_OVERRIDE;
5278 virtual void selectEvent(QMouseEvent *event, bool additive, const QVariant &details, bool *selectionStateChanged) Q_DECL_OVERRIDE;
5328 Q_PROPERTY(QCPAxis::ScaleType dataScaleType READ dataScaleType WRITE setDataScaleType NOTIFY dataScaleTypeChanged)
5429 This template instantiation is the container in which QCPGraph holds its data. For details about
5452 enum LineStyle { lsNone ///< data points are not connected with any lines (e.g. data only represented
5455 ,lsStepLeft ///< line is drawn as steps where the step height is the value of the left data point
5456 ,lsStepRight ///< line is drawn as steps where the step height is the value of the right data point
5458 ,lsImpulse ///< each data point is represented by a line parallel to the value axis, which reaches from the data point to the zero-value-line
5459 };
5475 void setData(const QVector<double> &keys, const QVector<double> &values, bool alreadySorted=false);
5483 void addData(const QVector<double> &keys, const QVector<double> &values, bool alreadySorted=false);
5487 virtual double selectTest(const QPointF &pos, bool onlySelectable, QVariant *details=nullptr) const Q_DECL_OVERRIDE;
5488 virtual QCPRange getKeyRange(bool &foundRange, QCP::SignDomain inSignDomain=QCP::sdBoth) const Q_DECL_OVERRIDE;
5489 virtual QCPRange getValueRange(bool &foundRange, QCP::SignDomain inSignDomain=QCP::sdBoth, const QCPRange &inKeyRange=QCPRange()) const Q_DECL_OVERRIDE;
5505 virtual void drawScatterPlot(QCPPainter *painter, const QVector<QPointF> &scatters, const QCPScatterStyle &style) const;
5509 virtual void getOptimizedLineData(QVector<QCPGraphData> *lineData, const QCPGraphDataContainer::const_iterator &begin, const QCPGraphDataContainer::const_iterator &end) const;
5510 virtual void getOptimizedScatterData(QVector<QCPGraphData> *scatterData, QCPGraphDataContainer::const_iterator begin, QCPGraphDataContainer::const_iterator end) const;
5513 void getVisibleDataBounds(QCPGraphDataContainer::const_iterator &begin, QCPGraphDataContainer::const_iterator &end, const QCPDataRange &rangeRestriction) const;
5521 QVector<QCPDataRange> getNonNanSegments(const QVector<QPointF> *lineData, Qt::Orientation keyOrientation) const;
5522 QVector<QPair<QCPDataRange, QCPDataRange> > getOverlappingSegments(QVector<QCPDataRange> thisSegments, const QVector<QPointF> *thisData, QVector<QCPDataRange> otherSegments, const QVector<QPointF> *otherData) const;
5523 bool segmentsIntersect(double aLower, double aUpper, double bLower, double bUpper, int &bPrecedence) const;
5526 const QPolygonF getChannelFillPolygon(const QVector<QPointF> *thisData, QCPDataRange thisSegment, const QVector<QPointF> *otherData, QCPDataRange otherSegment) const;
5531 double pointDistance(const QPointF &pixelPoint, QCPGraphDataContainer::const_iterator &closestData) const;
5569 This template instantiation is the container in which QCPCurve holds its data. For details about
5592 };
5606 void setData(const QVector<double> &t, const QVector<double> &keys, const QVector<double> &values, bool alreadySorted=false);
5613 void addData(const QVector<double> &t, const QVector<double> &keys, const QVector<double> &values, bool alreadySorted=false);
5619 virtual double selectTest(const QPointF &pos, bool onlySelectable, QVariant *details=nullptr) const Q_DECL_OVERRIDE;
5620 virtual QCPRange getKeyRange(bool &foundRange, QCP::SignDomain inSignDomain=QCP::sdBoth) const Q_DECL_OVERRIDE;
5621 virtual QCPRange getValueRange(bool &foundRange, QCP::SignDomain inSignDomain=QCP::sdBoth, const QCPRange &inKeyRange=QCPRange()) const Q_DECL_OVERRIDE;
5635 virtual void drawScatterPlot(QCPPainter *painter, const QVector<QPointF> &points, const QCPScatterStyle &style) const;
5638 void getCurveLines(QVector<QPointF> *lines, const QCPDataRange &dataRange, double penWidth) const;
5639 void getScatters(QVector<QPointF> *scatters, const QCPDataRange &dataRange, double scatterWidth) const;
5640 int getRegion(double key, double value, double keyMin, double valueMax, double keyMax, double valueMin) const;
5641 QPointF getOptimizedPoint(int otherRegion, double otherKey, double otherValue, double key, double value, double keyMin, double valueMax, double keyMax, double valueMin) const;
5642 QVector<QPointF> getOptimizedCornerPoints(int prevRegion, int currentRegion, double prevKey, double prevValue, double key, double value, double keyMin, double valueMax, double keyMax, double valueMin) const;
5644 bool getTraverse(double prevKey, double prevValue, double key, double value, double keyMin, double valueMax, double keyMax, double valueMin, QPointF &crossA, QPointF &crossB) const;
5645 void getTraverseCornerPoints(int prevRegion, int currentRegion, double keyMin, double valueMax, double keyMax, double valueMin, QVector<QPointF> &beforeTraverse, QVector<QPointF> &afterTraverse) const;
5646 double pointDistance(const QPointF &pixelPoint, QCPCurveDataContainer::const_iterator &closestData) const;
5676 };
5737 inline QCPRange valueRange() const { return QCPRange(value, value); } // note that bar base value isn't held in each QCPBarsData and thus can't/shouldn't be returned here
5748 This template instantiation is the container in which QCPBars holds its data. For details about
5777 };
5795 void setData(const QVector<double> &keys, const QVector<double> &values, bool alreadySorted=false);
5803 void addData(const QVector<double> &keys, const QVector<double> &values, bool alreadySorted=false);
5809 virtual QCPDataSelection selectTestRect(const QRectF &rect, bool onlySelectable) const Q_DECL_OVERRIDE;
5810 virtual double selectTest(const QPointF &pos, bool onlySelectable, QVariant *details=nullptr) const Q_DECL_OVERRIDE;
5811 virtual QCPRange getKeyRange(bool &foundRange, QCP::SignDomain inSignDomain=QCP::sdBoth) const Q_DECL_OVERRIDE;
5812 virtual QCPRange getValueRange(bool &foundRange, QCP::SignDomain inSignDomain=QCP::sdBoth, const QCPRange &inKeyRange=QCPRange()) const Q_DECL_OVERRIDE;
5829 void getVisibleDataBounds(QCPBarsDataContainer::const_iterator &begin, QCPBarsDataContainer::const_iterator &end) const;
5851 QCPStatisticalBoxData(double key, double minimum, double lowerQuartile, double median, double upperQuartile, double maximum, const QVector<double>& outliers=QVector<double>());
5854 inline static QCPStatisticalBoxData fromSortKey(double sortKey) { return QCPStatisticalBoxData(sortKey, 0, 0, 0, 0, 0); }
5863 for (QVector<double>::const_iterator it = outliers.constBegin(); it != outliers.constEnd(); ++it)
5913 void setData(const QVector<double> &keys, const QVector<double> &minimum, const QVector<double> &lowerQuartile, const QVector<double> &median, const QVector<double> &upperQuartile, const QVector<double> &maximum, bool alreadySorted=false);
5923 void addData(const QVector<double> &keys, const QVector<double> &minimum, const QVector<double> &lowerQuartile, const QVector<double> &median, const QVector<double> &upperQuartile, const QVector<double> &maximum, bool alreadySorted=false);
5924 void addData(double key, double minimum, double lowerQuartile, double median, double upperQuartile, double maximum, const QVector<double> &outliers=QVector<double>());
5927 virtual QCPDataSelection selectTestRect(const QRectF &rect, bool onlySelectable) const Q_DECL_OVERRIDE;
5928 virtual double selectTest(const QPointF &pos, bool onlySelectable, QVariant *details=nullptr) const Q_DECL_OVERRIDE;
5929 virtual QCPRange getKeyRange(bool &foundRange, QCP::SignDomain inSignDomain=QCP::sdBoth) const Q_DECL_OVERRIDE;
5930 virtual QCPRange getValueRange(bool &foundRange, QCP::SignDomain inSignDomain=QCP::sdBoth, const QCPRange &inKeyRange=QCPRange()) const Q_DECL_OVERRIDE;
5946 virtual void drawStatisticalBox(QCPPainter *painter, QCPStatisticalBoxDataContainer::const_iterator it, const QCPScatterStyle &outlierStyle) const;
5949 void getVisibleDataBounds(QCPStatisticalBoxDataContainer::const_iterator &begin, QCPStatisticalBoxDataContainer::const_iterator &end) const;
5951 QVector<QLineF> getWhiskerBackboneLines(QCPStatisticalBoxDataContainer::const_iterator it) const;
5967 QCPColorMapData(int keySize, int valueSize, const QCPRange &keyRange, const QCPRange &valueRange);
6026 Q_PROPERTY(QCPAxis::ScaleType dataScaleType READ dataScaleType WRITE setDataScaleType NOTIFY dataScaleTypeChanged)
6056 Q_SLOT void updateLegendIcon(Qt::TransformationMode transformMode=Qt::SmoothTransformation, const QSize &thumbSize=QSize(32, 18));
6059 virtual double selectTest(const QPointF &pos, bool onlySelectable, QVariant *details=nullptr) const Q_DECL_OVERRIDE;
6060 virtual QCPRange getKeyRange(bool &foundRange, QCP::SignDomain inSignDomain=QCP::sdBoth) const Q_DECL_OVERRIDE;
6107 inline static QCPFinancialData fromSortKey(double sortKey) { return QCPFinancialData(sortKey, 0, 0, 0, 0); }
6113 inline QCPRange valueRange() const { return QCPRange(low, high); } // open and close must lie between low and high, so we don't need to check them
6125 about the generic container, see the documentation of the class template \ref QCPDataContainer.
6154 };
6164 };
6183 void setData(const QVector<double> &keys, const QVector<double> &open, const QVector<double> &high, const QVector<double> &low, const QVector<double> &close, bool alreadySorted=false);
6194 void addData(const QVector<double> &keys, const QVector<double> &open, const QVector<double> &high, const QVector<double> &low, const QVector<double> &close, bool alreadySorted=false);
6198 virtual QCPDataSelection selectTestRect(const QRectF &rect, bool onlySelectable) const Q_DECL_OVERRIDE;
6199 virtual double selectTest(const QPointF &pos, bool onlySelectable, QVariant *details=nullptr) const Q_DECL_OVERRIDE;
6200 virtual QCPRange getKeyRange(bool &foundRange, QCP::SignDomain inSignDomain=QCP::sdBoth) const Q_DECL_OVERRIDE;
6201 virtual QCPRange getValueRange(bool &foundRange, QCP::SignDomain inSignDomain=QCP::sdBoth, const QCPRange &inKeyRange=QCPRange()) const Q_DECL_OVERRIDE;
6204 static QCPFinancialDataContainer timeSeriesToOhlc(const QVector<double> &time, const QVector<double> &value, double timeBinSize, double timeBinOffset = 0);
6220 void drawOhlcPlot(QCPPainter *painter, const QCPFinancialDataContainer::const_iterator &begin, const QCPFinancialDataContainer::const_iterator &end, bool isSelected);
6221 void drawCandlestickPlot(QCPPainter *painter, const QCPFinancialDataContainer::const_iterator &begin, const QCPFinancialDataContainer::const_iterator &end, bool isSelected);
6223 double ohlcSelectTest(const QPointF &pos, const QCPFinancialDataContainer::const_iterator &begin, const QCPFinancialDataContainer::const_iterator &end, QCPFinancialDataContainer::const_iterator &closestDataPoint) const;
6224 double candlestickSelectTest(const QPointF &pos, const QCPFinancialDataContainer::const_iterator &begin, const QCPFinancialDataContainer::const_iterator &end, QCPFinancialDataContainer::const_iterator &closestDataPoint) const;
6225 void getVisibleDataBounds(QCPFinancialDataContainer::const_iterator &begin, QCPFinancialDataContainer::const_iterator &end) const;
6261 sortable key, but merely an index (as \c QVector provides), which maps one-to-one to the indices
6286 enum ErrorType { etKeyError ///< The errors are for the key dimension (bars appear parallel to the key axis)
6287 ,etValueError ///< The errors are for the value dimension (bars appear parallel to the value axis)
6288 };
6323 virtual QCPDataSelection selectTestRect(const QRectF &rect, bool onlySelectable) const Q_DECL_OVERRIDE;
6328 virtual double selectTest(const QPointF &pos, bool onlySelectable, QVariant *details=nullptr) const Q_DECL_OVERRIDE;
6342 virtual QCPRange getKeyRange(bool &foundRange, QCP::SignDomain inSignDomain=QCP::sdBoth) const Q_DECL_OVERRIDE;
6343 virtual QCPRange getValueRange(bool &foundRange, QCP::SignDomain inSignDomain=QCP::sdBoth, const QCPRange &inKeyRange=QCPRange()) const Q_DECL_OVERRIDE;
6346 void getErrorBarLines(QCPErrorBarsDataContainer::const_iterator it, QVector<QLineF> &backbones, QVector<QLineF> &whiskers) const;
6347 void getVisibleDataBounds(QCPErrorBarsDataContainer::const_iterator &begin, QCPErrorBarsDataContainer::const_iterator &end, const QCPDataRange &rangeRestriction) const;
6348 double pointDistance(const QPointF &pixelPoint, QCPErrorBarsDataContainer::const_iterator &closestData) const;
6350 void getDataSegments(QList<QCPDataRange> &selectedSegments, QList<QCPDataRange> &unselectedSegments) const;
6384 virtual double selectTest(const QPointF &pos, bool onlySelectable, QVariant *details=nullptr) const Q_DECL_OVERRIDE;
6397 QLineF getRectClippedStraightLine(const QCPVector2D &base, const QCPVector2D &vec, const QRect &rect) const;
6433 virtual double selectTest(const QPointF &pos, bool onlySelectable, QVariant *details=nullptr) const Q_DECL_OVERRIDE;
6447 QLineF getRectClippedLine(const QCPVector2D &start, const QCPVector2D &end, const QRect &rect) const;
6620 virtual double selectTest(const QPointF &pos, bool onlySelectable, QVariant *details=nullptr) const Q_DECL_OVERRIDE;
6633 enum AnchorIndex {aiTopLeft, aiTop, aiTopRight, aiRight, aiBottomRight, aiBottom, aiBottomLeft, aiLeft};
6651 QPointF getTextDrawPoint(const QPointF &pos, const QRectF &rect, Qt::Alignment positionAlignment) const;
6690 virtual double selectTest(const QPointF &pos, bool onlySelectable, QVariant *details=nullptr) const Q_DECL_OVERRIDE;
6751 void setScaled(bool scaled, Qt::AspectRatioMode aspectRatioMode=Qt::KeepAspectRatio, Qt::TransformationMode transformationMode=Qt::SmoothTransformation);
6811 The different visual appearances a tracer item can have. Some styles size may be controlled with \ref setSize.
6820 };
6901 };
6959 enum AngleReference { arAbsolute ///< The axis tilt is given in absolute degrees. The zero is to the right and positive angles are measured counter-clockwise.
6960 ,arAngularAxis ///< The axis tilt is measured in the angular coordinate system given by the parent angular axis.
6961 };
6968 ,stLogarithmic ///< Logarithmic scaling with correspondingly transformed axis coordinates (possibly also \ref setTicker to a \ref QCPAxisTickerLog instance).
6969 };
6979 };
7087 virtual double selectTest(const QPointF &pos, bool onlySelectable, QVariant *details=0) const Q_DECL_OVERRIDE;
7162 virtual void selectEvent(QMouseEvent *event, bool additive, const QVariant &details, bool *selectionStateChanged) Q_DECL_OVERRIDE;
7215 };
7280 void setBackground(const QPixmap &pm, bool scaled, Qt::AspectRatioMode mode=Qt::KeepAspectRatioByExpanding);
7331 virtual double selectTest(const QPointF &pos, bool onlySelectable, QVariant *details=0) const Q_DECL_OVERRIDE;
7349 double coordToAngleRad(double coord) const { return mAngleRad+(coord-mRange.lower)/mRange.size()*(mRangeReversed ? -2.0*M_PI : 2.0*M_PI); } // mention in doc that return doesn't wrap
7535 void drawRadialGrid(QCPPainter *painter, const QPointF ¢er, const QVector<double> &coords, const QPen &pen, const QPen &zeroPen=Qt::NoPen);
7536 void drawAngularGrid(QCPPainter *painter, const QPointF ¢er, double radius, const QVector<QPointF> &ticksCosSin, const QPen &pen);
7590 enum LineStyle { lsNone ///< data points are not connected with any lines (e.g. data only represented
7593 };
7629 void setData(const QVector<double> &keys, const QVector<double> &values, bool alreadySorted=false);
7634 void addData(const QVector<double> &keys, const QVector<double> &values, bool alreadySorted=false);
7649 virtual double selectTest(const QPointF &pos, bool onlySelectable, QVariant *details=0) const override; // actually introduced in QCPLayerable as non-pure, but we want to force reimplementation for plottables
7650 virtual QCPPlottableInterface1D *interface1D() { return 0; } // TODO: return this later, when QCPAbstractPolarPlottable is created
7651 virtual QCPRange getKeyRange(bool &foundRange, QCP::SignDomain inSignDomain=QCP::sdBoth) const;
7652 virtual QCPRange getValueRange(bool &foundRange, QCP::SignDomain inSignDomain=QCP::sdBoth, const QCPRange &inKeyRange=QCPRange()) const;
7681 virtual void selectEvent(QMouseEvent *event, bool additive, const QVariant &details, bool *selectionStateChanged) override;
7686 virtual void drawScatterPlot(QCPPainter *painter, const QVector<QPointF> &scatters, const QCPScatterStyle &style) const;
7694 double pointDistance(const QPointF &pixelPoint, QCPGraphDataContainer::const_iterator &closestData) const;
7697 void getDataSegments(QList<QCPDataRange> &selectedSegments, QList<QCPDataRange> &unselectedSegments) const;
7699 void getVisibleDataBounds(QCPGraphDataContainer::const_iterator &begin, QCPGraphDataContainer::const_iterator &end, const QCPDataRange &rangeRestriction) const;
7702 void getOptimizedLineData(QVector<QCPGraphData> *lineData, const QCPGraphDataContainer::const_iterator &begin, const QCPGraphDataContainer::const_iterator &end) const;
7703 void getOptimizedScatterData(QVector<QCPGraphData> *scatterData, QCPGraphDataContainer::const_iterator begin, QCPGraphDataContainer::const_iterator end) const;
void selectionChanged(bool selected)
virtual double selectTest(const QPointF &pos, bool onlySelectable, QVariant *details=nullptr) const override=0
The abstract base class for all entries in a QCPLegend.
Definition qcustomplot.h:4993
void selectionChanged(bool selected)
The abstract base class for paint buffers, which define the rendering backend.
Definition qcustomplot.h:518
virtual void draw(QCPPainter *painter) const =0
virtual void clear(const QColor &color)=0
virtual void reallocateBuffer()=0
virtual QCPPainter * startPainting()=0
A template base class for plottables with one-dimensional data.
Definition qcustomplot.h:4121
virtual QPointF dataPixelPosition(int index) const override
Definition qcustomplot.h:4434
virtual int findBegin(double sortKey, bool expandedRange=true) const override
Definition qcustomplot.h:4513
QCPAbstractPlottable1D(QCPAxis *keyAxis, QCPAxis *valueAxis)
Definition qcustomplot.h:4346
virtual int dataCount() const override
Definition qcustomplot.h:4361
virtual int findEnd(double sortKey, bool expandedRange=true) const override
Definition qcustomplot.h:4522
virtual double dataMainKey(int index) const override
Definition qcustomplot.h:4370
void drawPolyline(QCPPainter *painter, const QVector< QPointF > &lineData) const
Definition qcustomplot.h:4630
virtual bool sortKeyIsMainKey() const override
Definition qcustomplot.h:4451
virtual double dataSortKey(int index) const override
Definition qcustomplot.h:4386
virtual double selectTest(const QPointF &pos, bool onlySelectable, QVariant *details=nullptr) const override
Definition qcustomplot.h:4538
virtual QCPRange dataValueRange(int index) const override
Definition qcustomplot.h:4418
virtual QCPPlottableInterface1D * interface1D() override
Definition qcustomplot.h:4142
virtual double dataMainValue(int index) const override
Definition qcustomplot.h:4402
void getDataSegments(QList< QCPDataRange > &selectedSegments, QList< QCPDataRange > &unselectedSegments) const
Definition qcustomplot.h:4600
virtual QCPDataSelection selectTestRect(const QRectF &rect, bool onlySelectable) const override
Definition qcustomplot.h:4464
The abstract base class for all data representing objects in a plot.
Definition qcustomplot.h:3437
void setAntialiasedFill(bool enabled)
Definition qcustomplot.cpp:11447
void applyDefaultAntialiasingHint(QCPPainter *painter) const override
Definition qcustomplot.cpp:11897
void rescaleAxes(bool onlyEnlarge=false) const
Definition qcustomplot.cpp:11694
virtual void draw(QCPPainter *painter) override=0
void setSelectionDecorator(QCPSelectionDecorator *decorator)
Definition qcustomplot.cpp:11561
Q_SLOT void setSelection(QCPDataSelection selection)
Definition qcustomplot.cpp:11541
void setAntialiasedScatters(bool enabled)
Definition qcustomplot.cpp:11458
void pixelsToCoords(double x, double y, double &key, double &value) const
Definition qcustomplot.cpp:11655
void selectionChanged(bool selected)
virtual QCPPlottableInterface1D * interface1D()
Definition qcustomplot.h:3482
virtual QCPRange getKeyRange(bool &foundRange, QCP::SignDomain inSignDomain=QCP::sdBoth) const =0
virtual void deselectEvent(bool *selectionStateChanged) override
Definition qcustomplot.cpp:11966
void selectableChanged(QCP::SelectionType selectable)
void rescaleValueAxis(bool onlyEnlarge=false, bool inKeyRange=false) const
Definition qcustomplot.cpp:11747
virtual void drawLegendIcon(QCPPainter *painter, const QRectF &rect) const =0
QCPSelectionDecorator * selectionDecorator() const
Definition qcustomplot.h:3466
void selectionChanged(const QCPDataSelection &selection)
void coordsToPixels(double key, double value, double &x, double &y) const
Definition qcustomplot.cpp:11613
virtual double selectTest(const QPointF &pos, bool onlySelectable, QVariant *details=nullptr) const override=0
void applyFillAntialiasingHint(QCPPainter *painter) const
Definition qcustomplot.cpp:11913
virtual QCPRange getValueRange(bool &foundRange, QCP::SignDomain inSignDomain=QCP::sdBoth, const QCPRange &inKeyRange=QCPRange()) const =0
virtual void selectEvent(QMouseEvent *event, bool additive, const QVariant &details, bool *selectionStateChanged) override
Definition qcustomplot.cpp:11935
Q_SLOT void setSelectable(QCP::SelectionType selectable)
Definition qcustomplot.cpp:11587
virtual QRect clipRect() const override
Definition qcustomplot.cpp:11868
void applyScattersAntialiasingHint(QCPPainter *painter) const
Definition qcustomplot.cpp:11929
virtual QCP::Interaction selectionCategory() const override
Definition qcustomplot.cpp:11877
void rescaleKeyAxis(bool onlyEnlarge=false) const
Definition qcustomplot.cpp:11705
QCPAbstractPlottable(QCPAxis *keyAxis, QCPAxis *valueAxis)
Definition qcustomplot.cpp:11402
Holds multiple axes and arranges them in a rectangular shape.
Definition qcustomplot.h:4867
virtual void mouseMoveEvent(QMouseEvent *event, const QPointF &startPos) override
Definition qcustomplot.cpp:18571
virtual int calculateAutoMargin(QCP::MarginSide side) override
Definition qcustomplot.cpp:18488
virtual void wheelEvent(QWheelEvent *event) override
Definition qcustomplot.cpp:18657
virtual void mousePressEvent(QMouseEvent *event, const QVariant &details) override
Definition qcustomplot.cpp:18539
virtual void mouseReleaseEvent(QMouseEvent *event, const QPointF &startPos) override
Definition qcustomplot.cpp:18631
Specialized axis ticker for calendar dates and times as axis ticks.
Definition qcustomplot.h:1741
Specialized axis ticker to display ticks in units of an arbitrary constant, for example pi.
Definition qcustomplot.h:1922
Specialized axis ticker which allows arbitrary labels at specified coordinates.
Definition qcustomplot.h:1884
Specialized axis ticker for time spans in units of milliseconds to days.
Definition qcustomplot.h:1790
The base class tick generator used by QCPAxis to create tick positions and tick labels.
Definition qcustomplot.h:1676
void rangeChanged(const QCPRange &newRange)
void scaleTypeChanged(QCPAxis::ScaleType scaleType)
void selectionChanged(const QCPAxis::SelectableParts &parts)
void selectableChanged(const QCPAxis::SelectableParts &parts)
void rangeChanged(const QCPRange &newRange, const QCPRange &oldRange)
Holds the data of one single data point (one bar) for QCPBars.
Definition qcustomplot.h:5725
Groups multiple QCPBars together so they appear side by side.
Definition qcustomplot.h:5660
Defines a color gradient for use with e.g. QCPColorMap.
Definition qcustomplot.h:4695
Holds the two-dimensional data of a QCPColorMap plottable.
Definition qcustomplot.h:5965
A plottable representing a two-dimensional color map in a plot.
Definition qcustomplot.h:6022
An axis rect subclass for use in a QCPColorScale.
Definition qcustomplot.h:5299
A color scale for use with color coding data such as QCPColorMap.
Definition qcustomplot.h:5323
void gradientChanged(const QCPColorGradient &newGradient)
void dataScaleTypeChanged(QCPAxis::ScaleType scaleType)
void dataRangeChanged(const QCPRange &newRange)
static QCPCurveData fromSortKey(double sortKey)
Definition qcustomplot.h:5551
The generic data container for one-dimensional plottables.
Definition qcustomplot.h:2557
const_iterator findBegin(double sortKey, bool expandedRange=true) const
Definition qcustomplot.h:3048
QCPRange valueRange(bool &foundRange, QCP::SignDomain signDomain=QCP::sdBoth, const QCPRange &inKeyRange=QCPRange())
Definition qcustomplot.h:3225
void add(const QCPDataContainer< DataType > &data)
Definition qcustomplot.h:2814
bool qcpLessThanSortKey(const DataType &a, const DataType &b)
Definition qcustomplot.h:2553
void squeeze(bool preAllocation=true, bool postAllocation=true)
Definition qcustomplot.h:3016
void limitIteratorsToDataRange(const_iterator &begin, const_iterator &end, const QCPDataRange &dataRange) const
Definition qcustomplot.h:3313
void preallocateGrow(int minimumPreallocSize)
Definition qcustomplot.h:3331
QCPRange keyRange(bool &foundRange, QCP::SignDomain signDomain=QCP::sdBoth)
Definition qcustomplot.h:3102
void remove(double sortKeyFrom, double sortKeyTo)
Definition qcustomplot.h:2939
void set(const QCPDataContainer< DataType > &data)
Definition qcustomplot.h:2782
const_iterator findEnd(double sortKey, bool expandedRange=true) const
Definition qcustomplot.h:3075
QCPDataRange adjusted(int changeBegin, int changeEnd) const
Definition qcustomplot.h:917
QCPDataRange bounded(const QCPDataRange &other) const
Definition qcustomplot.cpp:2265
Describes a data set by holding multiple QCPDataRange instances.
Definition qcustomplot.h:930
void addDataRange(const QCPDataRange &dataRange, bool simplify=true)
Definition qcustomplot.cpp:2556
QCPDataSelection inverse(const QCPDataRange &outerRange) const
Definition qcustomplot.cpp:2721
Holds the data of one single error bar for QCPErrorBars.
Definition qcustomplot.h:6240
A plottable that adds a set of error bars to other plottables.
Definition qcustomplot.h:6269
Holds the data of one single data point for QCPFinancial.
Definition qcustomplot.h:6101
static QCPFinancialData fromSortKey(double sortKey)
Definition qcustomplot.h:6107
static QCPGraphData fromSortKey(double sortKey)
Definition qcustomplot.h:5412
An anchor of an item to which positions can be attached to.
Definition qcustomplot.h:3547
virtual QCPItemPosition * toQCPItemPosition()
Definition qcustomplot.h:3568
A bracket for referencing/highlighting certain parts in the plot.
Definition qcustomplot.h:6882
A straight line that spans infinitely in both directions.
Definition qcustomplot.h:6365
A layer that may contain objects, to control the rendering order.
Definition qcustomplot.h:626
virtual void applyDefaultAntialiasingHint(QCPPainter *painter) const =0
void layerChanged(QCPLayer *newLayer)
virtual void draw(QCPPainter *painter)=0
The abstract base class for all objects that form the layout system.
Definition qcustomplot.h:1182
A layout that places child elements aligned to the border or arbitrarily positioned.
Definition qcustomplot.h:1416
virtual QCPLayoutElement * takeAt(int index)=0
virtual QCPLayoutElement * elementAt(int index) const =0
virtual int elementCount() const =0
virtual bool take(QCPLayoutElement *element)=0
Handles the different ending decorations for line-like items.
Definition qcustomplot.h:1472
A margin group allows synchronization of margin sides if working with multiple layout elements.
Definition qcustomplot.h:1151
QList< QCPLayoutElement * > elements(QCP::MarginSide side) const
Definition qcustomplot.h:1158
A paint buffer based on QPixmap, using software raster rendering.
Definition qcustomplot.h:553
@ pmNoCaching
0x02 Mode for all sorts of exports (e.g. PNG, PDF,...). For example, this prevents using cached pixma...
Definition qcustomplot.h:468
@ pmVectorized
0x01 Mode for vectorized painting (e.g. PDF export). For example, this prevents some antialiasing fix...
Definition qcustomplot.h:467
Defines an abstract interface for one-dimensional plottables.
Definition qcustomplot.h:4103
virtual QCPDataSelection selectTestRect(const QRectF &rect, bool onlySelectable) const =0
virtual double dataMainValue(int index) const =0
virtual int findEnd(double sortKey, bool expandedRange=true) const =0
virtual QPointF dataPixelPosition(int index) const =0
virtual double dataMainKey(int index) const =0
virtual double dataSortKey(int index) const =0
virtual int findBegin(double sortKey, bool expandedRange=true) const =0
virtual bool sortKeyIsMainKey() const =0
virtual int dataCount() const =0
virtual QCPRange dataValueRange(int index) const =0
A legend item representing a plottable with an icon and the plottable name.
Definition qcustomplot.h:5057
The main container for polar plots, representing the angular axis as a circle.
Definition qcustomplot.h:7201
QSharedPointer< QCPAxisTicker > ticker() const
Definition qcustomplot.h:7003
The grid in both angular and radial dimensions for polar plots.
Definition qcustomplot.h:7474
A selection decorator which draws brackets around each selected data segment.
Definition qcustomplot.h:4798
Controls how a plottable's data selection is drawn.
Definition qcustomplot.h:3390
Provides rect/rubber-band data selection and range zoom interaction.
Definition qcustomplot.h:1097
void accepted(const QRect &rect, QMouseEvent *event)
void changed(const QRect &rect, QMouseEvent *event)
void started(QMouseEvent *event)
void canceled(const QRect &rect, QInputEvent *event)
Holds the data of one single data point for QCPStatisticalBox.
Definition qcustomplot.h:5848
static QCPStatisticalBoxData fromSortKey(double sortKey)
Definition qcustomplot.h:5854
A plottable representing a single statistical box in a plot.
Definition qcustomplot.h:5887
QSharedPointer< QCPStatisticalBoxDataContainer > data() const
Definition qcustomplot.h:5902
void selectionChanged(bool selected)
void doubleClicked(QMouseEvent *event)
void clicked(QMouseEvent *event)
The central class of the library. This is the QWidget which displays the plot and interacts with the ...
Definition qcustomplot.h:3732
void legendDoubleClick(QCPLegend *legend, QCPAbstractLegendItem *item, QMouseEvent *event)
void beforeReplot()
@ rpRefreshHint
Whether to use immediate or queued refresh depends on whether the plotting hint QCP::phImmediateRefre...
Definition qcustomplot.h:3764
void selectionChangedByUser()
void axisDoubleClick(QCPAxis *axis, QCPAxis::SelectablePart part, QMouseEvent *event)
void afterReplot()
void mouseMove(QMouseEvent *event)
void legendClick(QCPLegend *legend, QCPAbstractLegendItem *item, QMouseEvent *event)
void plottableDoubleClick(QCPAbstractPlottable *plottable, int dataIndex, QMouseEvent *event)
ItemType * itemAt(const QPointF &pos, bool onlySelectable=false) const
Definition qcustomplot.h:4070
void mouseDoubleClick(QMouseEvent *event)
void afterLayout()
void axisClick(QCPAxis *axis, QCPAxis::SelectablePart part, QMouseEvent *event)
void mouseWheel(QWheelEvent *event)
void itemDoubleClick(QCPAbstractItem *item, QMouseEvent *event)
void mouseRelease(QMouseEvent *event)
void mousePress(QMouseEvent *event)
void itemClick(QCPAbstractItem *item, QMouseEvent *event)
void plottableClick(QCPAbstractPlottable *plottable, int dataIndex, QMouseEvent *event)
void update(Part *part, const QByteArray &data, qint64 dataSize)
KDOCTOOLS_EXPORT QString transform(const QString &file, const QString &stylesheet, const QList< const char * > ¶ms=QList< const char * >())
QString name(GameStandardAction id)
VehicleSection::Type type(QStringView coachNumber, QStringView coachClassification)
KGuiItem add()
KGuiItem remove()
KGuiItem save()
KGuiItem clear()
const QList< QKeySequence > & begin()
QString label(StandardShortcut id)
QCA_EXPORT const SecureArray operator+(const SecureArray &a, const SecureArray &b)
Definition qcustomplot.h:138
@ epAllowCosmetic
Cosmetic pens are exported normally (e.g. in PDF exports, cosmetic pens always appear as 1 pixel on s...
Definition qcustomplot.h:175
@ epNoCosmetic
Cosmetic pens are converted to pens with pixel width 1 when exporting.
Definition qcustomplot.h:174
int getMarginValue(const QMargins &margins, QCP::MarginSide side)
Definition qcustomplot.h:346
@ iSelectLegend
0x020 Legends are selectable (or their child items, see QCPLegend::setSelectableParts)
Definition qcustomplot.h:256
@ iRangeDrag
0x001 Axis ranges are draggable (see QCPAxisRect::setRangeDrag, QCPAxisRect::setRangeDragAxes)
Definition qcustomplot.h:251
@ iSelectPlottables
0x008 Plottables are selectable (e.g. graphs, curves, bars,... see QCPAbstractPlottable)
Definition qcustomplot.h:254
@ iRangeZoom
0x002 Axis ranges are zoomable with the mouse wheel (see QCPAxisRect::setRangeZoom,...
Definition qcustomplot.h:252
@ iSelectPlottablesBeyondAxisRect
0x100 When performing plottable selection/hit tests, this flag extends the sensitive area beyond the ...
Definition qcustomplot.h:259
@ iSelectAxes
0x010 Axes are selectable (or parts of them, see QCPAxis::setSelectableParts)
Definition qcustomplot.h:255
@ iSelectItems
0x040 Items are selectable (Rectangles, Arrows, Textitems, etc. see QCPAbstractItem)
Definition qcustomplot.h:257
@ iMultiSelect
0x004 The user can select multiple objects by holding the modifier set by QCustomPlot::setMultiSelect...
Definition qcustomplot.h:253
@ iSelectOther
0x080 All other objects are selectable (e.g. your own derived layerables, other layout elements,...
Definition qcustomplot.h:258
@ phImmediateRefresh
0x002 causes an immediate repaint() instead of a soft update() when QCustomPlot::replot() is called w...
Definition qcustomplot.h:237
@ phCacheLabels
0x004 axis (tick) labels will be cached as pixmaps, increasing replot performance.
Definition qcustomplot.h:239
@ phFastPolylines
0x001 Graph/Curve lines are drawn with a faster method.
Definition qcustomplot.h:235
@ stMultipleDataRanges
Any combination of data points/ranges can be selected.
Definition qcustomplot.h:296
@ stDataRange
Multiple contiguous data points (a data range) can be selected.
Definition qcustomplot.h:295
@ stWhole
Selection behaves like stMultipleDataRanges, but if there are any data points selected,...
Definition qcustomplot.h:293
@ srmCustom
When dragging the mouse, a selection rect becomes active. It is the programmer's responsibility to co...
Definition qcustomplot.h:271
@ srmSelect
When dragging the mouse, a selection rect becomes active. Upon releasing, plottable data points that ...
Definition qcustomplot.h:270
@ srmZoom
When dragging the mouse, a selection rect becomes active. Upon releasing, the axes that are currently...
Definition qcustomplot.h:269
@ srmNone
The selection rect is disabled, and all mouse events are forwarded to the underlying objects,...
Definition qcustomplot.h:268
@ aeOther
0x8000 Other elements that don't fit into any of the existing categories
Definition qcustomplot.h:223
@ aeScatters
0x0080 Scatter symbols of plottables (excluding scatter symbols of type ssPixmap)
Definition qcustomplot.h:220
void setMarginValue(QMargins &margins, QCP::MarginSide side, int value)
Definition qcustomplot.h:326
bool testFlag(Enum flag) const const
const_reference at(qsizetype i) const const
void clear()
const_iterator constBegin() const const
const_pointer constData() const const
const_iterator constEnd() const const
bool isEmpty() const const
qsizetype size() const const
T value(qsizetype i) const const
int bottom() const const
int left() const const
int right() const const
void setBottom(int bottom)
void setLeft(int left)
void setRight(int right)
void setTop(int Top)
int top() const const
Q_GADGETQ_GADGET
Q_OBJECTQ_OBJECT
Q_PROPERTY(...)
Q_SLOTQ_SLOT
virtual bool event(QEvent *e)
T qobject_cast(QObject *object)
Antialiasing
const QBrush & background() const const
const QBrush & brush() const const
void drawPolyline(const QPoint *points, int pointCount)
bool end()
const QFont & font() const const
const QPen & pen() const const
void setBackground(const QBrush &brush)
void setBrush(Qt::BrushStyle style)
void setFont(const QFont &font)
void setPen(Qt::PenStyle style)
void setWidth(int width)
Qt::PenStyle style() const const
qreal widthF() const const
T * data() const const
QPointF bottomRight() const const
QPointF topLeft() const const
AlignmentFlag
AspectRatioMode
NoBrush
KeyboardModifier
Vertical
PenStyle
TimeSpec
TransformationMode
void setValue(QVariant &&value)
T value() const const
pos
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Jul 26 2024 11:59:51 by doxygen 1.11.0 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Jul 26 2024 11:59:51 by doxygen 1.11.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.