gepetto-viewer  6.0.0
An user-friendly Graphical Interface
qcustomplot.h
Go to the documentation of this file.
1 /***************************************************************************
2 ** **
3 ** QCustomPlot, an easy to use, modern plotting widget for Qt **
4 ** Copyright (C) 2011-2018 Emanuel Eichhammer **
5 ** **
6 ** This program is free software: you can redistribute it and/or modify **
7 ** it under the terms of the GNU General Public License as published by **
8 ** the Free Software Foundation, either version 3 of the License, or **
9 ** (at your option) any later version. **
10 ** **
11 ** This program is distributed in the hope that it will be useful, **
12 ** but WITHOUT ANY WARRANTY; without even the implied warranty of **
13 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the **
14 ** GNU General Public License for more details. **
15 ** **
16 ** You should have received a copy of the GNU General Public License **
17 ** along with this program. If not, see http://www.gnu.org/licenses/. **
18 ** **
19 ****************************************************************************
20 ** Author: Emanuel Eichhammer **
21 ** Website/Contact: http://www.qcustomplot.com/ **
22 ** Date: 25.06.18 **
23 ** Version: 2.0.1 **
24 ****************************************************************************/
25 
26 #ifndef QCUSTOMPLOT_H
27 #define QCUSTOMPLOT_H
28 
29 #include <QtCore/qglobal.h>
30 
31 // some Qt version/configuration dependent macros to include or exclude certain
32 // code paths:
33 #ifdef QCUSTOMPLOT_USE_OPENGL
34 #if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
35 #define QCP_OPENGL_PBUFFER
36 #else
37 #define QCP_OPENGL_FBO
38 #endif
39 #if QT_VERSION >= QT_VERSION_CHECK(5, 3, 0)
40 #define QCP_OPENGL_OFFSCREENSURFACE
41 #endif
42 #endif
43 
44 #if QT_VERSION >= QT_VERSION_CHECK(5, 4, 0)
45 #define QCP_DEVICEPIXELRATIO_SUPPORTED
46 #if QT_VERSION >= QT_VERSION_CHECK(5, 6, 0)
47 #define QCP_DEVICEPIXELRATIO_FLOAT
48 #endif
49 #endif
50 
51 #include <qmath.h>
52 
53 #include <QtCore/QCache>
54 #include <QtCore/QDateTime>
55 #include <QtCore/QDebug>
56 #include <QtCore/QFlags>
57 #include <QtCore/QMargins>
58 #include <QtCore/QMultiMap>
59 #include <QtCore/QObject>
60 #include <QtCore/QPointer>
61 #include <QtCore/QSharedPointer>
62 #include <QtCore/QStack>
63 #include <QtCore/QString>
64 #include <QtCore/QTimer>
65 #include <QtCore/QVector>
66 #include <QtGui/QMouseEvent>
67 #include <QtGui/QPaintEvent>
68 #include <QtGui/QPainter>
69 #include <QtGui/QPixmap>
70 #include <QtGui/QWheelEvent>
71 #include <algorithm>
72 #include <limits>
73 #ifdef QCP_OPENGL_FBO
74 #include <QtGui/QOpenGLContext>
75 #include <QtGui/QOpenGLFramebufferObject>
76 #ifdef QCP_OPENGL_OFFSCREENSURFACE
77 #include <QtGui/QOffscreenSurface>
78 #else
79 #include <QtGui/QWindow>
80 #endif
81 #endif
82 #ifdef QCP_OPENGL_PBUFFER
83 #include <QtOpenGL/QGLPixelBuffer>
84 #endif
85 #if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
86 #include <qnumeric.h>
87 
88 #include <QtGui/QPrintEngine>
89 #include <QtGui/QPrinter>
90 #include <QtGui/QWidget>
91 #else
92 #include <QtNumeric>
93 #include <QtPrintSupport/QtPrintSupport>
94 #include <QtWidgets/QWidget>
95 #endif
96 
97 class QCPPainter;
98 class QCustomPlot;
99 class QCPLayerable;
100 class QCPLayoutElement;
101 class QCPLayout;
102 class QCPAxis;
103 class QCPAxisRect;
106 class QCPGraph;
107 class QCPAbstractItem;
109 class QCPLegend;
110 class QCPItemPosition;
111 class QCPLayer;
113 class QCPSelectionRect;
114 class QCPColorMap;
115 class QCPColorScale;
116 class QCPBars;
117 
118 /* including file 'src/global.h', size 16357 */
119 /* commit ce344b3f96a62e5f652585e55f1ae7c7883cd45b 2018-06-25 01:03:39 +0200 */
120 
121 #define QCUSTOMPLOT_VERSION_STR "2.0.1"
122 #define QCUSTOMPLOT_VERSION 0x020001
123 
124 // decl definitions for shared library compilation/usage:
125 #if defined(QT_STATIC_BUILD)
126 #define QCP_LIB_DECL
127 #elif defined(QCUSTOMPLOT_COMPILE_LIBRARY)
128 #define QCP_LIB_DECL Q_DECL_EXPORT
129 #elif defined(QCUSTOMPLOT_USE_LIBRARY)
130 #define QCP_LIB_DECL Q_DECL_IMPORT
131 #else
132 #define QCP_LIB_DECL
133 #endif
134 
135 // define empty macro for Q_DECL_OVERRIDE if it doesn't exist (Qt < 5)
136 #ifndef Q_DECL_OVERRIDE
137 #define Q_DECL_OVERRIDE
138 #endif
139 
147 #ifndef Q_MOC_RUN
148 namespace QCP {
149 #else
150 class QCP { // when in moc-run, make it look like a class, so we get Q_GADGET,
151  // Q_ENUMS/Q_FLAGS features in namespace
152  Q_GADGET
153  Q_ENUMS(ExportPen)
154  Q_ENUMS(ResolutionUnit)
155  Q_ENUMS(SignDomain)
156  Q_ENUMS(MarginSide)
157  Q_FLAGS(MarginSides)
158  Q_ENUMS(AntialiasedElement)
159  Q_FLAGS(AntialiasedElements)
160  Q_ENUMS(PlottingHint)
161  Q_FLAGS(PlottingHints)
162  Q_ENUMS(Interaction)
163  Q_FLAGS(Interactions)
164  Q_ENUMS(SelectionRectMode)
165  Q_ENUMS(SelectionType)
166  public:
167 #endif
168 
178  ,
180  ,
182 };
183 
190 enum ExportPen {
191  epNoCosmetic
193  ,
197 };
198 
208  sdNegative
209  ,
210  sdBoth
211  ,
212  sdPositive
213 };
214 
221  msLeft = 0x01
222  ,
223  msRight = 0x02
224  ,
225  msTop = 0x04
226  ,
227  msBottom = 0x08
228  ,
229  msAll = 0xFF
230  ,
231  msNone = 0x00
232 };
233 Q_DECLARE_FLAGS(MarginSides, MarginSide)
234 
235 
247  aeAxes = 0x0001
248  ,
249  aeGrid = 0x0002
250  ,
251  aeSubGrid = 0x0004
252  ,
253  aeLegend = 0x0008
254  ,
255  aeLegendItems = 0x0010
256  ,
257  aePlottables = 0x0020
258  ,
259  aeItems = 0x0040
260  ,
261  aeScatters = 0x0080
263  ,
264  aeFills = 0x0100
266  ,
267  aeZeroLine =
268  0x0200
269  ,
270  aeOther = 0x8000
272  ,
273  aeAll = 0xFFFF
274  ,
275  aeNone = 0x0000
276 };
277 Q_DECLARE_FLAGS(AntialiasedElements, AntialiasedElement)
278 
279 
286  phNone = 0x000
287  ,
288  phFastPolylines = 0x001
294  ,
296  0x002
302  ,
303  phCacheLabels = 0x004
305 };
306 Q_DECLARE_FLAGS(PlottingHints, PlottingHint)
307 
308 
316  iRangeDrag =
317  0x001
319  ,
320  iRangeZoom = 0x002
323  ,
324  iMultiSelect = 0x004
327  ,
329  0x008
331  ,
332  iSelectAxes = 0x010
334  ,
335  iSelectLegend = 0x020
337  ,
338  iSelectItems = 0x040
340  ,
341  iSelectOther =
342  0x080
344 };
345 Q_DECLARE_FLAGS(Interactions, Interaction)
346 
347 
354  srmNone
357  ,
358  srmZoom
362  ,
363  srmSelect
368  ,
369  srmCustom
374 };
375 
397  stNone
398  ,
399  stWhole
402  ,
403  stSingleData
404  ,
405  stDataRange
407  ,
410 };
411 
419 inline bool isInvalidData(double value) {
420  return qIsNaN(value) || qIsInf(value);
421 }
422 
428 inline bool isInvalidData(double value1, double value2) {
429  return isInvalidData(value1) || isInvalidData(value2);
430 }
431 
438 inline void setMarginValue(QMargins &margins, QCP::MarginSide side, int value) {
439  switch (side) {
440  case QCP::msLeft:
441  margins.setLeft(value);
442  break;
443  case QCP::msRight:
444  margins.setRight(value);
445  break;
446  case QCP::msTop:
447  margins.setTop(value);
448  break;
449  case QCP::msBottom:
450  margins.setBottom(value);
451  break;
452  case QCP::msAll:
453  margins = QMargins(value, value, value, value);
454  break;
455  default:
456  break;
457  }
458 }
459 
467 inline int getMarginValue(const QMargins &margins, QCP::MarginSide side) {
468  switch (side) {
469  case QCP::msLeft:
470  return margins.left();
471  case QCP::msRight:
472  return margins.right();
473  case QCP::msTop:
474  return margins.top();
475  case QCP::msBottom:
476  return margins.bottom();
477  default:
478  break;
479  }
480  return 0;
481 }
482 
483 extern const QMetaObject
484  staticMetaObject; // in moc-run we create a static meta object for QCP
485  // "fake" object. This line is the link to it via
486  // QCP::staticMetaObject in normal operation as namespace
487 
488 } // end of namespace QCP
489 Q_DECLARE_OPERATORS_FOR_FLAGS(QCP::AntialiasedElements)
490 Q_DECLARE_OPERATORS_FOR_FLAGS(QCP::PlottingHints)
491 Q_DECLARE_OPERATORS_FOR_FLAGS(QCP::MarginSides)
492 Q_DECLARE_OPERATORS_FOR_FLAGS(QCP::Interactions)
493 Q_DECLARE_METATYPE(QCP::ExportPen)
494 Q_DECLARE_METATYPE(QCP::ResolutionUnit)
495 Q_DECLARE_METATYPE(QCP::SignDomain)
496 Q_DECLARE_METATYPE(QCP::MarginSide)
497 Q_DECLARE_METATYPE(QCP::AntialiasedElement)
498 Q_DECLARE_METATYPE(QCP::PlottingHint)
499 Q_DECLARE_METATYPE(QCP::Interaction)
500 Q_DECLARE_METATYPE(QCP::SelectionRectMode)
501 Q_DECLARE_METATYPE(QCP::SelectionType)
502 
503 /* end of 'src/global.h' */
504 
505 /* including file 'src/vector2d.h', size 4928 */
506 /* commit ce344b3f96a62e5f652585e55f1ae7c7883cd45b 2018-06-25 01:03:39 +0200 */
507 
509  public:
511  QCPVector2D(double x, double y);
512  QCPVector2D(const QPoint &point);
513  QCPVector2D(const QPointF &point);
514 
515  // getters:
516  double x() const { return mX; }
517  double y() const { return mY; }
518  double &rx() { return mX; }
519  double &ry() { return mY; }
520 
521  // setters:
522  void setX(double x) { mX = x; }
523  void setY(double y) { mY = y; }
524 
525  // non-virtual methods:
526  double length() const { return qSqrt(mX * mX + mY * mY); }
527  double lengthSquared() const { return mX * mX + mY * mY; }
528  QPoint toPoint() const { return QPoint(mX, mY); }
529  QPointF toPointF() const { return QPointF(mX, mY); }
530 
531  bool isNull() const { return qIsNull(mX) && qIsNull(mY); }
532  void normalize();
534  QCPVector2D perpendicular() const { return QCPVector2D(-mY, mX); }
535  double dot(const QCPVector2D &vec) const { return mX * vec.mX + mY * vec.mY; }
536  double distanceSquaredToLine(const QCPVector2D &start,
537  const QCPVector2D &end) const;
538  double distanceSquaredToLine(const QLineF &line) const;
540  const QCPVector2D &direction) const;
541 
542  QCPVector2D &operator*=(double factor);
543  QCPVector2D &operator/=(double divisor);
546 
547  private:
548  // property members:
549  double mX, mY;
550 
551  friend inline const QCPVector2D operator*(double factor,
552  const QCPVector2D &vec);
553  friend inline const QCPVector2D operator*(const QCPVector2D &vec,
554  double factor);
555  friend inline const QCPVector2D operator/(const QCPVector2D &vec,
556  double divisor);
557  friend inline const QCPVector2D operator+(const QCPVector2D &vec1,
558  const QCPVector2D &vec2);
559  friend inline const QCPVector2D operator-(const QCPVector2D &vec1,
560  const QCPVector2D &vec2);
561  friend inline const QCPVector2D operator-(const QCPVector2D &vec);
562 };
564 
565 inline const QCPVector2D operator*(double factor, const QCPVector2D &vec) {
566  return QCPVector2D(vec.mX * factor, vec.mY * factor);
567 }
568 inline const QCPVector2D operator*(const QCPVector2D &vec, double factor) {
569  return QCPVector2D(vec.mX * factor, vec.mY * factor);
570 }
571 inline const QCPVector2D operator/(const QCPVector2D &vec, double divisor) {
572  return QCPVector2D(vec.mX / divisor, vec.mY / divisor);
573 }
574 inline const QCPVector2D operator+(const QCPVector2D &vec1,
575  const QCPVector2D &vec2) {
576  return QCPVector2D(vec1.mX + vec2.mX, vec1.mY + vec2.mY);
577 }
578 inline const QCPVector2D operator-(const QCPVector2D &vec1,
579  const QCPVector2D &vec2) {
580  return QCPVector2D(vec1.mX - vec2.mX, vec1.mY - vec2.mY);
581 }
582 inline const QCPVector2D operator-(const QCPVector2D &vec) {
583  return QCPVector2D(-vec.mX, -vec.mY);
584 }
585 
590 inline QDebug operator<<(QDebug d, const QCPVector2D &vec) {
591  d.nospace() << "QCPVector2D(" << vec.x() << ", " << vec.y() << ")";
592  return d.space();
593 }
594 
595 /* end of 'src/vector2d.h' */
596 
597 /* including file 'src/painter.h', size 4035 */
598 /* commit ce344b3f96a62e5f652585e55f1ae7c7883cd45b 2018-06-25 01:03:39 +0200 */
599 
600 class QCP_LIB_DECL QCPPainter : public QPainter {
601  Q_GADGET
602  public:
608  enum PainterMode {
609  pmDefault =
610  0x00
611  ,
612  pmVectorized =
613  0x01
615  ,
616  pmNoCaching = 0x02
619  ,
620  pmNonCosmetic =
621  0x04
624  };
625  Q_ENUMS(PainterMode)
626  Q_FLAGS(PainterModes)
627  Q_DECLARE_FLAGS(PainterModes, PainterMode)
628 
630  explicit QCPPainter(QPaintDevice *device);
631 
632  // getters:
633  bool antialiasing() const { return testRenderHint(QPainter::Antialiasing); }
634  PainterModes modes() const { return mModes; }
635 
636  // setters:
637  void setAntialiasing(bool enabled);
638  void setMode(PainterMode mode, bool enabled = true);
639  void setModes(PainterModes modes);
640 
641  // methods hiding non-virtual base class functions (QPainter bug workarounds):
642  bool begin(QPaintDevice *device);
643  void setPen(const QPen &pen);
644  void setPen(const QColor &color);
645  void setPen(Qt::PenStyle penStyle);
646  void drawLine(const QLineF &line);
647  void drawLine(const QPointF &p1, const QPointF &p2) {
648  drawLine(QLineF(p1, p2));
649  }
650  void save();
651  void restore();
652 
653  // non-virtual methods:
655 
656  protected:
657  // property members:
658  PainterModes mModes;
659  bool mIsAntialiasing;
660 
661  // non-property members:
662  QStack<bool> mAntialiasingStack;
663 };
664 Q_DECLARE_OPERATORS_FOR_FLAGS(QCPPainter::PainterModes)
665 Q_DECLARE_METATYPE(QCPPainter::PainterMode)
666 
667 /* end of 'src/painter.h' */
668 
669 /* including file 'src/paintbuffer.h', size 4958 */
670 /* commit ce344b3f96a62e5f652585e55f1ae7c7883cd45b 2018-06-25 01:03:39 +0200 */
671 
673  public:
674  explicit QCPAbstractPaintBuffer(const QSize &size, double devicePixelRatio);
676 
677  // getters:
678  QSize size() const { return mSize; }
679  bool invalidated() const { return mInvalidated; }
680  double devicePixelRatio() const { return mDevicePixelRatio; }
681 
682  // setters:
683  void setSize(const QSize &size);
684  void setInvalidated(bool invalidated = true);
685  void setDevicePixelRatio(double ratio);
686 
687  // introduced virtual methods:
688  virtual QCPPainter *startPainting() = 0;
689  virtual void donePainting() {}
690  virtual void draw(QCPPainter *painter) const = 0;
691  virtual void clear(const QColor &color) = 0;
692 
693  protected:
694  // property members:
695  QSize mSize;
697 
698  // non-property members:
700 
701  // introduced virtual methods:
702  virtual void reallocateBuffer() = 0;
703 };
704 
706  public:
707  explicit QCPPaintBufferPixmap(const QSize &size, double devicePixelRatio);
709 
710  // reimplemented virtual methods:
712  virtual void draw(QCPPainter *painter) const Q_DECL_OVERRIDE;
713  void clear(const QColor &color) Q_DECL_OVERRIDE;
714 
715  protected:
716  // non-property members:
717  QPixmap mBuffer;
718 
719  // reimplemented virtual methods:
720  virtual void reallocateBuffer() Q_DECL_OVERRIDE;
721 };
722 
723 #ifdef QCP_OPENGL_PBUFFER
724 class QCP_LIB_DECL QCPPaintBufferGlPbuffer : public QCPAbstractPaintBuffer {
725  public:
726  explicit QCPPaintBufferGlPbuffer(const QSize &size, double devicePixelRatio,
727  int multisamples);
728  virtual ~QCPPaintBufferGlPbuffer();
729 
730  // reimplemented virtual methods:
731  virtual QCPPainter *startPainting() Q_DECL_OVERRIDE;
732  virtual void draw(QCPPainter *painter) const Q_DECL_OVERRIDE;
733  void clear(const QColor &color) Q_DECL_OVERRIDE;
734 
735  protected:
736  // non-property members:
737  QGLPixelBuffer *mGlPBuffer;
738  int mMultisamples;
739 
740  // reimplemented virtual methods:
741  virtual void reallocateBuffer() Q_DECL_OVERRIDE;
742 };
743 #endif // QCP_OPENGL_PBUFFER
744 
745 #ifdef QCP_OPENGL_FBO
746 class QCP_LIB_DECL QCPPaintBufferGlFbo : public QCPAbstractPaintBuffer {
747  public:
748  explicit QCPPaintBufferGlFbo(const QSize &size, double devicePixelRatio,
749  QWeakPointer<QOpenGLContext> glContext,
750  QWeakPointer<QOpenGLPaintDevice> glPaintDevice);
751  virtual ~QCPPaintBufferGlFbo();
752 
753  // reimplemented virtual methods:
754  virtual QCPPainter *startPainting() Q_DECL_OVERRIDE;
755  virtual void donePainting() Q_DECL_OVERRIDE;
756  virtual void draw(QCPPainter *painter) const Q_DECL_OVERRIDE;
757  void clear(const QColor &color) Q_DECL_OVERRIDE;
758 
759  protected:
760  // non-property members:
761  QWeakPointer<QOpenGLContext> mGlContext;
762  QWeakPointer<QOpenGLPaintDevice> mGlPaintDevice;
763  QOpenGLFramebufferObject *mGlFrameBuffer;
764 
765  // reimplemented virtual methods:
766  virtual void reallocateBuffer() Q_DECL_OVERRIDE;
767 };
768 #endif // QCP_OPENGL_FBO
769 
770 /* end of 'src/paintbuffer.h' */
771 
772 /* including file 'src/layer.h', size 6885 */
773 /* commit ce344b3f96a62e5f652585e55f1ae7c7883cd45b 2018-06-25 01:03:39 +0200 */
774 
775 class QCP_LIB_DECL QCPLayer : public QObject {
776  Q_OBJECT
778  Q_PROPERTY(QCustomPlot *parentPlot READ parentPlot)
779  Q_PROPERTY(QString name READ name)
780  Q_PROPERTY(int index READ index)
781  Q_PROPERTY(QList<QCPLayerable *> children READ children)
782  Q_PROPERTY(bool visible READ visible WRITE setVisible)
783  Q_PROPERTY(LayerMode mode READ mode WRITE setMode)
785  public:
793  enum LayerMode {
794  lmLogical
796  ,
797  lmBuffered
799  };
800  Q_ENUMS(LayerMode)
801 
802  QCPLayer(QCustomPlot *parentPlot, const QString &layerName);
803  virtual ~QCPLayer();
804 
805  // getters:
806  QCustomPlot *parentPlot() const { return mParentPlot; }
807  QString name() const { return mName; }
808  int index() const { return mIndex; }
809  QList<QCPLayerable *> children() const { return mChildren; }
810  bool visible() const { return mVisible; }
811  LayerMode mode() const { return mMode; }
812 
813  // setters:
814  void setVisible(bool visible);
815  void setMode(LayerMode mode);
816 
817  // non-virtual methods:
818  void replot();
819 
820  protected:
821  // property members:
822  QCustomPlot *mParentPlot;
823  QString mName;
824  int mIndex;
825  QList<QCPLayerable *> mChildren;
826  bool mVisible;
828 
829  // non-property members:
830  QWeakPointer<QCPAbstractPaintBuffer> mPaintBuffer;
831 
832  // non-virtual methods:
833  void draw(QCPPainter *painter);
835  void addChild(QCPLayerable *layerable, bool prepend);
836  void removeChild(QCPLayerable *layerable);
837 
838  private:
839  Q_DISABLE_COPY(QCPLayer)
840 
841  friend class QCustomPlot;
842  friend class QCPLayerable;
843 };
844 Q_DECLARE_METATYPE(QCPLayer::LayerMode)
845 
846 class QCP_LIB_DECL QCPLayerable : public QObject {
847  Q_OBJECT
849  Q_PROPERTY(bool visible READ visible WRITE setVisible)
850  Q_PROPERTY(QCustomPlot *parentPlot READ parentPlot)
851  Q_PROPERTY(QCPLayerable *parentLayerable READ parentLayerable)
852  Q_PROPERTY(QCPLayer *layer READ layer WRITE setLayer NOTIFY layerChanged)
853  Q_PROPERTY(bool antialiased READ antialiased WRITE setAntialiased)
855  public:
856  QCPLayerable(QCustomPlot *plot, QString targetLayer = QString(),
857  QCPLayerable *parentLayerable = 0);
858  virtual ~QCPLayerable();
859 
860  // getters:
861  bool visible() const { return mVisible; }
862  QCustomPlot *parentPlot() const { return mParentPlot; }
863  QCPLayerable *parentLayerable() const { return mParentLayerable.data(); }
864  QCPLayer *layer() const { return mLayer; }
865  bool antialiased() const { return mAntialiased; }
866 
867  // setters:
868  void setVisible(bool on);
869  Q_SLOT bool setLayer(QCPLayer *layer);
870  bool setLayer(const QString &layerName);
871  void setAntialiased(bool enabled);
872 
873  // introduced virtual methods:
874  virtual double selectTest(const QPointF &pos, bool onlySelectable,
875  QVariant *details = 0) const;
876 
877  // non-property methods:
878  bool realVisibility() const;
879 
880  signals:
881  void layerChanged(QCPLayer *newLayer);
882 
883  protected:
884  // property members:
885  bool mVisible;
886  QCustomPlot *mParentPlot;
887  QPointer<QCPLayerable> mParentLayerable;
888  QCPLayer *mLayer;
889  bool mAntialiased;
890 
891  // introduced virtual methods:
892  virtual void parentPlotInitialized(QCustomPlot *parentPlot);
894  virtual QRect clipRect() const;
895  virtual void applyDefaultAntialiasingHint(QCPPainter *painter) const = 0;
896  virtual void draw(QCPPainter *painter) = 0;
897  // selection events:
898  virtual void selectEvent(QMouseEvent *event, bool additive,
899  const QVariant &details,
900  bool *selectionStateChanged);
901  virtual void deselectEvent(bool *selectionStateChanged);
902  // low-level mouse events:
903  virtual void mousePressEvent(QMouseEvent *event, const QVariant &details);
904  virtual void mouseMoveEvent(QMouseEvent *event, const QPointF &startPos);
905  virtual void mouseReleaseEvent(QMouseEvent *event, const QPointF &startPos);
906  virtual void mouseDoubleClickEvent(QMouseEvent *event,
907  const QVariant &details);
908  virtual void wheelEvent(QWheelEvent *event);
909 
910  // non-property methods:
912  void setParentLayerable(QCPLayerable *parentLayerable);
913  bool moveToLayer(QCPLayer *layer, bool prepend);
914  void applyAntialiasingHint(QCPPainter *painter, bool localAntialiased,
915  QCP::AntialiasedElement overrideElement) const;
916 
917  private:
918  Q_DISABLE_COPY(QCPLayerable)
919 
920  friend class QCustomPlot;
921  friend class QCPLayer;
922  friend class QCPAxisRect;
923 };
924 
925 /* end of 'src/layer.h' */
926 
927 /* including file 'src/axis/range.h', size 5280 */
928 /* commit ce344b3f96a62e5f652585e55f1ae7c7883cd45b 2018-06-25 01:03:39 +0200 */
929 
930 class QCP_LIB_DECL QCPRange {
931  public:
932  double lower, upper;
933 
935  QCPRange(double lower, double upper);
936 
937  bool operator==(const QCPRange &other) const {
938  return lower == other.lower && upper == other.upper;
939  }
940  bool operator!=(const QCPRange &other) const { return !(*this == other); }
941 
942  QCPRange &operator+=(const double &value) {
943  lower += value;
944  upper += value;
945  return *this;
946  }
947  QCPRange &operator-=(const double &value) {
948  lower -= value;
949  upper -= value;
950  return *this;
951  }
952  QCPRange &operator*=(const double &value) {
953  lower *= value;
954  upper *= value;
955  return *this;
956  }
957  QCPRange &operator/=(const double &value) {
958  lower /= value;
959  upper /= value;
960  return *this;
961  }
962  friend inline const QCPRange operator+(const QCPRange &, double);
963  friend inline const QCPRange operator+(double, const QCPRange &);
964  friend inline const QCPRange operator-(const QCPRange &range, double value);
965  friend inline const QCPRange operator*(const QCPRange &range, double value);
966  friend inline const QCPRange operator*(double value, const QCPRange &range);
967  friend inline const QCPRange operator/(const QCPRange &range, double value);
968 
969  double size() const { return upper - lower; }
970  double center() const { return (upper + lower) * 0.5; }
971  void normalize() {
972  if (lower > upper) qSwap(lower, upper);
973  }
974  void expand(const QCPRange &otherRange);
975  void expand(double includeCoord);
976  QCPRange expanded(const QCPRange &otherRange) const;
977  QCPRange expanded(double includeCoord) const;
978  QCPRange bounded(double lowerBound, double upperBound) const;
981  bool contains(double value) const { return value >= lower && value <= upper; }
982 
983  static bool validRange(double lower, double upper);
984  static bool validRange(const QCPRange &range);
985  static const double minRange;
986  static const double maxRange;
987 };
988 Q_DECLARE_TYPEINFO(QCPRange, Q_MOVABLE_TYPE);
989 
994 inline QDebug operator<<(QDebug d, const QCPRange &range) {
995  d.nospace() << "QCPRange(" << range.lower << ", " << range.upper << ")";
996  return d.space();
997 }
998 
1002 inline const QCPRange operator+(const QCPRange &range, double value) {
1003  QCPRange result(range);
1004  result += value;
1005  return result;
1006 }
1007 
1011 inline const QCPRange operator+(double value, const QCPRange &range) {
1012  QCPRange result(range);
1013  result += value;
1014  return result;
1015 }
1016 
1020 inline const QCPRange operator-(const QCPRange &range, double value) {
1021  QCPRange result(range);
1022  result -= value;
1023  return result;
1024 }
1025 
1029 inline const QCPRange operator*(const QCPRange &range, double value) {
1030  QCPRange result(range);
1031  result *= value;
1032  return result;
1033 }
1034 
1038 inline const QCPRange operator*(double value, const QCPRange &range) {
1039  QCPRange result(range);
1040  result *= value;
1041  return result;
1042 }
1043 
1047 inline const QCPRange operator/(const QCPRange &range, double value) {
1048  QCPRange result(range);
1049  result /= value;
1050  return result;
1051 }
1052 
1053 /* end of 'src/axis/range.h' */
1054 
1055 /* including file 'src/selection.h', size 8569 */
1056 /* commit ce344b3f96a62e5f652585e55f1ae7c7883cd45b 2018-06-25 01:03:39 +0200 */
1057 
1059  public:
1061  QCPDataRange(int begin, int end);
1062 
1063  bool operator==(const QCPDataRange &other) const {
1064  return mBegin == other.mBegin && mEnd == other.mEnd;
1065  }
1066  bool operator!=(const QCPDataRange &other) const { return !(*this == other); }
1067 
1068  // getters:
1069  int begin() const { return mBegin; }
1070  int end() const { return mEnd; }
1071  int size() const { return mEnd - mBegin; }
1072  int length() const { return size(); }
1073 
1074  // setters:
1075  void setBegin(int begin) { mBegin = begin; }
1076  void setEnd(int end) { mEnd = end; }
1077 
1078  // non-property methods:
1079  bool isValid() const { return (mEnd >= mBegin) && (mBegin >= 0); }
1080  bool isEmpty() const { return length() == 0; }
1081  QCPDataRange bounded(const QCPDataRange &other) const;
1082  QCPDataRange expanded(const QCPDataRange &other) const;
1084  QCPDataRange adjusted(int changeBegin, int changeEnd) const {
1085  return QCPDataRange(mBegin + changeBegin, mEnd + changeEnd);
1086  }
1087  bool intersects(const QCPDataRange &other) const;
1088  bool contains(const QCPDataRange &other) const;
1089 
1090  private:
1091  // property members:
1092  int mBegin, mEnd;
1093 };
1095 
1097  public:
1098  explicit QCPDataSelection();
1099  explicit QCPDataSelection(const QCPDataRange &range);
1100 
1101  bool operator==(const QCPDataSelection &other) const;
1102  bool operator!=(const QCPDataSelection &other) const {
1103  return !(*this == other);
1104  }
1109  friend inline const QCPDataSelection operator+(const QCPDataSelection &a,
1110  const QCPDataSelection &b);
1111  friend inline const QCPDataSelection operator+(const QCPDataRange &a,
1112  const QCPDataSelection &b);
1113  friend inline const QCPDataSelection operator+(const QCPDataSelection &a,
1114  const QCPDataRange &b);
1115  friend inline const QCPDataSelection operator+(const QCPDataRange &a,
1116  const QCPDataRange &b);
1117  friend inline const QCPDataSelection operator-(const QCPDataSelection &a,
1118  const QCPDataSelection &b);
1119  friend inline const QCPDataSelection operator-(const QCPDataRange &a,
1120  const QCPDataSelection &b);
1121  friend inline const QCPDataSelection operator-(const QCPDataSelection &a,
1122  const QCPDataRange &b);
1123  friend inline const QCPDataSelection operator-(const QCPDataRange &a,
1124  const QCPDataRange &b);
1125 
1126  // getters:
1127  int dataRangeCount() const { return mDataRanges.size(); }
1128  int dataPointCount() const;
1129  QCPDataRange dataRange(int index = 0) const;
1130  QList<QCPDataRange> dataRanges() const { return mDataRanges; }
1132 
1133  // non-property methods:
1134  void addDataRange(const QCPDataRange &dataRange, bool simplify = true);
1135  void clear();
1136  bool isEmpty() const { return mDataRanges.isEmpty(); }
1137  void simplify();
1139  bool contains(const QCPDataSelection &other) const;
1142  QCPDataSelection inverse(const QCPDataRange &outerRange) const;
1143 
1144  private:
1145  // property members:
1146  QList<QCPDataRange> mDataRanges;
1147 
1148  inline static bool lessThanDataRangeBegin(const QCPDataRange &a,
1149  const QCPDataRange &b) {
1150  return a.begin() < b.begin();
1151  }
1152 };
1153 Q_DECLARE_METATYPE(QCPDataSelection)
1154 
1155 
1160 inline const QCPDataSelection operator+(const QCPDataSelection &a,
1161  const QCPDataSelection &b) {
1162  QCPDataSelection result(a);
1163  result += b;
1164  return result;
1165 }
1166 
1173  const QCPDataSelection &b) {
1174  QCPDataSelection result(a);
1175  result += b;
1176  return result;
1177 }
1178 
1185  const QCPDataRange &b) {
1186  QCPDataSelection result(a);
1187  result += b;
1188  return result;
1189 }
1190 
1197  const QCPDataRange &b) {
1198  QCPDataSelection result(a);
1199  result += b;
1200  return result;
1201 }
1202 
1208  const QCPDataSelection &b) {
1209  QCPDataSelection result(a);
1210  result -= b;
1211  return result;
1212 }
1213 
1219  const QCPDataSelection &b) {
1220  QCPDataSelection result(a);
1221  result -= b;
1222  return result;
1223 }
1224 
1230  const QCPDataRange &b) {
1231  QCPDataSelection result(a);
1232  result -= b;
1233  return result;
1234 }
1235 
1241  const QCPDataRange &b) {
1242  QCPDataSelection result(a);
1243  result -= b;
1244  return result;
1245 }
1246 
1251 inline QDebug operator<<(QDebug d, const QCPDataRange &dataRange) {
1252  d.nospace() << "QCPDataRange(" << dataRange.begin() << ", " << dataRange.end()
1253  << ")";
1254  return d;
1255 }
1256 
1261 inline QDebug operator<<(QDebug d, const QCPDataSelection &selection) {
1262  d.nospace() << "QCPDataSelection(";
1263  for (int i = 0; i < selection.dataRangeCount(); ++i) {
1264  if (i != 0) d << ", ";
1265  d << selection.dataRange(i);
1266  }
1267  d << ")";
1268  return d;
1269 }
1270 
1271 /* end of 'src/selection.h' */
1272 
1273 /* including file 'src/selectionrect.h', size 3338 */
1274 /* commit ce344b3f96a62e5f652585e55f1ae7c7883cd45b 2018-06-25 01:03:39 +0200 */
1275 
1277  Q_OBJECT
1278  public:
1279  explicit QCPSelectionRect(QCustomPlot *parentPlot);
1281 
1282  // getters:
1283  QRect rect() const { return mRect; }
1284  QCPRange range(const QCPAxis *axis) const;
1285  QPen pen() const { return mPen; }
1286  QBrush brush() const { return mBrush; }
1287  bool isActive() const { return mActive; }
1288 
1289  // setters:
1290  void setPen(const QPen &pen);
1291  void setBrush(const QBrush &brush);
1292 
1293  // non-property methods:
1294  Q_SLOT void cancel();
1295 
1296  signals:
1297  void started(QMouseEvent *event);
1298  void changed(const QRect &rect, QMouseEvent *event);
1299  void canceled(const QRect &rect, QInputEvent *event);
1300  void accepted(const QRect &rect, QMouseEvent *event);
1301 
1302  protected:
1303  // property members:
1304  QRect mRect;
1305  QPen mPen;
1306  QBrush mBrush;
1307  // non-property members:
1308  bool mActive;
1309 
1310  // introduced virtual methods:
1311  virtual void startSelection(QMouseEvent *event);
1312  virtual void moveSelection(QMouseEvent *event);
1313  virtual void endSelection(QMouseEvent *event);
1314  virtual void keyPressEvent(QKeyEvent *event);
1315 
1316  // reimplemented virtual methods
1317  virtual void applyDefaultAntialiasingHint(QCPPainter *painter) const
1319  virtual void draw(QCPPainter *painter) Q_DECL_OVERRIDE;
1320 
1321  friend class QCustomPlot;
1322 };
1323 
1324 /* end of 'src/selectionrect.h' */
1325 
1326 /* including file 'src/layout.h', size 14224 */
1327 /* commit ce344b3f96a62e5f652585e55f1ae7c7883cd45b 2018-06-25 01:03:39 +0200 */
1328 
1329 class QCP_LIB_DECL QCPMarginGroup : public QObject {
1330  Q_OBJECT
1331  public:
1332  explicit QCPMarginGroup(QCustomPlot *parentPlot);
1333  virtual ~QCPMarginGroup();
1334 
1335  // non-virtual methods:
1336  QList<QCPLayoutElement *> elements(QCP::MarginSide side) const {
1337  return mChildren.value(side);
1338  }
1339  bool isEmpty() const;
1340  void clear();
1341 
1342  protected:
1343  // non-property members:
1344  QCustomPlot *mParentPlot;
1345  QHash<QCP::MarginSide, QList<QCPLayoutElement *> > mChildren;
1346 
1347  // introduced virtual methods:
1348  virtual int commonMargin(QCP::MarginSide side) const;
1349 
1350  // non-virtual methods:
1353 
1354  private:
1355  Q_DISABLE_COPY(QCPMarginGroup)
1356 
1357  friend class QCPLayoutElement;
1358 };
1359 
1361  Q_OBJECT
1363  Q_PROPERTY(QCPLayout *layout READ layout)
1364  Q_PROPERTY(QRect rect READ rect)
1365  Q_PROPERTY(QRect outerRect READ outerRect WRITE setOuterRect)
1366  Q_PROPERTY(QMargins margins READ margins WRITE setMargins)
1367  Q_PROPERTY(
1368  QMargins minimumMargins READ minimumMargins WRITE setMinimumMargins)
1369  Q_PROPERTY(QSize minimumSize READ minimumSize WRITE setMinimumSize)
1370  Q_PROPERTY(QSize maximumSize READ maximumSize WRITE setMaximumSize)
1371  Q_PROPERTY(SizeConstraintRect sizeConstraintRect READ sizeConstraintRect WRITE
1372  setSizeConstraintRect)
1374  public:
1380  upPreparation
1382  ,
1383  upMargins
1384  ,
1385  upLayout
1387  };
1388  Q_ENUMS(UpdatePhase)
1389 
1390 
1399  scrInnerRect
1400  ,
1401  scrOuterRect
1403  };
1404  Q_ENUMS(SizeConstraintRect)
1405 
1406  explicit QCPLayoutElement(QCustomPlot *parentPlot = 0);
1407  virtual ~QCPLayoutElement();
1408 
1409  // getters:
1410  QCPLayout *layout() const { return mParentLayout; }
1411  QRect rect() const { return mRect; }
1412  QRect outerRect() const { return mOuterRect; }
1413  QMargins margins() const { return mMargins; }
1414  QMargins minimumMargins() const { return mMinimumMargins; }
1415  QCP::MarginSides autoMargins() const { return mAutoMargins; }
1416  QSize minimumSize() const { return mMinimumSize; }
1417  QSize maximumSize() const { return mMaximumSize; }
1418  SizeConstraintRect sizeConstraintRect() const { return mSizeConstraintRect; }
1420  return mMarginGroups.value(side, (QCPMarginGroup *)0);
1421  }
1422  QHash<QCP::MarginSide, QCPMarginGroup *> marginGroups() const {
1423  return mMarginGroups;
1424  }
1425 
1426  // setters:
1427  void setOuterRect(const QRect &rect);
1428  void setMargins(const QMargins &margins);
1429  void setMinimumMargins(const QMargins &margins);
1430  void setAutoMargins(QCP::MarginSides sides);
1431  void setMinimumSize(const QSize &size);
1432  void setMinimumSize(int width, int height);
1433  void setMaximumSize(const QSize &size);
1434  void setMaximumSize(int width, int height);
1436  void setMarginGroup(QCP::MarginSides sides, QCPMarginGroup *group);
1437 
1438  // introduced virtual methods:
1439  virtual void update(UpdatePhase phase);
1440  virtual QSize minimumOuterSizeHint() const;
1441  virtual QSize maximumOuterSizeHint() const;
1442  virtual QList<QCPLayoutElement *> elements(bool recursive) const;
1443 
1444  // reimplemented virtual methods:
1445  virtual double selectTest(const QPointF &pos, bool onlySelectable,
1446  QVariant *details = 0) const Q_DECL_OVERRIDE;
1447 
1448  protected:
1449  // property members:
1450  QCPLayout *mParentLayout;
1451  QSize mMinimumSize, mMaximumSize;
1452  SizeConstraintRect mSizeConstraintRect;
1453  QRect mRect, mOuterRect;
1454  QMargins mMargins, mMinimumMargins;
1455  QCP::MarginSides mAutoMargins;
1456  QHash<QCP::MarginSide, QCPMarginGroup *> mMarginGroups;
1457 
1458  // introduced virtual methods:
1459  virtual int calculateAutoMargin(QCP::MarginSide side);
1460  virtual void layoutChanged();
1461 
1462  // reimplemented virtual methods:
1463  virtual void applyDefaultAntialiasingHint(QCPPainter *painter) const
1464  Q_DECL_OVERRIDE {
1465  Q_UNUSED(painter)
1466  }
1467  virtual void draw(QCPPainter *painter) Q_DECL_OVERRIDE { Q_UNUSED(painter) }
1469 
1470  private:
1471  Q_DISABLE_COPY(QCPLayoutElement)
1472 
1473  friend class QCustomPlot;
1474  friend class QCPLayout;
1475  friend class QCPMarginGroup;
1476 };
1477 Q_DECLARE_METATYPE(QCPLayoutElement::UpdatePhase)
1478 
1479 class QCP_LIB_DECL QCPLayout : public QCPLayoutElement {
1480  Q_OBJECT
1481  public:
1482  explicit QCPLayout();
1483 
1484  // reimplemented virtual methods:
1485  virtual void update(UpdatePhase phase) Q_DECL_OVERRIDE;
1486  virtual QList<QCPLayoutElement *> elements(bool recursive) const
1488 
1489  // introduced virtual methods:
1490  virtual int elementCount() const = 0;
1491  virtual QCPLayoutElement *elementAt(int index) const = 0;
1492  virtual QCPLayoutElement *takeAt(int index) = 0;
1493  virtual bool take(QCPLayoutElement *element) = 0;
1494  virtual void simplify();
1495 
1496  // non-virtual methods:
1497  bool removeAt(int index);
1498  bool remove(QCPLayoutElement *element);
1499  void clear();
1500 
1501  protected:
1502  // introduced virtual methods:
1503  virtual void updateLayout();
1504 
1505  // non-virtual methods:
1509  QVector<int> getSectionSizes(QVector<int> maxSizes, QVector<int> minSizes,
1510  QVector<double> stretchFactors,
1511  int totalSize) const;
1514 
1515  private:
1516  Q_DISABLE_COPY(QCPLayout)
1517  friend class QCPLayoutElement;
1518 };
1519 
1520 class QCP_LIB_DECL QCPLayoutGrid : public QCPLayout {
1521  Q_OBJECT
1523  Q_PROPERTY(int rowCount READ rowCount)
1524  Q_PROPERTY(int columnCount READ columnCount)
1525  Q_PROPERTY(QList<double> columnStretchFactors READ columnStretchFactors WRITE
1526  setColumnStretchFactors)
1527  Q_PROPERTY(QList<double> rowStretchFactors READ rowStretchFactors WRITE
1528  setRowStretchFactors)
1529  Q_PROPERTY(int columnSpacing READ columnSpacing WRITE setColumnSpacing)
1530  Q_PROPERTY(int rowSpacing READ rowSpacing WRITE setRowSpacing)
1531  Q_PROPERTY(FillOrder fillOrder READ fillOrder WRITE setFillOrder)
1532  Q_PROPERTY(int wrap READ wrap WRITE setWrap)
1534  public:
1542  enum FillOrder {
1543  foRowsFirst
1545  ,
1546  foColumnsFirst
1549  };
1550  Q_ENUMS(FillOrder)
1551 
1552  explicit QCPLayoutGrid();
1553  virtual ~QCPLayoutGrid();
1554 
1555  // getters:
1556  int rowCount() const { return mElements.size(); }
1557  int columnCount() const {
1558  return mElements.size() > 0 ? mElements.first().size() : 0;
1559  }
1560  QList<double> columnStretchFactors() const { return mColumnStretchFactors; }
1561  QList<double> rowStretchFactors() const { return mRowStretchFactors; }
1562  int columnSpacing() const { return mColumnSpacing; }
1563  int rowSpacing() const { return mRowSpacing; }
1564  int wrap() const { return mWrap; }
1565  FillOrder fillOrder() const { return mFillOrder; }
1566 
1567  // setters:
1568  void setColumnStretchFactor(int column, double factor);
1569  void setColumnStretchFactors(const QList<double> &factors);
1570  void setRowStretchFactor(int row, double factor);
1571  void setRowStretchFactors(const QList<double> &factors);
1572  void setColumnSpacing(int pixels);
1573  void setRowSpacing(int pixels);
1574  void setWrap(int count);
1575  void setFillOrder(FillOrder order, bool rearrange = true);
1576 
1577  // reimplemented virtual methods:
1579  virtual int elementCount() const Q_DECL_OVERRIDE {
1580  return rowCount() * columnCount();
1581  }
1582  virtual QCPLayoutElement *elementAt(int index) const Q_DECL_OVERRIDE;
1584  virtual bool take(QCPLayoutElement *element) Q_DECL_OVERRIDE;
1585  virtual QList<QCPLayoutElement *> elements(bool recursive) const
1587  virtual void simplify() Q_DECL_OVERRIDE;
1588  virtual QSize minimumOuterSizeHint() const Q_DECL_OVERRIDE;
1589  virtual QSize maximumOuterSizeHint() const Q_DECL_OVERRIDE;
1590 
1591  // non-virtual methods:
1592  QCPLayoutElement *element(int row, int column) const;
1593  bool addElement(int row, int column, QCPLayoutElement *element);
1594  bool addElement(QCPLayoutElement *element);
1595  bool hasElement(int row, int column);
1596  void expandTo(int newRowCount, int newColumnCount);
1597  void insertRow(int newIndex);
1598  void insertColumn(int newIndex);
1599  int rowColToIndex(int row, int column) const;
1600  void indexToRowCol(int index, int &row, int &column) const;
1601 
1602  protected:
1603  // property members:
1604  QList<QList<QCPLayoutElement *> > mElements;
1605  QList<double> mColumnStretchFactors;
1606  QList<double> mRowStretchFactors;
1607  int mColumnSpacing, mRowSpacing;
1608  int mWrap;
1609  FillOrder mFillOrder;
1610 
1611  // non-virtual methods:
1612  void getMinimumRowColSizes(QVector<int> *minColWidths,
1613  QVector<int> *minRowHeights) const;
1614  void getMaximumRowColSizes(QVector<int> *maxColWidths,
1615  QVector<int> *maxRowHeights) const;
1616 
1617  private:
1618  Q_DISABLE_COPY(QCPLayoutGrid)
1619 };
1620 Q_DECLARE_METATYPE(QCPLayoutGrid::FillOrder)
1621 
1622 class QCP_LIB_DECL QCPLayoutInset : public QCPLayout {
1623  Q_OBJECT
1624  public:
1630  ipFree
1632  ,
1633  ipBorderAligned
1635  };
1636  Q_ENUMS(InsetPlacement)
1637 
1638  explicit QCPLayoutInset();
1639  virtual ~QCPLayoutInset();
1640 
1641  // getters:
1642  InsetPlacement insetPlacement(int index) const;
1643  Qt::Alignment insetAlignment(int index) const;
1644  QRectF insetRect(int index) const;
1645 
1646  // setters:
1647  void setInsetPlacement(int index, InsetPlacement placement);
1648  void setInsetAlignment(int index, Qt::Alignment alignment);
1649  void setInsetRect(int index, const QRectF &rect);
1650 
1651  // reimplemented virtual methods:
1652  virtual void updateLayout() Q_DECL_OVERRIDE;
1653  virtual int elementCount() const Q_DECL_OVERRIDE;
1654  virtual QCPLayoutElement *elementAt(int index) const Q_DECL_OVERRIDE;
1655  virtual QCPLayoutElement *takeAt(int index) Q_DECL_OVERRIDE;
1656  virtual bool take(QCPLayoutElement *element) Q_DECL_OVERRIDE;
1657  virtual void simplify() Q_DECL_OVERRIDE {}
1658  virtual double selectTest(const QPointF &pos, bool onlySelectable,
1659  QVariant *details = 0) const Q_DECL_OVERRIDE;
1660 
1661  // non-virtual methods:
1662  void addElement(QCPLayoutElement *element, Qt::Alignment alignment);
1663  void addElement(QCPLayoutElement *element, const QRectF &rect);
1664 
1665  protected:
1666  // property members:
1667  QList<QCPLayoutElement *> mElements;
1668  QList<InsetPlacement> mInsetPlacement;
1669  QList<Qt::Alignment> mInsetAlignment;
1670  QList<QRectF> mInsetRect;
1671 
1672  private:
1673  Q_DISABLE_COPY(QCPLayoutInset)
1674 };
1675 Q_DECLARE_METATYPE(QCPLayoutInset::InsetPlacement)
1676 
1677 /* end of 'src/layout.h' */
1678 
1679 /* including file 'src/lineending.h', size 4426 */
1680 /* commit ce344b3f96a62e5f652585e55f1ae7c7883cd45b 2018-06-25 01:03:39 +0200 */
1681 
1683  Q_GADGET
1684  public:
1699  esNone
1700  ,
1701  esFlatArrow
1702  ,
1703  esSpikeArrow
1704  ,
1705  esLineArrow
1706  ,
1707  esDisc
1708  ,
1709  esSquare
1710  ,
1711  esDiamond
1712  ,
1713  esBar
1714  ,
1715  esHalfBar
1717  ,
1718  esSkewedBar
1720  };
1721  Q_ENUMS(EndingStyle)
1722 
1724  QCPLineEnding(EndingStyle style, double width = 8, double length = 10,
1725  bool inverted = false);
1726 
1727  // getters:
1728  EndingStyle style() const { return mStyle; }
1729  double width() const { return mWidth; }
1730  double length() const { return mLength; }
1731  bool inverted() const { return mInverted; }
1732 
1733  // setters:
1734  void setStyle(EndingStyle style);
1735  void setWidth(double width);
1736  void setLength(double length);
1737  void setInverted(bool inverted);
1738 
1739  // non-property methods:
1740  double boundingDistance() const;
1741  double realLength() const;
1742  void draw(QCPPainter *painter, const QCPVector2D &pos,
1743  const QCPVector2D &dir) const;
1744  void draw(QCPPainter *painter, const QCPVector2D &pos, double angle) const;
1745 
1746  protected:
1747  // property members:
1748  EndingStyle mStyle;
1749  double mWidth, mLength;
1750  bool mInverted;
1751 };
1753 Q_DECLARE_METATYPE(QCPLineEnding::EndingStyle)
1754 
1755 /* end of 'src/lineending.h' */
1756 
1757 /* including file 'src/axis/axisticker.h', size 4224 */
1758 /* commit ce344b3f96a62e5f652585e55f1ae7c7883cd45b 2018-06-25 01:03:39 +0200 */
1759 
1761  Q_GADGET
1762  public:
1770  tssReadability
1773  ,
1774  tssMeetTickCount
1777  };
1778  Q_ENUMS(TickStepStrategy)
1779 
1781  virtual ~QCPAxisTicker();
1782 
1783  // getters:
1784  TickStepStrategy tickStepStrategy() const { return mTickStepStrategy; }
1785  int tickCount() const { return mTickCount; }
1786  double tickOrigin() const { return mTickOrigin; }
1787 
1788  // setters:
1790  void setTickCount(int count);
1791  void setTickOrigin(double origin);
1792 
1793  // introduced virtual methods:
1794  virtual void generate(const QCPRange &range, const QLocale &locale,
1795  QChar formatChar, int precision, QVector<double> &ticks,
1796  QVector<double> *subTicks,
1797  QVector<QString> *tickLabels);
1798 
1799  protected:
1800  // property members:
1803  double mTickOrigin;
1804 
1805  // introduced virtual methods:
1806  virtual double getTickStep(const QCPRange &range);
1807  virtual int getSubTickCount(double tickStep);
1808  virtual QString getTickLabel(double tick, const QLocale &locale,
1809  QChar formatChar, int precision);
1810  virtual QVector<double> createTickVector(double tickStep,
1811  const QCPRange &range);
1812  virtual QVector<double> createSubTickVector(int subTickCount,
1813  const QVector<double> &ticks);
1814  virtual QVector<QString> createLabelVector(const QVector<double> &ticks,
1815  const QLocale &locale,
1816  QChar formatChar, int precision);
1817 
1818  // non-virtual methods:
1819  void trimTicks(const QCPRange &range, QVector<double> &ticks,
1820  bool keepOneOutlier) const;
1821  double pickClosest(double target, const QVector<double> &candidates) const;
1822  double getMantissa(double input, double *magnitude = 0) const;
1823  double cleanMantissa(double input) const;
1824 
1825  private:
1826  Q_DISABLE_COPY(QCPAxisTicker)
1827 };
1828 Q_DECLARE_METATYPE(QCPAxisTicker::TickStepStrategy)
1829 Q_DECLARE_METATYPE(QSharedPointer<QCPAxisTicker>)
1830 
1831 /* end of 'src/axis/axisticker.h' */
1832 
1833 /* including file 'src/axis/axistickerdatetime.h', size 3289 */
1834 /* commit ce344b3f96a62e5f652585e55f1ae7c7883cd45b 2018-06-25 01:03:39 +0200 */
1835 
1837  public:
1839 
1840  // getters:
1841  QString dateTimeFormat() const { return mDateTimeFormat; }
1842  Qt::TimeSpec dateTimeSpec() const { return mDateTimeSpec; }
1843 
1844  // setters:
1845  void setDateTimeFormat(const QString &format);
1846  void setDateTimeSpec(Qt::TimeSpec spec);
1848  double origin); // hides base class method but calls baseclass
1849  // implementation ("using" throws off IDEs and doxygen)
1850  void setTickOrigin(const QDateTime &origin);
1851 
1852  // static methods:
1853  static QDateTime keyToDateTime(double key);
1854  static double dateTimeToKey(const QDateTime dateTime);
1855  static double dateTimeToKey(const QDate date);
1856 
1857  protected:
1858  // property members:
1860  Qt::TimeSpec mDateTimeSpec;
1861 
1862  // non-property members:
1866  dsUniformDayInMonth
1867  } mDateStrategy;
1868 
1869  // reimplemented virtual methods:
1870  virtual double getTickStep(const QCPRange &range) Q_DECL_OVERRIDE;
1871  virtual int getSubTickCount(double tickStep) Q_DECL_OVERRIDE;
1872  virtual QString getTickLabel(double tick, const QLocale &locale,
1873  QChar formatChar, int precision) Q_DECL_OVERRIDE;
1874  virtual QVector<double> createTickVector(
1875  double tickStep, const QCPRange &range) Q_DECL_OVERRIDE;
1876 };
1877 
1878 /* end of 'src/axis/axistickerdatetime.h' */
1879 
1880 /* including file 'src/axis/axistickertime.h', size 3542 */
1881 /* commit ce344b3f96a62e5f652585e55f1ae7c7883cd45b 2018-06-25 01:03:39 +0200 */
1882 
1884  Q_GADGET
1885  public:
1891  enum TimeUnit {
1892  tuMilliseconds
1894  ,
1895  tuSeconds
1896  ,
1897  tuMinutes
1898  ,
1899  tuHours
1900  ,
1901  tuDays
1902  };
1903  Q_ENUMS(TimeUnit)
1904 
1906 
1907  // getters:
1908  QString timeFormat() const { return mTimeFormat; }
1909  int fieldWidth(TimeUnit unit) const { return mFieldWidth.value(unit); }
1910 
1911  // setters:
1912  void setTimeFormat(const QString &format);
1913  void setFieldWidth(TimeUnit unit, int width);
1914 
1915  protected:
1916  // property members:
1917  QString mTimeFormat;
1918  QHash<TimeUnit, int> mFieldWidth;
1919 
1920  // non-property members:
1921  TimeUnit mSmallestUnit, mBiggestUnit;
1922  QHash<TimeUnit, QString> mFormatPattern;
1923 
1924  // reimplemented virtual methods:
1925  virtual double getTickStep(const QCPRange &range) Q_DECL_OVERRIDE;
1926  virtual int getSubTickCount(double tickStep) Q_DECL_OVERRIDE;
1927  virtual QString getTickLabel(double tick, const QLocale &locale,
1928  QChar formatChar, int precision) Q_DECL_OVERRIDE;
1929 
1930  // non-virtual methods:
1931  void replaceUnit(QString &text, TimeUnit unit, int value) const;
1932 };
1933 Q_DECLARE_METATYPE(QCPAxisTickerTime::TimeUnit)
1934 
1935 /* end of 'src/axis/axistickertime.h' */
1936 
1937 /* including file 'src/axis/axistickerfixed.h', size 3308 */
1938 /* commit ce344b3f96a62e5f652585e55f1ae7c7883cd45b 2018-06-25 01:03:39 +0200 */
1939 
1941  Q_GADGET
1942  public:
1950  ssNone
1953  ,
1954  ssMultiples
1957  ,
1958  ssPowers
1959  };
1960  Q_ENUMS(ScaleStrategy)
1961 
1963 
1964  // getters:
1965  double tickStep() const { return mTickStep; }
1966  ScaleStrategy scaleStrategy() const { return mScaleStrategy; }
1967 
1968  // setters:
1969  void setTickStep(double step);
1971 
1972  protected:
1973  // property members:
1974  double mTickStep;
1976 
1977  // reimplemented virtual methods:
1978  virtual double getTickStep(const QCPRange &range) Q_DECL_OVERRIDE;
1979 };
1980 Q_DECLARE_METATYPE(QCPAxisTickerFixed::ScaleStrategy)
1981 
1982 /* end of 'src/axis/axistickerfixed.h' */
1983 
1984 /* including file 'src/axis/axistickertext.h', size 3090 */
1985 /* commit ce344b3f96a62e5f652585e55f1ae7c7883cd45b 2018-06-25 01:03:39 +0200 */
1986 
1988  public:
1990 
1991  // getters:
1992  QMap<double, QString> &ticks() { return mTicks; }
1993  int subTickCount() const { return mSubTickCount; }
1994 
1995  // setters:
1996  void setTicks(const QMap<double, QString> &ticks);
1997  void setTicks(const QVector<double> &positions,
1998  const QVector<QString> &labels);
1999  void setSubTickCount(int subTicks);
2000 
2001  // non-virtual methods:
2002  void clear();
2003  void addTick(double position, const QString &label);
2004  void addTicks(const QMap<double, QString> &ticks);
2005  void addTicks(const QVector<double> &positions,
2006  const QVector<QString> &labels);
2007 
2008  protected:
2009  // property members:
2010  QMap<double, QString> mTicks;
2012 
2013  // reimplemented virtual methods:
2014  virtual double getTickStep(const QCPRange &range) Q_DECL_OVERRIDE;
2015  virtual int getSubTickCount(double tickStep) Q_DECL_OVERRIDE;
2016  virtual QString getTickLabel(double tick, const QLocale &locale,
2017  QChar formatChar, int precision) Q_DECL_OVERRIDE;
2018  virtual QVector<double> createTickVector(
2019  double tickStep, const QCPRange &range) Q_DECL_OVERRIDE;
2020 };
2021 
2022 /* end of 'src/axis/axistickertext.h' */
2023 
2024 /* including file 'src/axis/axistickerpi.h', size 3911 */
2025 /* commit ce344b3f96a62e5f652585e55f1ae7c7883cd45b 2018-06-25 01:03:39 +0200 */
2026 
2028  Q_GADGET
2029  public:
2036  fsFloatingPoint
2038  ,
2039  fsAsciiFractions
2041  ,
2042  fsUnicodeFractions
2044  };
2045  Q_ENUMS(FractionStyle)
2046 
2048 
2049  // getters:
2050  QString piSymbol() const { return mPiSymbol; }
2051  double piValue() const { return mPiValue; }
2052  bool periodicity() const { return mPeriodicity; }
2053  FractionStyle fractionStyle() const { return mFractionStyle; }
2054 
2055  // setters:
2056  void setPiSymbol(QString symbol);
2057  void setPiValue(double pi);
2058  void setPeriodicity(int multiplesOfPi);
2060 
2061  protected:
2062  // property members:
2063  QString mPiSymbol;
2064  double mPiValue;
2067 
2068  // non-property members:
2069  double mPiTickStep; // size of one tick step in units of mPiValue
2070 
2071  // reimplemented virtual methods:
2072  virtual double getTickStep(const QCPRange &range) Q_DECL_OVERRIDE;
2073  virtual int getSubTickCount(double tickStep) Q_DECL_OVERRIDE;
2074  virtual QString getTickLabel(double tick, const QLocale &locale,
2075  QChar formatChar, int precision) Q_DECL_OVERRIDE;
2076 
2077  // non-virtual methods:
2078  void simplifyFraction(int &numerator, int &denominator) const;
2079  QString fractionToString(int numerator, int denominator) const;
2080  QString unicodeFraction(int numerator, int denominator) const;
2081  QString unicodeSuperscript(int number) const;
2082  QString unicodeSubscript(int number) const;
2083 };
2084 Q_DECLARE_METATYPE(QCPAxisTickerPi::FractionStyle)
2085 
2086 /* end of 'src/axis/axistickerpi.h' */
2087 
2088 /* including file 'src/axis/axistickerlog.h', size 2663 */
2089 /* commit ce344b3f96a62e5f652585e55f1ae7c7883cd45b 2018-06-25 01:03:39 +0200 */
2090 
2092  public:
2094 
2095  // getters:
2096  double logBase() const { return mLogBase; }
2097  int subTickCount() const { return mSubTickCount; }
2098 
2099  // setters:
2100  void setLogBase(double base);
2101  void setSubTickCount(int subTicks);
2102 
2103  protected:
2104  // property members:
2105  double mLogBase;
2107 
2108  // non-property members:
2110 
2111  // reimplemented virtual methods:
2112  virtual double getTickStep(const QCPRange &range) Q_DECL_OVERRIDE;
2113  virtual int getSubTickCount(double tickStep) Q_DECL_OVERRIDE;
2114  virtual QVector<double> createTickVector(
2115  double tickStep, const QCPRange &range) Q_DECL_OVERRIDE;
2116 };
2117 
2118 /* end of 'src/axis/axistickerlog.h' */
2119 
2120 /* including file 'src/axis/axis.h', size 20698 */
2121 /* commit ce344b3f96a62e5f652585e55f1ae7c7883cd45b 2018-06-25 01:03:39 +0200 */
2122 
2123 class QCP_LIB_DECL QCPGrid : public QCPLayerable {
2124  Q_OBJECT
2126  Q_PROPERTY(bool subGridVisible READ subGridVisible WRITE setSubGridVisible)
2127  Q_PROPERTY(bool antialiasedSubGrid READ antialiasedSubGrid WRITE
2128  setAntialiasedSubGrid)
2129  Q_PROPERTY(bool antialiasedZeroLine READ antialiasedZeroLine WRITE
2130  setAntialiasedZeroLine)
2131  Q_PROPERTY(QPen pen READ pen WRITE setPen)
2132  Q_PROPERTY(QPen subGridPen READ subGridPen WRITE setSubGridPen)
2133  Q_PROPERTY(QPen zeroLinePen READ zeroLinePen WRITE setZeroLinePen)
2135  public:
2136  explicit QCPGrid(QCPAxis *parentAxis);
2137 
2138  // getters:
2139  bool subGridVisible() const { return mSubGridVisible; }
2140  bool antialiasedSubGrid() const { return mAntialiasedSubGrid; }
2141  bool antialiasedZeroLine() const { return mAntialiasedZeroLine; }
2142  QPen pen() const { return mPen; }
2143  QPen subGridPen() const { return mSubGridPen; }
2144  QPen zeroLinePen() const { return mZeroLinePen; }
2145 
2146  // setters:
2147  void setSubGridVisible(bool visible);
2148  void setAntialiasedSubGrid(bool enabled);
2149  void setAntialiasedZeroLine(bool enabled);
2150  void setPen(const QPen &pen);
2151  void setSubGridPen(const QPen &pen);
2152  void setZeroLinePen(const QPen &pen);
2153 
2154  protected:
2155  // property members:
2156  bool mSubGridVisible;
2157  bool mAntialiasedSubGrid, mAntialiasedZeroLine;
2158  QPen mPen, mSubGridPen, mZeroLinePen;
2159 
2160  // non-property members:
2161  QCPAxis *mParentAxis;
2162 
2163  // reimplemented virtual methods:
2164  virtual void applyDefaultAntialiasingHint(QCPPainter *painter) const
2166  virtual void draw(QCPPainter *painter) Q_DECL_OVERRIDE;
2167 
2168  // non-virtual methods:
2169  void drawGridLines(QCPPainter *painter) const;
2170  void drawSubGridLines(QCPPainter *painter) const;
2171 
2172  friend class QCPAxis;
2173 };
2174 
2175 class QCP_LIB_DECL QCPAxis : public QCPLayerable {
2176  Q_OBJECT
2178  Q_PROPERTY(AxisType axisType READ axisType)
2179  Q_PROPERTY(QCPAxisRect *axisRect READ axisRect)
2180  Q_PROPERTY(ScaleType scaleType READ scaleType WRITE setScaleType NOTIFY
2181  scaleTypeChanged)
2182  Q_PROPERTY(QCPRange range READ range WRITE setRange NOTIFY rangeChanged)
2183  Q_PROPERTY(bool rangeReversed READ rangeReversed WRITE setRangeReversed)
2184  Q_PROPERTY(QSharedPointer<QCPAxisTicker> ticker READ ticker WRITE setTicker)
2185  Q_PROPERTY(bool ticks READ ticks WRITE setTicks)
2186  Q_PROPERTY(bool tickLabels READ tickLabels WRITE setTickLabels)
2187  Q_PROPERTY(
2188  int tickLabelPadding READ tickLabelPadding WRITE setTickLabelPadding)
2189  Q_PROPERTY(QFont tickLabelFont READ tickLabelFont WRITE setTickLabelFont)
2190  Q_PROPERTY(QColor tickLabelColor READ tickLabelColor WRITE setTickLabelColor)
2191  Q_PROPERTY(double tickLabelRotation READ tickLabelRotation WRITE
2192  setTickLabelRotation)
2193  Q_PROPERTY(LabelSide tickLabelSide READ tickLabelSide WRITE setTickLabelSide)
2194  Q_PROPERTY(QString numberFormat READ numberFormat WRITE setNumberFormat)
2195  Q_PROPERTY(int numberPrecision READ numberPrecision WRITE setNumberPrecision)
2196  Q_PROPERTY(QVector<double> tickVector READ tickVector)
2197  Q_PROPERTY(QVector<QString> tickVectorLabels READ tickVectorLabels)
2198  Q_PROPERTY(int tickLengthIn READ tickLengthIn WRITE setTickLengthIn)
2199  Q_PROPERTY(int tickLengthOut READ tickLengthOut WRITE setTickLengthOut)
2200  Q_PROPERTY(bool subTicks READ subTicks WRITE setSubTicks)
2201  Q_PROPERTY(int subTickLengthIn READ subTickLengthIn WRITE setSubTickLengthIn)
2202  Q_PROPERTY(
2203  int subTickLengthOut READ subTickLengthOut WRITE setSubTickLengthOut)
2204  Q_PROPERTY(QPen basePen READ basePen WRITE setBasePen)
2205  Q_PROPERTY(QPen tickPen READ tickPen WRITE setTickPen)
2206  Q_PROPERTY(QPen subTickPen READ subTickPen WRITE setSubTickPen)
2207  Q_PROPERTY(QFont labelFont READ labelFont WRITE setLabelFont)
2208  Q_PROPERTY(QColor labelColor READ labelColor WRITE setLabelColor)
2209  Q_PROPERTY(QString label READ label WRITE setLabel)
2210  Q_PROPERTY(int labelPadding READ labelPadding WRITE setLabelPadding)
2211  Q_PROPERTY(int padding READ padding WRITE setPadding)
2212  Q_PROPERTY(int offset READ offset WRITE setOffset)
2213  Q_PROPERTY(SelectableParts selectedParts READ selectedParts WRITE
2214  setSelectedParts NOTIFY selectionChanged)
2215  Q_PROPERTY(SelectableParts selectableParts READ selectableParts WRITE
2216  setSelectableParts NOTIFY selectableChanged)
2217  Q_PROPERTY(QFont selectedTickLabelFont READ selectedTickLabelFont WRITE
2218  setSelectedTickLabelFont)
2219  Q_PROPERTY(
2220  QFont selectedLabelFont READ selectedLabelFont WRITE setSelectedLabelFont)
2221  Q_PROPERTY(QColor selectedTickLabelColor READ selectedTickLabelColor WRITE
2222  setSelectedTickLabelColor)
2223  Q_PROPERTY(QColor selectedLabelColor READ selectedLabelColor WRITE
2224  setSelectedLabelColor)
2225  Q_PROPERTY(QPen selectedBasePen READ selectedBasePen WRITE setSelectedBasePen)
2226  Q_PROPERTY(QPen selectedTickPen READ selectedTickPen WRITE setSelectedTickPen)
2227  Q_PROPERTY(QPen selectedSubTickPen READ selectedSubTickPen WRITE
2228  setSelectedSubTickPen)
2229  Q_PROPERTY(QCPLineEnding lowerEnding READ lowerEnding WRITE setLowerEnding)
2230  Q_PROPERTY(QCPLineEnding upperEnding READ upperEnding WRITE setUpperEnding)
2231  Q_PROPERTY(QCPGrid *grid READ grid)
2233  public:
2239  enum AxisType {
2240  atLeft = 0x01
2242  ,
2243  atRight = 0x02
2245  ,
2246  atTop = 0x04
2248  ,
2249  atBottom = 0x08
2251  };
2252  Q_ENUMS(AxisType)
2253  Q_FLAGS(AxisTypes)
2254  Q_DECLARE_FLAGS(AxisTypes, AxisType)
2260  enum LabelSide {
2261  lsInside
2263  ,
2264  lsOutside
2265  };
2266  Q_ENUMS(LabelSide)
2271  enum ScaleType {
2272  stLinear
2273  ,
2274  stLogarithmic
2277  };
2278  Q_ENUMS(ScaleType)
2284  spNone = 0
2285  ,
2286  spAxis = 0x001
2287  ,
2288  spTickLabels = 0x002
2290  ,
2291  spAxisLabel = 0x004
2292  };
2293  Q_ENUMS(SelectablePart)
2294  Q_FLAGS(SelectableParts)
2295  Q_DECLARE_FLAGS(SelectableParts, SelectablePart)
2296 
2297  explicit QCPAxis(QCPAxisRect *parent, AxisType type);
2298  virtual ~QCPAxis();
2299 
2300  // getters:
2301  AxisType axisType() const { return mAxisType; }
2302  QCPAxisRect *axisRect() const { return mAxisRect; }
2303  ScaleType scaleType() const { return mScaleType; }
2304  const QCPRange range() const { return mRange; }
2305  bool rangeReversed() const { return mRangeReversed; }
2306  QSharedPointer<QCPAxisTicker> ticker() const { return mTicker; }
2307  bool ticks() const { return mTicks; }
2308  bool tickLabels() const { return mTickLabels; }
2309  int tickLabelPadding() const;
2310  QFont tickLabelFont() const { return mTickLabelFont; }
2311  QColor tickLabelColor() const { return mTickLabelColor; }
2312  double tickLabelRotation() const;
2314  QString numberFormat() const;
2315  int numberPrecision() const { return mNumberPrecision; }
2316  QVector<double> tickVector() const { return mTickVector; }
2317  QVector<QString> tickVectorLabels() const { return mTickVectorLabels; }
2318  int tickLengthIn() const;
2319  int tickLengthOut() const;
2320  bool subTicks() const { return mSubTicks; }
2321  int subTickLengthIn() const;
2322  int subTickLengthOut() const;
2323  QPen basePen() const { return mBasePen; }
2324  QPen tickPen() const { return mTickPen; }
2325  QPen subTickPen() const { return mSubTickPen; }
2326  QFont labelFont() const { return mLabelFont; }
2327  QColor labelColor() const { return mLabelColor; }
2328  QString label() const { return mLabel; }
2329  int labelPadding() const;
2330  int padding() const { return mPadding; }
2331  int offset() const;
2332  SelectableParts selectedParts() const { return mSelectedParts; }
2333  SelectableParts selectableParts() const { return mSelectableParts; }
2334  QFont selectedTickLabelFont() const { return mSelectedTickLabelFont; }
2335  QFont selectedLabelFont() const { return mSelectedLabelFont; }
2336  QColor selectedTickLabelColor() const { return mSelectedTickLabelColor; }
2337  QColor selectedLabelColor() const { return mSelectedLabelColor; }
2338  QPen selectedBasePen() const { return mSelectedBasePen; }
2339  QPen selectedTickPen() const { return mSelectedTickPen; }
2340  QPen selectedSubTickPen() const { return mSelectedSubTickPen; }
2343  QCPGrid *grid() const { return mGrid; }
2344 
2345  // setters:
2347  Q_SLOT void setRange(const QCPRange &range);
2348  void setRange(double lower, double upper);
2349  void setRange(double position, double size, Qt::AlignmentFlag alignment);
2350  void setRangeLower(double lower);
2351  void setRangeUpper(double upper);
2352  void setRangeReversed(bool reversed);
2353  void setTicker(QSharedPointer<QCPAxisTicker> ticker);
2354  void setTicks(bool show);
2355  void setTickLabels(bool show);
2356  void setTickLabelPadding(int padding);
2357  void setTickLabelFont(const QFont &font);
2358  void setTickLabelColor(const QColor &color);
2359  void setTickLabelRotation(double degrees);
2361  void setNumberFormat(const QString &formatCode);
2362  void setNumberPrecision(int precision);
2363  void setTickLength(int inside, int outside = 0);
2364  void setTickLengthIn(int inside);
2365  void setTickLengthOut(int outside);
2366  void setSubTicks(bool show);
2367  void setSubTickLength(int inside, int outside = 0);
2368  void setSubTickLengthIn(int inside);
2369  void setSubTickLengthOut(int outside);
2370  void setBasePen(const QPen &pen);
2371  void setTickPen(const QPen &pen);
2372  void setSubTickPen(const QPen &pen);
2373  void setLabelFont(const QFont &font);
2374  void setLabelColor(const QColor &color);
2375  void setLabel(const QString &str);
2376  void setLabelPadding(int padding);
2377  void setPadding(int padding);
2378  void setOffset(int offset);
2379  void setSelectedTickLabelFont(const QFont &font);
2380  void setSelectedLabelFont(const QFont &font);
2381  void setSelectedTickLabelColor(const QColor &color);
2382  void setSelectedLabelColor(const QColor &color);
2383  void setSelectedBasePen(const QPen &pen);
2384  void setSelectedTickPen(const QPen &pen);
2385  void setSelectedSubTickPen(const QPen &pen);
2386  Q_SLOT void setSelectableParts(
2387  const QCPAxis::SelectableParts &selectableParts);
2388  Q_SLOT void setSelectedParts(const QCPAxis::SelectableParts &selectedParts);
2389  void setLowerEnding(const QCPLineEnding &ending);
2390  void setUpperEnding(const QCPLineEnding &ending);
2391 
2392  // reimplemented virtual methods:
2393  virtual double selectTest(const QPointF &pos, bool onlySelectable,
2394  QVariant *details = 0) const Q_DECL_OVERRIDE;
2395 
2396  // non-property methods:
2397  Qt::Orientation orientation() const { return mOrientation; }
2398  int pixelOrientation() const {
2399  return rangeReversed() != (orientation() == Qt::Vertical) ? -1 : 1;
2400  }
2401  void moveRange(double diff);
2402  void scaleRange(double factor);
2403  void scaleRange(double factor, double center);
2404  void setScaleRatio(const QCPAxis *otherAxis, double ratio = 1.0);
2405  void rescale(bool onlyVisiblePlottables = false);
2406  double pixelToCoord(double value) const;
2407  double coordToPixel(double value) const;
2408  SelectablePart getPartAt(const QPointF &pos) const;
2409  QList<QCPAbstractPlottable *> plottables() const;
2410  QList<QCPGraph *> graphs() const;
2411  QList<QCPAbstractItem *> items() const;
2412 
2414  static Qt::Orientation orientation(AxisType type) {
2415  return type == atBottom || type == atTop ? Qt::Horizontal : Qt::Vertical;
2416  }
2418 
2419  signals:
2420  void rangeChanged(const QCPRange &newRange);
2421  void rangeChanged(const QCPRange &newRange, const QCPRange &oldRange);
2423  void selectionChanged(const QCPAxis::SelectableParts &parts);
2424  void selectableChanged(const QCPAxis::SelectableParts &parts);
2425 
2426  protected:
2427  // property members:
2428  // axis base:
2429  AxisType mAxisType;
2430  QCPAxisRect *mAxisRect;
2431  // int mOffset; // in QCPAxisPainter
2432  int mPadding;
2433  Qt::Orientation mOrientation;
2434  SelectableParts mSelectableParts, mSelectedParts;
2435  QPen mBasePen, mSelectedBasePen;
2436  // QCPLineEnding mLowerEnding, mUpperEnding; // in QCPAxisPainter
2437  // axis label:
2438  // int mLabelPadding; // in QCPAxisPainter
2439  QString mLabel;
2440  QFont mLabelFont, mSelectedLabelFont;
2441  QColor mLabelColor, mSelectedLabelColor;
2442  // tick labels:
2443  // int mTickLabelPadding; // in QCPAxisPainter
2444  bool mTickLabels;
2445  // double mTickLabelRotation; // in QCPAxisPainter
2446  QFont mTickLabelFont, mSelectedTickLabelFont;
2447  QColor mTickLabelColor, mSelectedTickLabelColor;
2448  int mNumberPrecision;
2449  QLatin1Char mNumberFormatChar;
2450  bool mNumberBeautifulPowers;
2451  // bool mNumberMultiplyCross; // QCPAxisPainter
2452  // ticks and subticks:
2453  bool mTicks;
2455  // int mTickLengthIn, mTickLengthOut, mSubTickLengthIn, mSubTickLengthOut; //
2456  // QCPAxisPainter
2457  QPen mTickPen, mSelectedTickPen;
2458  QPen mSubTickPen, mSelectedSubTickPen;
2459  // scale and range:
2460  QCPRange mRange;
2461  bool mRangeReversed;
2462  ScaleType mScaleType;
2463 
2464  // non-property members:
2465  QCPGrid *mGrid;
2466  QCPAxisPainterPrivate *mAxisPainter;
2467  QSharedPointer<QCPAxisTicker> mTicker;
2468  QVector<double> mTickVector;
2469  QVector<QString> mTickVectorLabels;
2470  QVector<double> mSubTickVector;
2471  bool mCachedMarginValid;
2472  int mCachedMargin;
2475  QCP::AntialiasedElements mAADragBackup, mNotAADragBackup;
2476 
2477  // introduced virtual methods:
2478  virtual int calculateMargin();
2479 
2480  // reimplemented virtual methods:
2481  virtual void applyDefaultAntialiasingHint(QCPPainter *painter) const
2483  virtual void draw(QCPPainter *painter) Q_DECL_OVERRIDE;
2485  // events:
2486  virtual void selectEvent(QMouseEvent *event, bool additive,
2487  const QVariant &details,
2488  bool *selectionStateChanged) Q_DECL_OVERRIDE;
2489  virtual void deselectEvent(bool *selectionStateChanged) Q_DECL_OVERRIDE;
2490  // mouse events:
2491  virtual void mousePressEvent(QMouseEvent *event,
2492  const QVariant &details) Q_DECL_OVERRIDE;
2493  virtual void mouseMoveEvent(QMouseEvent *event,
2494  const QPointF &startPos) Q_DECL_OVERRIDE;
2495  virtual void mouseReleaseEvent(QMouseEvent *event,
2496  const QPointF &startPos) Q_DECL_OVERRIDE;
2497  virtual void wheelEvent(QWheelEvent *event) Q_DECL_OVERRIDE;
2498 
2499  // non-virtual methods:
2500  void setupTickVectors();
2501  QPen getBasePen() const;
2502  QPen getTickPen() const;
2503  QPen getSubTickPen() const;
2504  QFont getTickLabelFont() const;
2505  QFont getLabelFont() const;
2506  QColor getTickLabelColor() const;
2507  QColor getLabelColor() const;
2508 
2509  private:
2510  Q_DISABLE_COPY(QCPAxis)
2511 
2512  friend class QCustomPlot;
2513  friend class QCPGrid;
2514  friend class QCPAxisRect;
2515 };
2516 Q_DECLARE_OPERATORS_FOR_FLAGS(QCPAxis::SelectableParts)
2517 Q_DECLARE_OPERATORS_FOR_FLAGS(QCPAxis::AxisTypes)
2518 Q_DECLARE_METATYPE(QCPAxis::AxisType)
2519 Q_DECLARE_METATYPE(QCPAxis::LabelSide)
2520 Q_DECLARE_METATYPE(QCPAxis::ScaleType)
2521 Q_DECLARE_METATYPE(QCPAxis::SelectablePart)
2522 
2523 class QCPAxisPainterPrivate {
2524  public:
2525  explicit QCPAxisPainterPrivate(QCustomPlot *parentPlot);
2527 
2528  virtual void draw(QCPPainter *painter);
2529  virtual int size() const;
2530  void clearCache();
2531 
2532  QRect axisSelectionBox() const { return mAxisSelectionBox; }
2533  QRect tickLabelsSelectionBox() const { return mTickLabelsSelectionBox; }
2534  QRect labelSelectionBox() const { return mLabelSelectionBox; }
2535 
2536  // public property members:
2537  QCPAxis::AxisType type;
2538  QPen basePen;
2539  QCPLineEnding lowerEnding,
2540  upperEnding; // directly accessed by QCPAxis setters/getters
2541  int labelPadding; // directly accessed by QCPAxis setters/getters
2542  QFont labelFont;
2543  QColor labelColor;
2544  QString label;
2545  int tickLabelPadding; // directly accessed by QCPAxis setters/getters
2546  double tickLabelRotation; // directly accessed by QCPAxis setters/getters
2548  tickLabelSide; // directly accessed by QCPAxis setters/getters
2549  bool substituteExponent;
2550  bool numberMultiplyCross; // directly accessed by QCPAxis setters/getters
2551  int tickLengthIn, tickLengthOut, subTickLengthIn,
2552  subTickLengthOut; // directly accessed by QCPAxis setters/getters
2553  QPen tickPen, subTickPen;
2554  QFont tickLabelFont;
2555  QColor tickLabelColor;
2556  QRect axisRect, viewportRect;
2557  double offset; // directly accessed by QCPAxis setters/getters
2558  bool abbreviateDecimalPowers;
2559  bool reversedEndings;
2560 
2561  QVector<double> subTickPositions;
2562  QVector<double> tickPositions;
2563  QVector<QString> tickLabels;
2564 
2565  protected:
2566  struct CachedLabel {
2567  QPointF offset;
2568  QPixmap pixmap;
2569  };
2570  struct TickLabelData {
2571  QString basePart, expPart, suffixPart;
2572  QRect baseBounds, expBounds, suffixBounds, totalBounds, rotatedTotalBounds;
2573  QFont baseFont, expFont;
2574  };
2575  QCustomPlot *mParentPlot;
2576  QByteArray mLabelParameterHash; // to determine whether mLabelCache needs to
2577  // be cleared due to changed parameters
2578  QCache<QString, CachedLabel> mLabelCache;
2579  QRect mAxisSelectionBox, mTickLabelsSelectionBox, mLabelSelectionBox;
2580 
2581  virtual QByteArray generateLabelParameterHash() const;
2582 
2583  virtual void placeTickLabel(QCPPainter *painter, double position,
2584  int distanceToAxis, const QString &text,
2585  QSize *tickLabelsSize);
2586  virtual void drawTickLabel(QCPPainter *painter, double x, double y,
2587  const TickLabelData &labelData) const;
2588  virtual TickLabelData getTickLabelData(const QFont &font,
2589  const QString &text) const;
2590  virtual QPointF getTickLabelDrawOffset(const TickLabelData &labelData) const;
2591  virtual void getMaxTickLabelSize(const QFont &font, const QString &text,
2592  QSize *tickLabelsSize) const;
2593 };
2594 
2595 /* end of 'src/axis/axis.h' */
2596 
2597 /* including file 'src/scatterstyle.h', size 7275 */
2598 /* commit ce344b3f96a62e5f652585e55f1ae7c7883cd45b 2018-06-25 01:03:39 +0200 */
2599 
2601  Q_GADGET
2602  public:
2613  spNone = 0x00
2614  ,
2615  spPen = 0x01
2616  ,
2617  spBrush = 0x02
2618  ,
2619  spSize = 0x04
2620  ,
2621  spShape = 0x08
2622  ,
2623  spAll = 0xFF
2624  };
2625  Q_ENUMS(ScatterProperty)
2626  Q_FLAGS(ScatterProperties)
2627  Q_DECLARE_FLAGS(ScatterProperties, ScatterProperty)
2628 
2629 
2638  ssNone
2640  ,
2641  ssDot
2643  ,
2644  ssCross
2645  ,
2646  ssPlus
2647  ,
2648  ssCircle
2649  ,
2650  ssDisc
2652  ,
2653  ssSquare
2654  ,
2655  ssDiamond
2656  ,
2657  ssStar
2659  ,
2660  ssTriangle
2662  ,
2663  ssTriangleInverted
2665  ,
2666  ssCrossSquare
2668  ,
2669  ssPlusSquare
2670  ,
2671  ssCrossCircle
2673  ,
2674  ssPlusCircle
2675  ,
2676  ssPeace
2678  ,
2679  ssPixmap
2681  ,
2682  ssCustom
2684  };
2685  Q_ENUMS(ScatterShape)
2686 
2688  QCPScatterStyle(ScatterShape shape, double size = 6);
2689  QCPScatterStyle(ScatterShape shape, const QColor &color, double size);
2690  QCPScatterStyle(ScatterShape shape, const QColor &color, const QColor &fill,
2691  double size);
2692  QCPScatterStyle(ScatterShape shape, const QPen &pen, const QBrush &brush,
2693  double size);
2694  QCPScatterStyle(const QPixmap &pixmap);
2695  QCPScatterStyle(const QPainterPath &customPath, const QPen &pen,
2696  const QBrush &brush = Qt::NoBrush, double size = 6);
2697 
2698  // getters:
2699  double size() const { return mSize; }
2700  ScatterShape shape() const { return mShape; }
2701  QPen pen() const { return mPen; }
2702  QBrush brush() const { return mBrush; }
2703  QPixmap pixmap() const { return mPixmap; }
2704  QPainterPath customPath() const { return mCustomPath; }
2705 
2706  // setters:
2707  void setFromOther(const QCPScatterStyle &other, ScatterProperties properties);
2708  void setSize(double size);
2709  void setShape(ScatterShape shape);
2710  void setPen(const QPen &pen);
2711  void setBrush(const QBrush &brush);
2712  void setPixmap(const QPixmap &pixmap);
2713  void setCustomPath(const QPainterPath &customPath);
2714 
2715  // non-property methods:
2716  bool isNone() const { return mShape == ssNone; }
2717  bool isPenDefined() const { return mPenDefined; }
2718  void undefinePen();
2719  void applyTo(QCPPainter *painter, const QPen &defaultPen) const;
2720  void drawShape(QCPPainter *painter, const QPointF &pos) const;
2721  void drawShape(QCPPainter *painter, double x, double y) const;
2722 
2723  protected:
2724  // property members:
2725  double mSize;
2726  ScatterShape mShape;
2727  QPen mPen;
2728  QBrush mBrush;
2729  QPixmap mPixmap;
2730  QPainterPath mCustomPath;
2731 
2732  // non-property members:
2733  bool mPenDefined;
2734 };
2736 Q_DECLARE_OPERATORS_FOR_FLAGS(QCPScatterStyle::ScatterProperties)
2737 Q_DECLARE_METATYPE(QCPScatterStyle::ScatterProperty)
2738 Q_DECLARE_METATYPE(QCPScatterStyle::ScatterShape)
2739 
2740 /* end of 'src/scatterstyle.h' */
2741 
2742 /* including file 'src/datacontainer.h', size 4596 */
2743 /* commit ce344b3f96a62e5f652585e55f1ae7c7883cd45b 2018-06-25 01:03:39 +0200 */
2744 
2745 
2750 template <class DataType>
2751 inline bool qcpLessThanSortKey(const DataType &a, const DataType &b) {
2752  return a.sortKey() < b.sortKey();
2753 }
2754 
2755 template <class DataType>
2756 class QCPDataContainer // no QCP_LIB_DECL, template class ends up in header
2757  // (cpp included below)
2758 {
2759  public:
2760  typedef typename QVector<DataType>::const_iterator const_iterator;
2761  typedef typename QVector<DataType>::iterator iterator;
2762 
2763  QCPDataContainer();
2764 
2765  // getters:
2766  int size() const { return mData.size() - mPreallocSize; }
2767  bool isEmpty() const { return size() == 0; }
2768  bool autoSqueeze() const { return mAutoSqueeze; }
2769 
2770  // setters:
2771  void setAutoSqueeze(bool enabled);
2772 
2773  // non-virtual methods:
2774  void set(const QCPDataContainer<DataType> &data);
2775  void set(const QVector<DataType> &data, bool alreadySorted = false);
2776  void add(const QCPDataContainer<DataType> &data);
2777  void add(const QVector<DataType> &data, bool alreadySorted = false);
2778  void add(const DataType &data);
2779  void removeBefore(double sortKey);
2780  void removeAfter(double sortKey);
2781  void remove(double sortKeyFrom, double sortKeyTo);
2782  void remove(double sortKey);
2783  void clear();
2784  void sort();
2785  void squeeze(bool preAllocation = true, bool postAllocation = true);
2786 
2788  return mData.constBegin() + mPreallocSize;
2789  }
2790  const_iterator constEnd() const { return mData.constEnd(); }
2791  iterator begin() { return mData.begin() + mPreallocSize; }
2792  iterator end() { return mData.end(); }
2793  const_iterator findBegin(double sortKey, bool expandedRange = true) const;
2794  const_iterator findEnd(double sortKey, bool expandedRange = true) const;
2795  const_iterator at(int index) const {
2796  return constBegin() + qBound(0, index, size());
2797  }
2798  QCPRange keyRange(bool &foundRange, QCP::SignDomain signDomain = QCP::sdBoth);
2799  QCPRange valueRange(bool &foundRange,
2800  QCP::SignDomain signDomain = QCP::sdBoth,
2801  const QCPRange &inKeyRange = QCPRange());
2802  QCPDataRange dataRange() const { return QCPDataRange(0, size()); }
2803  void limitIteratorsToDataRange(const_iterator &begin, const_iterator &end,
2804  const QCPDataRange &dataRange) const;
2805 
2806  protected:
2807  // property members:
2809 
2810  // non-property memebers:
2811  QVector<DataType> mData;
2814 
2815  // non-virtual methods:
2816  void preallocateGrow(int minimumPreallocSize);
2817  void performAutoSqueeze();
2818 };
2819 
2820 // include implementation in header since it is a class template:
2821 
2822 /* including file 'src/datacontainer.cpp', size 31349 */
2823 /* commit ce344b3f96a62e5f652585e55f1ae7c7883cd45b 2018-06-25 01:03:39 +0200 */
2824 
2828 
2909 /* start documentation of inline functions */
2910 
2971 /* end documentation of inline functions */
2972 
2977 template <class DataType>
2979  : mAutoSqueeze(true), mPreallocSize(0), mPreallocIteration(0) {}
2980 
2989 template <class DataType>
2991  if (mAutoSqueeze != enabled) {
2992  mAutoSqueeze = enabled;
2993  if (mAutoSqueeze) performAutoSqueeze();
2994  }
2995 }
2996 
3003 template <class DataType>
3005  clear();
3006  add(data);
3007 }
3008 
3019 template <class DataType>
3020 void QCPDataContainer<DataType>::set(const QVector<DataType> &data,
3021  bool alreadySorted) {
3022  mData = data;
3023  mPreallocSize = 0;
3024  mPreallocIteration = 0;
3025  if (!alreadySorted) sort();
3026 }
3027 
3034 template <class DataType>
3036  if (data.isEmpty()) return;
3037 
3038  const int n = data.size();
3039  const int oldSize = size();
3040 
3041  if (oldSize > 0 &&
3042  !qcpLessThanSortKey<DataType>(
3043  *constBegin(),
3044  *(data.constEnd() - 1))) // prepend if new data keys are all smaller
3045  // than or equal to existing ones
3046  {
3047  if (mPreallocSize < n) preallocateGrow(n);
3048  mPreallocSize -= n;
3049  std::copy(data.constBegin(), data.constEnd(), begin());
3050  } else // don't need to prepend, so append and merge if necessary
3051  {
3052  mData.resize(mData.size() + n);
3053  std::copy(data.constBegin(), data.constEnd(), end() - n);
3054  if (oldSize > 0 &&
3055  !qcpLessThanSortKey<DataType>(
3056  *(constEnd() - n - 1),
3057  *(constEnd() - n))) // if appended range keys aren't all greater
3058  // than existing ones, merge the two partitions
3059  std::inplace_merge(begin(), end() - n, end(),
3060  qcpLessThanSortKey<DataType>);
3061  }
3062 }
3063 
3073 template <class DataType>
3074 void QCPDataContainer<DataType>::add(const QVector<DataType> &data,
3075  bool alreadySorted) {
3076  if (data.isEmpty()) return;
3077  if (isEmpty()) {
3078  set(data, alreadySorted);
3079  return;
3080  }
3081 
3082  const int n = data.size();
3083  const int oldSize = size();
3084 
3085  if (alreadySorted && oldSize > 0 &&
3086  !qcpLessThanSortKey<DataType>(
3087  *constBegin(), *(data.constEnd() -
3088  1))) // prepend if new data is sorted and keys are
3089  // all smaller than or equal to existing ones
3090  {
3091  if (mPreallocSize < n) preallocateGrow(n);
3092  mPreallocSize -= n;
3093  std::copy(data.constBegin(), data.constEnd(), begin());
3094  } else // don't need to prepend, so append and then sort and merge if
3095  // necessary
3096  {
3097  mData.resize(mData.size() + n);
3098  std::copy(data.constBegin(), data.constEnd(), end() - n);
3099  if (!alreadySorted) // sort appended subrange if it wasn't already sorted
3100  std::sort(end() - n, end(), qcpLessThanSortKey<DataType>);
3101  if (oldSize > 0 &&
3102  !qcpLessThanSortKey<DataType>(
3103  *(constEnd() - n - 1),
3104  *(constEnd() - n))) // if appended range keys aren't all greater
3105  // than existing ones, merge the two partitions
3106  std::inplace_merge(begin(), end() - n, end(),
3107  qcpLessThanSortKey<DataType>);
3108  }
3109 }
3110 
3117 template <class DataType>
3118 void QCPDataContainer<DataType>::add(const DataType &data) {
3119  if (isEmpty() ||
3120  !qcpLessThanSortKey<DataType>(
3121  data, *(constEnd() - 1))) // quickly handle appends if new data key
3122  // is greater or equal to existing ones
3123  {
3124  mData.append(data);
3125  } else if (qcpLessThanSortKey<DataType>(
3126  data, *constBegin())) // quickly handle prepends using
3127  // preallocated space
3128  {
3129  if (mPreallocSize < 1) preallocateGrow(1);
3130  --mPreallocSize;
3131  *begin() = data;
3132  } else // handle inserts, maintaining sorted keys
3133  {
3134  QCPDataContainer<DataType>::iterator insertionPoint =
3135  std::lower_bound(begin(), end(), data, qcpLessThanSortKey<DataType>);
3136  mData.insert(insertionPoint, data);
3137  }
3138 }
3139 
3145 template <class DataType>
3149  std::lower_bound(begin(), end(), DataType::fromSortKey(sortKey),
3150  qcpLessThanSortKey<DataType>);
3151  mPreallocSize +=
3152  itEnd - it; // don't actually delete, just add it to the preallocated
3153  // block (if it gets too large, squeeze will take care of it)
3154  if (mAutoSqueeze) performAutoSqueeze();
3155 }
3156 
3162 template <class DataType>
3165  std::upper_bound(begin(), end(), DataType::fromSortKey(sortKey),
3166  qcpLessThanSortKey<DataType>);
3168  mData.erase(it, itEnd); // typically adds it to the postallocated block
3169  if (mAutoSqueeze) performAutoSqueeze();
3170 }
3171 
3180 template <class DataType>
3181 void QCPDataContainer<DataType>::remove(double sortKeyFrom, double sortKeyTo) {
3182  if (sortKeyFrom >= sortKeyTo || isEmpty()) return;
3183 
3185  std::lower_bound(begin(), end(), DataType::fromSortKey(sortKeyFrom),
3186  qcpLessThanSortKey<DataType>);
3188  std::upper_bound(it, end(), DataType::fromSortKey(sortKeyTo),
3189  qcpLessThanSortKey<DataType>);
3190  mData.erase(it, itEnd);
3191  if (mAutoSqueeze) performAutoSqueeze();
3192 }
3193 
3203 template <class DataType>
3206  std::lower_bound(begin(), end(), DataType::fromSortKey(sortKey),
3207  qcpLessThanSortKey<DataType>);
3208  if (it != end() && it->sortKey() == sortKey) {
3209  if (it == begin())
3210  ++mPreallocSize; // don't actually delete, just add it to the
3211  // preallocated block (if it gets too large, squeeze
3212  // will take care of it)
3213  else
3214  mData.erase(it);
3215  }
3216  if (mAutoSqueeze) performAutoSqueeze();
3217 }
3218 
3224 template <class DataType>
3226  mData.clear();
3227  mPreallocIteration = 0;
3228  mPreallocSize = 0;
3229 }
3230 
3243 template <class DataType>
3245  std::sort(begin(), end(), qcpLessThanSortKey<DataType>);
3246 }
3247 
3259 template <class DataType>
3260 void QCPDataContainer<DataType>::squeeze(bool preAllocation,
3261  bool postAllocation) {
3262  if (preAllocation) {
3263  if (mPreallocSize > 0) {
3264  std::copy(begin(), end(), mData.begin());
3265  mData.resize(size());
3266  mPreallocSize = 0;
3267  }
3268  mPreallocIteration = 0;
3269  }
3270  if (postAllocation) mData.squeeze();
3271 }
3272 
3289 template <class DataType>
3292  bool expandedRange) const {
3293  if (isEmpty()) return constEnd();
3294 
3296  std::lower_bound(constBegin(), constEnd(), DataType::fromSortKey(sortKey),
3297  qcpLessThanSortKey<DataType>);
3298  if (expandedRange &&
3299  it != constBegin()) // also covers it == constEnd case, and we know
3300  // --constEnd is valid because mData isn't empty
3301  --it;
3302  return it;
3303 }
3304 
3322 template <class DataType>
3324 QCPDataContainer<DataType>::findEnd(double sortKey, bool expandedRange) const {
3325  if (isEmpty()) return constEnd();
3326 
3328  std::upper_bound(constBegin(), constEnd(), DataType::fromSortKey(sortKey),
3329  qcpLessThanSortKey<DataType>);
3330  if (expandedRange && it != constEnd()) ++it;
3331  return it;
3332 }
3333 
3350 template <class DataType>
3352  QCP::SignDomain signDomain) {
3353  if (isEmpty()) {
3354  foundRange = false;
3355  return QCPRange();
3356  }
3357  QCPRange range;
3358  bool haveLower = false;
3359  bool haveUpper = false;
3360  double current;
3361 
3363  QCPDataContainer<DataType>::const_iterator itEnd = constEnd();
3364  if (signDomain == QCP::sdBoth) // range may be anywhere
3365  {
3366  if (DataType::sortKeyIsMainKey()) // if DataType is sorted by main key
3367  // (e.g. QCPGraph, but not QCPCurve), use
3368  // faster algorithm by finding just first
3369  // and last key with non-NaN value
3370  {
3371  while (it != itEnd) // find first non-nan going up from left
3372  {
3373  if (!qIsNaN(it->mainValue())) {
3374  range.lower = it->mainKey();
3375  haveLower = true;
3376  break;
3377  }
3378  ++it;
3379  }
3380  it = itEnd;
3381  while (it != constBegin()) // find first non-nan going down from right
3382  {
3383  --it;
3384  if (!qIsNaN(it->mainValue())) {
3385  range.upper = it->mainKey();
3386  haveUpper = true;
3387  break;
3388  }
3389  }
3390  } else // DataType is not sorted by main key, go through all data points
3391  // and accordingly expand range
3392  {
3393  while (it != itEnd) {
3394  if (!qIsNaN(it->mainValue())) {
3395  current = it->mainKey();
3396  if (current < range.lower || !haveLower) {
3397  range.lower = current;
3398  haveLower = true;
3399  }
3400  if (current > range.upper || !haveUpper) {
3401  range.upper = current;
3402  haveUpper = true;
3403  }
3404  }
3405  ++it;
3406  }
3407  }
3408  } else if (signDomain ==
3409  QCP::sdNegative) // range may only be in the negative sign domain
3410  {
3411  while (it != itEnd) {
3412  if (!qIsNaN(it->mainValue())) {
3413  current = it->mainKey();
3414  if ((current < range.lower || !haveLower) && current < 0) {
3415  range.lower = current;
3416  haveLower = true;
3417  }
3418  if ((current > range.upper || !haveUpper) && current < 0) {
3419  range.upper = current;
3420  haveUpper = true;
3421  }
3422  }
3423  ++it;
3424  }
3425  } else if (signDomain ==
3426  QCP::sdPositive) // range may only be in the positive sign domain
3427  {
3428  while (it != itEnd) {
3429  if (!qIsNaN(it->mainValue())) {
3430  current = it->mainKey();
3431  if ((current < range.lower || !haveLower) && current > 0) {
3432  range.lower = current;
3433  haveLower = true;
3434  }
3435  if ((current > range.upper || !haveUpper) && current > 0) {
3436  range.upper = current;
3437  haveUpper = true;
3438  }
3439  }
3440  ++it;
3441  }
3442  }
3443 
3444  foundRange = haveLower && haveUpper;
3445  return range;
3446 }
3447 
3466 template <class DataType>
3468  QCP::SignDomain signDomain,
3469  const QCPRange &inKeyRange) {
3470  if (isEmpty()) {
3471  foundRange = false;
3472  return QCPRange();
3473  }
3474  QCPRange range;
3475  const bool restrictKeyRange = inKeyRange != QCPRange();
3476  bool haveLower = false;
3477  bool haveUpper = false;
3478  QCPRange current;
3479  QCPDataContainer<DataType>::const_iterator itBegin = constBegin();
3480  QCPDataContainer<DataType>::const_iterator itEnd = constEnd();
3481  if (DataType::sortKeyIsMainKey() && restrictKeyRange) {
3482  itBegin = findBegin(inKeyRange.lower);
3483  itEnd = findEnd(inKeyRange.upper);
3484  }
3485  if (signDomain == QCP::sdBoth) // range may be anywhere
3486  {
3487  for (QCPDataContainer<DataType>::const_iterator it = itBegin; it != itEnd;
3488  ++it) {
3489  if (restrictKeyRange && (it->mainKey() < inKeyRange.lower ||
3490  it->mainKey() > inKeyRange.upper))
3491  continue;
3492  current = it->valueRange();
3493  if ((current.lower < range.lower || !haveLower) &&
3494  !qIsNaN(current.lower)) {
3495  range.lower = current.lower;
3496  haveLower = true;
3497  }
3498  if ((current.upper > range.upper || !haveUpper) &&
3499  !qIsNaN(current.upper)) {
3500  range.upper = current.upper;
3501  haveUpper = true;
3502  }
3503  }
3504  } else if (signDomain ==
3505  QCP::sdNegative) // range may only be in the negative sign domain
3506  {
3507  for (QCPDataContainer<DataType>::const_iterator it = itBegin; it != itEnd;
3508  ++it) {
3509  if (restrictKeyRange && (it->mainKey() < inKeyRange.lower ||
3510  it->mainKey() > inKeyRange.upper))
3511  continue;
3512  current = it->valueRange();
3513  if ((current.lower < range.lower || !haveLower) && current.lower < 0 &&
3514  !qIsNaN(current.lower)) {
3515  range.lower = current.lower;
3516  haveLower = true;
3517  }
3518  if ((current.upper > range.upper || !haveUpper) && current.upper < 0 &&
3519  !qIsNaN(current.upper)) {
3520  range.upper = current.upper;
3521  haveUpper = true;
3522  }
3523  }
3524  } else if (signDomain ==
3525  QCP::sdPositive) // range may only be in the positive sign domain
3526  {
3527  for (QCPDataContainer<DataType>::const_iterator it = itBegin; it != itEnd;
3528  ++it) {
3529  if (restrictKeyRange && (it->mainKey() < inKeyRange.lower ||
3530  it->mainKey() > inKeyRange.upper))
3531  continue;
3532  current = it->valueRange();
3533  if ((current.lower < range.lower || !haveLower) && current.lower > 0 &&
3534  !qIsNaN(current.lower)) {
3535  range.lower = current.lower;
3536  haveLower = true;
3537  }
3538  if ((current.upper > range.upper || !haveUpper) && current.upper > 0 &&
3539  !qIsNaN(current.upper)) {
3540  range.upper = current.upper;
3541  haveUpper = true;
3542  }
3543  }
3544  }
3545 
3546  foundRange = haveLower && haveUpper;
3547  return range;
3548 }
3549 
3559 template <class DataType>
3561  const_iterator &begin, const_iterator &end,
3562  const QCPDataRange &dataRange) const {
3563  QCPDataRange iteratorRange(begin - constBegin(), end - constBegin());
3564  iteratorRange = iteratorRange.bounded(dataRange.bounded(this->dataRange()));
3565  begin = constBegin() + iteratorRange.begin();
3566  end = constBegin() + iteratorRange.end();
3567 }
3568 
3579 template <class DataType>
3580 void QCPDataContainer<DataType>::preallocateGrow(int minimumPreallocSize) {
3581  if (minimumPreallocSize <= mPreallocSize) return;
3582 
3583  int newPreallocSize = minimumPreallocSize;
3584  newPreallocSize += (1u << qBound(4, mPreallocIteration + 4, 15)) -
3585  12; // do 4 up to 32768-12 preallocation, doubling in each
3586  // intermediate iteration
3587  ++mPreallocIteration;
3588 
3589  int sizeDifference = newPreallocSize - mPreallocSize;
3590  mData.resize(mData.size() + sizeDifference);
3591  std::copy_backward(mData.begin() + mPreallocSize,
3592  mData.end() - sizeDifference, mData.end());
3593  mPreallocSize = newPreallocSize;
3594 }
3595 
3612 template <class DataType>
3614  const int totalAlloc = mData.capacity();
3615  const int postAllocSize = totalAlloc - mData.size();
3616  const int usedSize = size();
3617  bool shrinkPostAllocation = false;
3618  bool shrinkPreAllocation = false;
3619  if (totalAlloc > 650000) // if allocation is larger, shrink earlier with
3620  // respect to total used size
3621  {
3622  shrinkPostAllocation =
3623  postAllocSize >
3624  usedSize * 1.5; // QVector grow strategy is 2^n for static data. Watch
3625  // out not to oscillate!
3626  shrinkPreAllocation = mPreallocSize * 10 > usedSize;
3627  } else if (totalAlloc >
3628  1000) // below 10 MiB raw data be generous with preallocated
3629  // memory, below 1k points don't even bother
3630  {
3631  shrinkPostAllocation = postAllocSize > usedSize * 5;
3632  shrinkPreAllocation =
3633  mPreallocSize > usedSize * 1.5; // preallocation can grow into
3634  // postallocation, so can be smaller
3635  }
3636 
3637  if (shrinkPreAllocation || shrinkPostAllocation)
3638  squeeze(shrinkPreAllocation, shrinkPostAllocation);
3639 }
3640 /* end of 'src/datacontainer.cpp' */
3641 
3642 /* end of 'src/datacontainer.h' */
3643 
3644 /* including file 'src/plottable.h', size 8433 */
3645 /* commit ce344b3f96a62e5f652585e55f1ae7c7883cd45b 2018-06-25 01:03:39 +0200 */
3646 
3648  Q_GADGET
3649  public:
3652 
3653  // getters:
3654  QPen pen() const { return mPen; }
3655  QBrush brush() const { return mBrush; }
3656  QCPScatterStyle scatterStyle() const { return mScatterStyle; }
3657  QCPScatterStyle::ScatterProperties usedScatterProperties() const {
3658  return mUsedScatterProperties;
3659  }
3660 
3661  // setters:
3662  void setPen(const QPen &pen);
3663  void setBrush(const QBrush &brush);
3664  void setScatterStyle(const QCPScatterStyle &scatterStyle,
3665  QCPScatterStyle::ScatterProperties usedProperties =
3668  const QCPScatterStyle::ScatterProperties &properties);
3669 
3670  // non-virtual methods:
3671  void applyPen(QCPPainter *painter) const;
3672  void applyBrush(QCPPainter *painter) const;
3674  const QCPScatterStyle &unselectedStyle) const;
3675 
3676  // introduced virtual methods:
3677  virtual void copyFrom(const QCPSelectionDecorator *other);
3678  virtual void drawDecoration(QCPPainter *painter, QCPDataSelection selection);
3679 
3680  protected:
3681  // property members:
3682  QPen mPen;
3683  QBrush mBrush;
3685  QCPScatterStyle::ScatterProperties mUsedScatterProperties;
3686  // non-property members:
3688 
3689  // introduced virtual methods:
3691 
3692  private:
3693  Q_DISABLE_COPY(QCPSelectionDecorator)
3694  friend class QCPAbstractPlottable;
3695 };
3696 Q_DECLARE_METATYPE(QCPSelectionDecorator *)
3697 
3699  Q_OBJECT
3701  Q_PROPERTY(QString name READ name WRITE setName)
3702  Q_PROPERTY(bool antialiasedFill READ antialiasedFill WRITE setAntialiasedFill)
3703  Q_PROPERTY(bool antialiasedScatters READ antialiasedScatters WRITE
3704  setAntialiasedScatters)
3705  Q_PROPERTY(QPen pen READ pen WRITE setPen)
3706  Q_PROPERTY(QBrush brush READ brush WRITE setBrush)
3707  Q_PROPERTY(QCPAxis *keyAxis READ keyAxis WRITE setKeyAxis)
3708  Q_PROPERTY(QCPAxis *valueAxis READ valueAxis WRITE setValueAxis)
3709  Q_PROPERTY(QCP::SelectionType selectable READ selectable WRITE setSelectable
3710  NOTIFY selectableChanged)
3711  Q_PROPERTY(QCPDataSelection selection READ selection WRITE setSelection NOTIFY
3712  selectionChanged)
3713  Q_PROPERTY(QCPSelectionDecorator *selectionDecorator READ selectionDecorator
3714  WRITE setSelectionDecorator)
3716  public:
3717  QCPAbstractPlottable(QCPAxis *keyAxis, QCPAxis *valueAxis);
3719 
3720  // getters:
3721  QString name() const { return mName; }
3722  bool antialiasedFill() const { return mAntialiasedFill; }
3723  bool antialiasedScatters() const { return mAntialiasedScatters; }
3724  QPen pen() const { return mPen; }
3725  QBrush brush() const { return mBrush; }
3726  QCPAxis *keyAxis() const { return mKeyAxis.data(); }
3727  QCPAxis *valueAxis() const { return mValueAxis.data(); }
3728  QCP::SelectionType selectable() const { return mSelectable; }
3729  bool selected() const { return !mSelection.isEmpty(); }
3730  QCPDataSelection selection() const { return mSelection; }
3732  return mSelectionDecorator;
3733  }
3734 
3735  // setters:
3736  void setName(const QString &name);
3737  void setAntialiasedFill(bool enabled);
3738  void setAntialiasedScatters(bool enabled);
3739  void setPen(const QPen &pen);
3740  void setBrush(const QBrush &brush);
3741  void setKeyAxis(QCPAxis *axis);
3742  void setValueAxis(QCPAxis *axis);
3743  Q_SLOT void setSelectable(QCP::SelectionType selectable);
3744  Q_SLOT void setSelection(QCPDataSelection selection);
3746 
3747  // introduced virtual methods:
3748  virtual double selectTest(const QPointF &pos, bool onlySelectable,
3749  QVariant *details = 0) const
3750  Q_DECL_OVERRIDE = 0; // actually introduced in QCPLayerable as non-pure,
3751  // but we want to force reimplementation for
3752  // plottables
3753  virtual QCPPlottableInterface1D *interface1D() { return 0; }
3755  bool &foundRange, QCP::SignDomain inSignDomain = QCP::sdBoth) const = 0;
3757  bool &foundRange, QCP::SignDomain inSignDomain = QCP::sdBoth,
3758  const QCPRange &inKeyRange = QCPRange()) const = 0;
3759 
3760  // non-property methods:
3761  void coordsToPixels(double key, double value, double &x, double &y) const;
3762  const QPointF coordsToPixels(double key, double value) const;
3763  void pixelsToCoords(double x, double y, double &key, double &value) const;
3764  void pixelsToCoords(const QPointF &pixelPos, double &key,
3765  double &value) const;
3766  void rescaleAxes(bool onlyEnlarge = false) const;
3767  void rescaleKeyAxis(bool onlyEnlarge = false) const;
3768  void rescaleValueAxis(bool onlyEnlarge = false,
3769  bool inKeyRange = false) const;
3770  bool addToLegend(QCPLegend *legend);
3771  bool addToLegend();
3772  bool removeFromLegend(QCPLegend *legend) const;
3773  bool removeFromLegend() const;
3774 
3775  signals:
3776  void selectionChanged(bool selected);
3777  void selectionChanged(const QCPDataSelection &selection);
3779 
3780  protected:
3781  // property members:
3782  QString mName;
3783  bool mAntialiasedFill, mAntialiasedScatters;
3784  QPen mPen;
3785  QBrush mBrush;
3786  QPointer<QCPAxis> mKeyAxis, mValueAxis;
3790 
3791  // reimplemented virtual methods:
3792  virtual QRect clipRect() const Q_DECL_OVERRIDE;
3793  virtual void draw(QCPPainter *painter) Q_DECL_OVERRIDE = 0;
3794  virtual QCP::Interaction selectionCategory() const Q_DECL_OVERRIDE;
3795  void applyDefaultAntialiasingHint(QCPPainter *painter) const Q_DECL_OVERRIDE;
3796  // events:
3797  virtual void selectEvent(QMouseEvent *event, bool additive,
3798  const QVariant &details,
3799  bool *selectionStateChanged) Q_DECL_OVERRIDE;
3800  virtual void deselectEvent(bool *selectionStateChanged) Q_DECL_OVERRIDE;
3801 
3802  // introduced virtual methods:
3803  virtual void drawLegendIcon(QCPPainter *painter,
3804  const QRectF &rect) const = 0;
3805 
3806  // non-virtual methods:
3807  void applyFillAntialiasingHint(QCPPainter *painter) const;
3808  void applyScattersAntialiasingHint(QCPPainter *painter) const;
3809 
3810  private:
3811  Q_DISABLE_COPY(QCPAbstractPlottable)
3812 
3813  friend class QCustomPlot;
3814  friend class QCPAxis;
3815  friend class QCPPlottableLegendItem;
3816 };
3817 
3818 /* end of 'src/plottable.h' */
3819 
3820 /* including file 'src/item.h', size 9384 */
3821 /* commit ce344b3f96a62e5f652585e55f1ae7c7883cd45b 2018-06-25 01:03:39 +0200 */
3822 
3824  Q_GADGET
3825  public:
3826  QCPItemAnchor(QCustomPlot *parentPlot, QCPAbstractItem *parentItem,
3827  const QString &name, int anchorId = -1);
3828  virtual ~QCPItemAnchor();
3829 
3830  // getters:
3831  QString name() const { return mName; }
3832  virtual QPointF pixelPosition() const;
3833 
3834  protected:
3835  // property members:
3836  QString mName;
3837 
3838  // non-property members:
3839  QCustomPlot *mParentPlot;
3840  QCPAbstractItem *mParentItem;
3841  int mAnchorId;
3842  QSet<QCPItemPosition *> mChildrenX, mChildrenY;
3843 
3844  // introduced virtual methods:
3845  virtual QCPItemPosition *toQCPItemPosition() { return 0; }
3846 
3847  // non-virtual methods:
3849  pos); // called from pos when this anchor is set as parent
3850  void removeChildX(QCPItemPosition *pos); // called from pos when its parent
3851  // anchor is reset or pos deleted
3853  pos); // called from pos when this anchor is set as parent
3854  void removeChildY(QCPItemPosition *pos); // called from pos when its parent
3855  // anchor is reset or pos deleted
3856 
3857  private:
3858  Q_DISABLE_COPY(QCPItemAnchor)
3859 
3860  friend class QCPItemPosition;
3861 };
3862 
3864  Q_GADGET
3865  public:
3873  ptAbsolute
3875  ,
3876  ptViewportRatio
3883  ,
3884  ptAxisRectRatio
3893  ,
3894  ptPlotCoords
3896  };
3897  Q_ENUMS(PositionType)
3898 
3899  QCPItemPosition(QCustomPlot *parentPlot, QCPAbstractItem *parentItem,
3900  const QString &name);
3901  virtual ~QCPItemPosition();
3902 
3903  // getters:
3904  PositionType type() const { return typeX(); }
3905  PositionType typeX() const { return mPositionTypeX; }
3906  PositionType typeY() const { return mPositionTypeY; }
3907  QCPItemAnchor *parentAnchor() const { return parentAnchorX(); }
3908  QCPItemAnchor *parentAnchorX() const { return mParentAnchorX; }
3909  QCPItemAnchor *parentAnchorY() const { return mParentAnchorY; }
3910  double key() const { return mKey; }
3911  double value() const { return mValue; }
3912  QPointF coords() const { return QPointF(mKey, mValue); }
3913  QCPAxis *keyAxis() const { return mKeyAxis.data(); }
3914  QCPAxis *valueAxis() const { return mValueAxis.data(); }
3916  virtual QPointF pixelPosition() const Q_DECL_OVERRIDE;
3917 
3918  // setters:
3919  void setType(PositionType type);
3920  void setTypeX(PositionType type);
3921  void setTypeY(PositionType type);
3922  bool setParentAnchor(QCPItemAnchor *parentAnchor,
3923  bool keepPixelPosition = false);
3924  bool setParentAnchorX(QCPItemAnchor *parentAnchor,
3925  bool keepPixelPosition = false);
3926  bool setParentAnchorY(QCPItemAnchor *parentAnchor,
3927  bool keepPixelPosition = false);
3928  void setCoords(double key, double value);
3929  void setCoords(const QPointF &coords);
3930  void setAxes(QCPAxis *keyAxis, QCPAxis *valueAxis);
3931  void setAxisRect(QCPAxisRect *axisRect);
3932  void setPixelPosition(const QPointF &pixelPosition);
3933 
3934  protected:
3935  // property members:
3936  PositionType mPositionTypeX, mPositionTypeY;
3937  QPointer<QCPAxis> mKeyAxis, mValueAxis;
3938  QPointer<QCPAxisRect> mAxisRect;
3939  double mKey, mValue;
3940  QCPItemAnchor *mParentAnchorX, *mParentAnchorY;
3941 
3942  // reimplemented virtual methods:
3943  virtual QCPItemPosition *toQCPItemPosition() Q_DECL_OVERRIDE { return this; }
3944 
3945  private:
3946  Q_DISABLE_COPY(QCPItemPosition)
3947 };
3948 Q_DECLARE_METATYPE(QCPItemPosition::PositionType)
3949 
3950 class QCP_LIB_DECL QCPAbstractItem : public QCPLayerable {
3951  Q_OBJECT
3953  Q_PROPERTY(bool clipToAxisRect READ clipToAxisRect WRITE setClipToAxisRect)
3954  Q_PROPERTY(QCPAxisRect *clipAxisRect READ clipAxisRect WRITE setClipAxisRect)
3955  Q_PROPERTY(bool selectable READ selectable WRITE setSelectable NOTIFY
3956  selectableChanged)
3957  Q_PROPERTY(
3958  bool selected READ selected WRITE setSelected NOTIFY selectionChanged)
3960  public:
3961  explicit QCPAbstractItem(QCustomPlot *parentPlot);
3962  virtual ~QCPAbstractItem();
3963 
3964  // getters:
3965  bool clipToAxisRect() const { return mClipToAxisRect; }
3967  bool selectable() const { return mSelectable; }
3968  bool selected() const { return mSelected; }
3969 
3970  // setters:
3971  void setClipToAxisRect(bool clip);
3973  Q_SLOT void setSelectable(bool selectable);
3974  Q_SLOT void setSelected(bool selected);
3975 
3976  // reimplemented virtual methods:
3977  virtual double selectTest(const QPointF &pos, bool onlySelectable,
3978  QVariant *details = 0) const Q_DECL_OVERRIDE = 0;
3979 
3980  // non-virtual methods:
3981  QList<QCPItemPosition *> positions() const { return mPositions; }
3982  QList<QCPItemAnchor *> anchors() const { return mAnchors; }
3983  QCPItemPosition *position(const QString &name) const;
3984  QCPItemAnchor *anchor(const QString &name) const;
3985  bool hasAnchor(const QString &name) const;
3986 
3987  signals:
3988  void selectionChanged(bool selected);
3989  void selectableChanged(bool selectable);
3990 
3991  protected:
3992  // property members:
3993  bool mClipToAxisRect;
3994  QPointer<QCPAxisRect> mClipAxisRect;
3995  QList<QCPItemPosition *> mPositions;
3996  QList<QCPItemAnchor *> mAnchors;
3997  bool mSelectable, mSelected;
3998 
3999  // reimplemented virtual methods:
4001  virtual QRect clipRect() const Q_DECL_OVERRIDE;
4002  virtual void applyDefaultAntialiasingHint(QCPPainter *painter) const
4004  virtual void draw(QCPPainter *painter) Q_DECL_OVERRIDE = 0;
4005  // events:
4006  virtual void selectEvent(QMouseEvent *event, bool additive,
4007  const QVariant &details,
4008  bool *selectionStateChanged) Q_DECL_OVERRIDE;
4009  virtual void deselectEvent(bool *selectionStateChanged) Q_DECL_OVERRIDE;
4010 
4011  // introduced virtual methods:
4012  virtual QPointF anchorPixelPosition(int anchorId) const;
4013 
4014  // non-virtual methods:
4015  double rectDistance(const QRectF &rect, const QPointF &pos,
4016  bool filledRect) const;
4017  QCPItemPosition *createPosition(const QString &name);
4018  QCPItemAnchor *createAnchor(const QString &name, int anchorId);
4019 
4020  private:
4021  Q_DISABLE_COPY(QCPAbstractItem)
4022 
4023  friend class QCustomPlot;
4024  friend class QCPItemAnchor;
4025 };
4026 
4027 /* end of 'src/item.h' */
4028 
4029 /* including file 'src/core.h', size 14886 */
4030 /* commit ce344b3f96a62e5f652585e55f1ae7c7883cd45b 2018-06-25 01:03:39 +0200 */
4031 
4032 class QCP_LIB_DECL QCustomPlot : public QWidget {
4033  Q_OBJECT
4035  Q_PROPERTY(QRect viewport READ viewport WRITE setViewport)
4036  Q_PROPERTY(QPixmap background READ background WRITE setBackground)
4037  Q_PROPERTY(
4038  bool backgroundScaled READ backgroundScaled WRITE setBackgroundScaled)
4039  Q_PROPERTY(Qt::AspectRatioMode backgroundScaledMode READ backgroundScaledMode
4040  WRITE setBackgroundScaledMode)
4041  Q_PROPERTY(QCPLayoutGrid *plotLayout READ plotLayout)
4042  Q_PROPERTY(bool autoAddPlottableToLegend READ autoAddPlottableToLegend WRITE
4043  setAutoAddPlottableToLegend)
4044  Q_PROPERTY(int selectionTolerance READ selectionTolerance WRITE
4045  setSelectionTolerance)
4046  Q_PROPERTY(bool noAntialiasingOnDrag READ noAntialiasingOnDrag WRITE
4047  setNoAntialiasingOnDrag)
4048  Q_PROPERTY(Qt::KeyboardModifier multiSelectModifier READ multiSelectModifier
4049  WRITE setMultiSelectModifier)
4050  Q_PROPERTY(bool openGl READ openGl WRITE setOpenGl)
4052  public:
4059  limBelow
4060  ,
4061  limAbove
4062  };
4063  Q_ENUMS(LayerInsertMode)
4064 
4065 
4072  rpImmediateRefresh
4075  ,
4076  rpQueuedRefresh
4079  ,
4080  rpRefreshHint
4083  ,
4084  rpQueuedReplot
4088  };
4089  Q_ENUMS(RefreshPriority)
4090 
4091  explicit QCustomPlot(QWidget *parent = 0);
4092  virtual ~QCustomPlot();
4093 
4094  // getters:
4095  QRect viewport() const { return mViewport; }
4096  double bufferDevicePixelRatio() const { return mBufferDevicePixelRatio; }
4097  QPixmap background() const { return mBackgroundPixmap; }
4098  bool backgroundScaled() const { return mBackgroundScaled; }
4099  Qt::AspectRatioMode backgroundScaledMode() const {
4100  return mBackgroundScaledMode;
4101  }
4102  QCPLayoutGrid *plotLayout() const { return mPlotLayout; }
4103  QCP::AntialiasedElements antialiasedElements() const {
4104  return mAntialiasedElements;
4105  }
4106  QCP::AntialiasedElements notAntialiasedElements() const {
4107  return mNotAntialiasedElements;
4108  }
4109  bool autoAddPlottableToLegend() const { return mAutoAddPlottableToLegend; }
4110  const QCP::Interactions interactions() const { return mInteractions; }
4111  int selectionTolerance() const { return mSelectionTolerance; }
4112  bool noAntialiasingOnDrag() const { return mNoAntialiasingOnDrag; }
4113  QCP::PlottingHints plottingHints() const { return mPlottingHints; }
4114  Qt::KeyboardModifier multiSelectModifier() const {
4115  return mMultiSelectModifier;
4116  }
4118  return mSelectionRectMode;
4119  }
4120  QCPSelectionRect *selectionRect() const { return mSelectionRect; }
4121  bool openGl() const { return mOpenGl; }
4122 
4123  // setters:
4124  void setViewport(const QRect &rect);
4125  void setBufferDevicePixelRatio(double ratio);
4126  void setBackground(const QPixmap &pm);
4127  void setBackground(const QPixmap &pm, bool scaled,
4128  Qt::AspectRatioMode mode = Qt::KeepAspectRatioByExpanding);
4129  void setBackground(const QBrush &brush);
4130  void setBackgroundScaled(bool scaled);
4131  void setBackgroundScaledMode(Qt::AspectRatioMode mode);
4133  const QCP::AntialiasedElements &antialiasedElements);
4135  bool enabled = true);
4137  const QCP::AntialiasedElements &notAntialiasedElements);
4139  bool enabled = true);
4141  void setInteractions(const QCP::Interactions &interactions);
4142  void setInteraction(const QCP::Interaction &interaction, bool enabled = true);
4143  void setSelectionTolerance(int pixels);
4144  void setNoAntialiasingOnDrag(bool enabled);
4145  void setPlottingHints(const QCP::PlottingHints &hints);
4146  void setPlottingHint(QCP::PlottingHint hint, bool enabled = true);
4147  void setMultiSelectModifier(Qt::KeyboardModifier modifier);
4149  void setSelectionRect(QCPSelectionRect *selectionRect);
4150  void setOpenGl(bool enabled, int multisampling = 16);
4151 
4152  // non-property methods:
4153  // plottable interface:
4157  bool removePlottable(int index);
4159  int plottableCount() const;
4160  QList<QCPAbstractPlottable *> selectedPlottables() const;
4161  QCPAbstractPlottable *plottableAt(const QPointF &pos,
4162  bool onlySelectable = false) const;
4163  bool hasPlottable(QCPAbstractPlottable *plottable) const;
4164 
4165  // specialized interface for QCPGraph:
4166  QCPGraph *graph(int index) const;
4167  QCPGraph *graph() const;
4168  QCPGraph *addGraph(QCPAxis *keyAxis = 0, QCPAxis *valueAxis = 0);
4169  bool removeGraph(QCPGraph *graph);
4170  bool removeGraph(int index);
4172  int graphCount() const;
4173  QList<QCPGraph *> selectedGraphs() const;
4174 
4175  // item interface:
4176  QCPAbstractItem *item(int index) const;
4179  bool removeItem(int index);
4180  int clearItems();
4181  int itemCount() const;
4182  QList<QCPAbstractItem *> selectedItems() const;
4183  QCPAbstractItem *itemAt(const QPointF &pos,
4184  bool onlySelectable = false) const;
4185  bool hasItem(QCPAbstractItem *item) const;
4186 
4187  // layer interface:
4188  QCPLayer *layer(const QString &name) const;
4189  QCPLayer *layer(int index) const;
4191  bool setCurrentLayer(const QString &name);
4193  int layerCount() const;
4194  bool addLayer(const QString &name, QCPLayer *otherLayer = 0,
4195  LayerInsertMode insertMode = limAbove);
4196  bool removeLayer(QCPLayer *layer);
4197  bool moveLayer(QCPLayer *layer, QCPLayer *otherLayer,
4198  LayerInsertMode insertMode = limAbove);
4199 
4200  // axis rect/layout interface:
4201  int axisRectCount() const;
4202  QCPAxisRect *axisRect(int index = 0) const;
4203  QList<QCPAxisRect *> axisRects() const;
4204  QCPLayoutElement *layoutElementAt(const QPointF &pos) const;
4205  QCPAxisRect *axisRectAt(const QPointF &pos) const;
4206  Q_SLOT void rescaleAxes(bool onlyVisiblePlottables = false);
4207 
4208  QList<QCPAxis *> selectedAxes() const;
4209  QList<QCPLegend *> selectedLegends() const;
4210  Q_SLOT void deselectAll();
4211 
4212  bool savePdf(const QString &fileName, int width = 0, int height = 0,
4214  const QString &pdfCreator = QString(),
4215  const QString &pdfTitle = QString());
4216  bool savePng(const QString &fileName, int width = 0, int height = 0,
4217  double scale = 1.0, int quality = -1, int resolution = 96,
4218  QCP::ResolutionUnit resolutionUnit = QCP::ruDotsPerInch);
4219  bool saveJpg(const QString &fileName, int width = 0, int height = 0,
4220  double scale = 1.0, int quality = -1, int resolution = 96,
4221  QCP::ResolutionUnit resolutionUnit = QCP::ruDotsPerInch);
4222  bool saveBmp(const QString &fileName, int width = 0, int height = 0,
4223  double scale = 1.0, int resolution = 96,
4224  QCP::ResolutionUnit resolutionUnit = QCP::ruDotsPerInch);
4225  bool saveRastered(const QString &fileName, int width, int height,
4226  double scale, const char *format, int quality = -1,
4227  int resolution = 96,
4228  QCP::ResolutionUnit resolutionUnit = QCP::ruDotsPerInch);
4229  QPixmap toPixmap(int width = 0, int height = 0, double scale = 1.0);
4230  void toPainter(QCPPainter *painter, int width = 0, int height = 0);
4231  Q_SLOT void replot(QCustomPlot::RefreshPriority refreshPriority =
4233 
4234  QCPAxis *xAxis, *yAxis, *xAxis2, *yAxis2;
4235  QCPLegend *legend;
4236 
4237  signals:
4238  void mouseDoubleClick(QMouseEvent *event);
4239  void mousePress(QMouseEvent *event);
4240  void mouseMove(QMouseEvent *event);
4241  void mouseRelease(QMouseEvent *event);
4242  void mouseWheel(QWheelEvent *event);
4243 
4244  void plottableClick(QCPAbstractPlottable *plottable, int dataIndex,
4245  QMouseEvent *event);
4246  void plottableDoubleClick(QCPAbstractPlottable *plottable, int dataIndex,
4247  QMouseEvent *event);
4248  void itemClick(QCPAbstractItem *item, QMouseEvent *event);
4249  void itemDoubleClick(QCPAbstractItem *item, QMouseEvent *event);
4251  QMouseEvent *event);
4253  QMouseEvent *event);
4255  QMouseEvent *event);
4257  QMouseEvent *event);
4258 
4261  void afterReplot();
4262 
4263  protected:
4264  // property members:
4265  QRect mViewport;
4267  QCPLayoutGrid *mPlotLayout;
4268  bool mAutoAddPlottableToLegend;
4269  QList<QCPAbstractPlottable *> mPlottables;
4270  QList<QCPGraph *> mGraphs; // extra list of plottables also in mPlottables
4271  // that are of type QCPGraph
4272  QList<QCPAbstractItem *> mItems;
4273  QList<QCPLayer *> mLayers;
4274  QCP::AntialiasedElements mAntialiasedElements, mNotAntialiasedElements;
4275  QCP::Interactions mInteractions;
4276  int mSelectionTolerance;
4277  bool mNoAntialiasingOnDrag;
4278  QBrush mBackgroundBrush;
4279  QPixmap mBackgroundPixmap;
4280  QPixmap mScaledBackgroundPixmap;
4281  bool mBackgroundScaled;
4282  Qt::AspectRatioMode mBackgroundScaledMode;
4283  QCPLayer *mCurrentLayer;
4284  QCP::PlottingHints mPlottingHints;
4285  Qt::KeyboardModifier mMultiSelectModifier;
4288  bool mOpenGl;
4289 
4290  // non-property members:
4291  QList<QSharedPointer<QCPAbstractPaintBuffer> > mPaintBuffers;
4292  QPoint mMousePressPos;
4294  QPointer<QCPLayerable> mMouseEventLayerable;
4295  QPointer<QCPLayerable> mMouseSignalLayerable;
4298  bool mReplotting;
4301  QCP::AntialiasedElements mOpenGlAntialiasedElementsBackup;
4303 #ifdef QCP_OPENGL_FBO
4304  QSharedPointer<QOpenGLContext> mGlContext;
4305  QSharedPointer<QSurface> mGlSurface;
4306  QSharedPointer<QOpenGLPaintDevice> mGlPaintDevice;
4307 #endif
4308 
4309  // reimplemented virtual methods:
4310  virtual QSize minimumSizeHint() const Q_DECL_OVERRIDE;
4311  virtual QSize sizeHint() const Q_DECL_OVERRIDE;
4312  virtual void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE;
4313  virtual void resizeEvent(QResizeEvent *event) Q_DECL_OVERRIDE;
4314  virtual void mouseDoubleClickEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
4315  virtual void mousePressEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
4316  virtual void mouseMoveEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
4317  virtual void mouseReleaseEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
4318  virtual void wheelEvent(QWheelEvent *event) Q_DECL_OVERRIDE;
4319 
4320  // introduced virtual methods:
4321  virtual void draw(QCPPainter *painter);
4322  virtual void updateLayout();
4323  virtual void axisRemoved(QCPAxis *axis);
4324  virtual void legendRemoved(QCPLegend *legend);
4325  Q_SLOT virtual void processRectSelection(QRect rect, QMouseEvent *event);
4326  Q_SLOT virtual void processRectZoom(QRect rect, QMouseEvent *event);
4327  Q_SLOT virtual void processPointSelection(QMouseEvent *event);
4328 
4329  // non-virtual methods:
4330  bool registerPlottable(QCPAbstractPlottable *plottable);
4331  bool registerGraph(QCPGraph *graph);
4332  bool registerItem(QCPAbstractItem *item);
4333  void updateLayerIndices() const;
4334  QCPLayerable *layerableAt(const QPointF &pos, bool onlySelectable,
4335  QVariant *selectionDetails = 0) const;
4336  QList<QCPLayerable *> layerableListAt(
4337  const QPointF &pos, bool onlySelectable,
4338  QList<QVariant> *selectionDetails = 0) const;
4339  void drawBackground(QCPPainter *painter);
4340  void setupPaintBuffers();
4341  QCPAbstractPaintBuffer *createPaintBuffer();
4342  bool hasInvalidatedPaintBuffers();
4343  bool setupOpenGl();
4344  void freeOpenGl();
4345 
4346  friend class QCPLegend;
4347  friend class QCPAxis;
4348  friend class QCPLayer;
4349  friend class QCPAxisRect;
4350  friend class QCPAbstractPlottable;
4351  friend class QCPGraph;
4352  friend class QCPAbstractItem;
4353 };
4354 Q_DECLARE_METATYPE(QCustomPlot::LayerInsertMode)
4355 Q_DECLARE_METATYPE(QCustomPlot::RefreshPriority)
4356 
4357 /* end of 'src/core.h' */
4358 
4359 /* including file 'src/plottable1d.h', size 4544 */
4360 /* commit ce344b3f96a62e5f652585e55f1ae7c7883cd45b 2018-06-25 01:03:39 +0200 */
4361 
4363  public:
4365  // introduced pure virtual methods:
4366  virtual int dataCount() const = 0;
4367  virtual double dataMainKey(int index) const = 0;
4368  virtual double dataSortKey(int index) const = 0;
4369  virtual double dataMainValue(int index) const = 0;
4370  virtual QCPRange dataValueRange(int index) const = 0;
4371  virtual QPointF dataPixelPosition(int index) const = 0;
4372  virtual bool sortKeyIsMainKey() const = 0;
4373  virtual QCPDataSelection selectTestRect(const QRectF &rect,
4374  bool onlySelectable) const = 0;
4375  virtual int findBegin(double sortKey, bool expandedRange = true) const = 0;
4376  virtual int findEnd(double sortKey, bool expandedRange = true) const = 0;
4377 };
4378 
4379 template <class DataType>
4381  : public QCPAbstractPlottable,
4382  public QCPPlottableInterface1D // no QCP_LIB_DECL, template class ends up
4383  // in header (cpp included below)
4384 {
4385  // No Q_OBJECT macro due to template class
4386 
4387  public:
4388  QCPAbstractPlottable1D(QCPAxis *keyAxis, QCPAxis *valueAxis);
4390 
4391  // virtual methods of 1d plottable interface:
4392  virtual int dataCount() const Q_DECL_OVERRIDE;
4393  virtual double dataMainKey(int index) const Q_DECL_OVERRIDE;
4394  virtual double dataSortKey(int index) const Q_DECL_OVERRIDE;
4395  virtual double dataMainValue(int index) const Q_DECL_OVERRIDE;
4396  virtual QCPRange dataValueRange(int index) const Q_DECL_OVERRIDE;
4397  virtual QPointF dataPixelPosition(int index) const Q_DECL_OVERRIDE;
4398  virtual bool sortKeyIsMainKey() const Q_DECL_OVERRIDE;
4399  virtual QCPDataSelection selectTestRect(
4400  const QRectF &rect, bool onlySelectable) const Q_DECL_OVERRIDE;
4401  virtual int findBegin(double sortKey,
4402  bool expandedRange = true) const Q_DECL_OVERRIDE;
4403  virtual int findEnd(double sortKey,
4404  bool expandedRange = true) const Q_DECL_OVERRIDE;
4405 
4406  // reimplemented virtual methods:
4407  virtual double selectTest(const QPointF &pos, bool onlySelectable,
4408  QVariant *details = 0) const Q_DECL_OVERRIDE;
4409  virtual QCPPlottableInterface1D *interface1D() Q_DECL_OVERRIDE {
4410  return this;
4411  }
4412 
4413  protected:
4414  // property members:
4415  QSharedPointer<QCPDataContainer<DataType> > mDataContainer;
4416 
4417  // helpers for subclasses:
4418  void getDataSegments(QList<QCPDataRange> &selectedSegments,
4419  QList<QCPDataRange> &unselectedSegments) const;
4420  void drawPolyline(QCPPainter *painter,
4421  const QVector<QPointF> &lineData) const;
4422 
4423  private:
4424  Q_DISABLE_COPY(QCPAbstractPlottable1D)
4425 };
4426 
4427 // include implementation in header since it is a class template:
4428 
4429 /* including file 'src/plottable1d.cpp', size 22361 */
4430 /* commit ce344b3f96a62e5f652585e55f1ae7c7883cd45b 2018-06-25 01:03:39 +0200 */
4431 
4435 
4462 /* start documentation of pure virtual functions */
4463 
4588 /* end documentation of pure virtual functions */
4589 
4593 
4623 /* start documentation of inline functions */
4624 
4633 /* end documentation of inline functions */
4634 
4640 template <class DataType>
4642  QCPAxis *valueAxis)
4643  : QCPAbstractPlottable(keyAxis, valueAxis),
4644  mDataContainer(new QCPDataContainer<DataType>) {}
4645 
4646 template <class DataType>
4648 
4652 template <class DataType>
4654  return mDataContainer->size();
4655 }
4656 
4660 template <class DataType>
4662  if (index >= 0 && index < mDataContainer->size()) {
4663  return (mDataContainer->constBegin() + index)->mainKey();
4664  } else {
4665  qDebug() << Q_FUNC_INFO << "Index out of bounds" << index;
4666  return 0;
4667  }
4668 }
4669 
4673 template <class DataType>
4675  if (index >= 0 && index < mDataContainer->size()) {
4676  return (mDataContainer->constBegin() + index)->sortKey();
4677  } else {
4678  qDebug() << Q_FUNC_INFO << "Index out of bounds" << index;
4679  return 0;
4680  }
4681 }
4682 
4686 template <class DataType>
4688  if (index >= 0 && index < mDataContainer->size()) {
4689  return (mDataContainer->constBegin() + index)->mainValue();
4690  } else {
4691  qDebug() << Q_FUNC_INFO << "Index out of bounds" << index;
4692  return 0;
4693  }
4694 }
4695 
4699 template <class DataType>
4701  if (index >= 0 && index < mDataContainer->size()) {
4702  return (mDataContainer->constBegin() + index)->valueRange();
4703  } else {
4704  qDebug() << Q_FUNC_INFO << "Index out of bounds" << index;
4705  return QCPRange(0, 0);
4706  }
4707 }
4708 
4712 template <class DataType>
4714  if (index >= 0 && index < mDataContainer->size()) {
4715  const typename QCPDataContainer<DataType>::const_iterator it =
4716  mDataContainer->constBegin() + index;
4717  return coordsToPixels(it->mainKey(), it->mainValue());
4718  } else {
4719  qDebug() << Q_FUNC_INFO << "Index out of bounds" << index;
4720  return QPointF();
4721  }
4722 }
4723 
4727 template <class DataType>
4729  return DataType::sortKeyIsMainKey();
4730 }
4731 
4740 template <class DataType>
4742  const QRectF &rect, bool onlySelectable) const {
4743  QCPDataSelection result;
4744  if ((onlySelectable && mSelectable == QCP::stNone) ||
4745  mDataContainer->isEmpty())
4746  return result;
4747  if (!mKeyAxis || !mValueAxis) return result;
4748 
4749  // convert rect given in pixels to ranges given in plot coordinates:
4750  double key1, value1, key2, value2;
4751  pixelsToCoords(rect.topLeft(), key1, value1);
4752  pixelsToCoords(rect.bottomRight(), key2, value2);
4753  QCPRange keyRange(key1, key2); // QCPRange normalizes internally so we don't
4754  // have to care about whether key1 < key2
4755  QCPRange valueRange(value1, value2);
4757  mDataContainer->constBegin();
4759  mDataContainer->constEnd();
4760  if (DataType::sortKeyIsMainKey()) // we can assume that data is sorted by
4761  // main key, so can reduce the searched key
4762  // interval:
4763  {
4764  begin = mDataContainer->findBegin(keyRange.lower, false);
4765  end = mDataContainer->findEnd(keyRange.upper, false);
4766  }
4767  if (begin == end) return result;
4768 
4769  int currentSegmentBegin =
4770  -1; // -1 means we're currently not in a segment that's contained in rect
4771  for (typename QCPDataContainer<DataType>::const_iterator it = begin;
4772  it != end; ++it) {
4773  if (currentSegmentBegin == -1) {
4774  if (valueRange.contains(it->mainValue()) &&
4775  keyRange.contains(it->mainKey())) // start segment
4776  currentSegmentBegin = it - mDataContainer->constBegin();
4777  } else if (!valueRange.contains(it->mainValue()) ||
4778  !keyRange.contains(it->mainKey())) // segment just ended
4779  {
4780  result.addDataRange(
4781  QCPDataRange(currentSegmentBegin, it - mDataContainer->constBegin()),
4782  false);
4783  currentSegmentBegin = -1;
4784  }
4785  }
4786  // process potential last segment:
4787  if (currentSegmentBegin != -1)
4788  result.addDataRange(
4789  QCPDataRange(currentSegmentBegin, end - mDataContainer->constBegin()),
4790  false);
4791 
4792  result.simplify();
4793  return result;
4794 }
4795 
4799 template <class DataType>
4801  bool expandedRange) const {
4802  return mDataContainer->findBegin(sortKey, expandedRange) -
4803  mDataContainer->constBegin();
4804 }
4805 
4809 template <class DataType>
4811  bool expandedRange) const {
4812  return mDataContainer->findEnd(sortKey, expandedRange) -
4813  mDataContainer->constBegin();
4814 }
4815 
4827 template <class DataType>
4829  bool onlySelectable,
4830  QVariant *details) const {
4831  if ((onlySelectable && mSelectable == QCP::stNone) ||
4832  mDataContainer->isEmpty())
4833  return -1;
4834  if (!mKeyAxis || !mValueAxis) return -1;
4835 
4836  QCPDataSelection selectionResult;
4837  double minDistSqr = (std::numeric_limits<double>::max)();
4838  int minDistIndex = mDataContainer->size();
4839 
4841  mDataContainer->constBegin();
4843  mDataContainer->constEnd();
4844  if (DataType::sortKeyIsMainKey()) // we can assume that data is sorted by
4845  // main key, so can reduce the searched key
4846  // interval:
4847  {
4848  // determine which key range comes into question, taking selection tolerance
4849  // around pos into account:
4850  double posKeyMin, posKeyMax, dummy;
4851  pixelsToCoords(pos - QPointF(mParentPlot->selectionTolerance(),
4852  mParentPlot->selectionTolerance()),
4853  posKeyMin, dummy);
4854  pixelsToCoords(pos + QPointF(mParentPlot->selectionTolerance(),
4855  mParentPlot->selectionTolerance()),
4856  posKeyMax, dummy);
4857  if (posKeyMin > posKeyMax) qSwap(posKeyMin, posKeyMax);
4858  begin = mDataContainer->findBegin(posKeyMin, true);
4859  end = mDataContainer->findEnd(posKeyMax, true);
4860  }
4861  if (begin == end) return -1;
4862  QCPRange keyRange(mKeyAxis->range());
4863  QCPRange valueRange(mValueAxis->range());
4864  for (typename QCPDataContainer<DataType>::const_iterator it = begin;
4865  it != end; ++it) {
4866  const double mainKey = it->mainKey();
4867  const double mainValue = it->mainValue();
4868  if (keyRange.contains(mainKey) &&
4869  valueRange.contains(
4870  mainValue)) // make sure data point is inside visible range, for
4871  // speedup in cases where sort key isn't main key and
4872  // we iterate over all points
4873  {
4874  const double currentDistSqr =
4875  QCPVector2D(coordsToPixels(mainKey, mainValue) - pos).lengthSquared();
4876  if (currentDistSqr < minDistSqr) {
4877  minDistSqr = currentDistSqr;
4878  minDistIndex = it - mDataContainer->constBegin();
4879  }
4880  }
4881  }
4882  if (minDistIndex != mDataContainer->size())
4883  selectionResult.addDataRange(QCPDataRange(minDistIndex, minDistIndex + 1),
4884  false);
4885 
4886  selectionResult.simplify();
4887  if (details) details->setValue(selectionResult);
4888  return qSqrt(minDistSqr);
4889 }
4890 
4901 template <class DataType>
4903  QList<QCPDataRange> &selectedSegments,
4904  QList<QCPDataRange> &unselectedSegments) const {
4905  selectedSegments.clear();
4906  unselectedSegments.clear();
4907  if (mSelectable ==
4908  QCP::stWhole) // stWhole selection type draws the entire plottable with
4909  // selected style if mSelection isn't empty
4910  {
4911  if (selected())
4912  selectedSegments << QCPDataRange(0, dataCount());
4913  else
4914  unselectedSegments << QCPDataRange(0, dataCount());
4915  } else {
4916  QCPDataSelection sel(selection());
4917  sel.simplify();
4918  selectedSegments = sel.dataRanges();
4919  unselectedSegments = sel.inverse(QCPDataRange(0, dataCount())).dataRanges();
4920  }
4921 }
4922 
4933 template <class DataType>
4935  QCPPainter *painter, const QVector<QPointF> &lineData) const {
4936  // if drawing solid line and not in PDF, use much faster line drawing instead
4937  // of polyline:
4938  if (mParentPlot->plottingHints().testFlag(QCP::phFastPolylines) &&
4939  painter->pen().style() == Qt::SolidLine &&
4940  !painter->modes().testFlag(QCPPainter::pmVectorized) &&
4941  !painter->modes().testFlag(QCPPainter::pmNoCaching)) {
4942  int i = 0;
4943  bool lastIsNan = false;
4944  const int lineDataSize = lineData.size();
4945  while (i < lineDataSize &&
4946  (qIsNaN(lineData.at(i).y()) ||
4947  qIsNaN(lineData.at(i).x()))) // make sure first point is not NaN
4948  ++i;
4949  ++i; // because drawing works in 1 point retrospect
4950  while (i < lineDataSize) {
4951  if (!qIsNaN(lineData.at(i).y()) &&
4952  !qIsNaN(lineData.at(i).x())) // NaNs create a gap in the line
4953  {
4954  if (!lastIsNan)
4955  painter->drawLine(lineData.at(i - 1), lineData.at(i));
4956  else
4957  lastIsNan = false;
4958  } else
4959  lastIsNan = true;
4960  ++i;
4961  }
4962  } else {
4963  int segmentStart = 0;
4964  int i = 0;
4965  const int lineDataSize = lineData.size();
4966  while (i < lineDataSize) {
4967  if (qIsNaN(lineData.at(i).y()) || qIsNaN(lineData.at(i).x()) ||
4968  qIsInf(
4969  lineData.at(i).y())) // NaNs create a gap in the line. Also
4970  // filter Infs which make drawPolyline block
4971  {
4972  painter->drawPolyline(
4973  lineData.constData() + segmentStart,
4974  i - segmentStart); // i, because we don't want to include the
4975  // current NaN point
4976  segmentStart = i + 1;
4977  }
4978  ++i;
4979  }
4980  // draw last segment:
4981  painter->drawPolyline(lineData.constData() + segmentStart,
4982  lineDataSize - segmentStart);
4983  }
4984 }
4985 /* end of 'src/plottable1d.cpp' */
4986 
4987 /* end of 'src/plottable1d.h' */
4988 
4989 /* including file 'src/colorgradient.h', size 6243 */
4990 /* commit ce344b3f96a62e5f652585e55f1ae7c7883cd45b 2018-06-25 01:03:39 +0200 */
4991 
4993  Q_GADGET
4994  public:
5002  ciRGB
5003  ,
5004  ciHSV
5007  };
5008  Q_ENUMS(ColorInterpolation)
5009 
5010 
5015  gpGrayscale
5017  ,
5018  gpHot
5020  ,
5021  gpCold
5023  ,
5024  gpNight
5026  ,
5027  gpCandy
5028  ,
5029  gpGeography
5031  ,
5032  gpIon
5035  ,
5036  gpThermal
5038  ,
5039  gpPolar
5042  ,
5043  gpSpectrum
5046  ,
5047  gpJet
5050  ,
5051  gpHues
5053  };
5054  Q_ENUMS(GradientPreset)
5055 
5058  bool operator==(const QCPColorGradient &other) const;
5059  bool operator!=(const QCPColorGradient &other) const {
5060  return !(*this == other);
5061  }
5062 
5063  // getters:
5064  int levelCount() const { return mLevelCount; }
5065  QMap<double, QColor> colorStops() const { return mColorStops; }
5066  ColorInterpolation colorInterpolation() const { return mColorInterpolation; }
5067  bool periodic() const { return mPeriodic; }
5068 
5069  // setters:
5070  void setLevelCount(int n);
5071  void setColorStops(const QMap<double, QColor> &colorStops);
5072  void setColorStopAt(double position, const QColor &color);
5074  void setPeriodic(bool enabled);
5075 
5076  // non-property methods:
5077  void colorize(const double *data, const QCPRange &range, QRgb *scanLine,
5078  int n, int dataIndexFactor = 1, bool logarithmic = false);
5079  void colorize(const double *data, const unsigned char *alpha,
5080  const QCPRange &range, QRgb *scanLine, int n,
5081  int dataIndexFactor = 1, bool logarithmic = false);
5082  QRgb color(double position, const QCPRange &range, bool logarithmic = false);
5086 
5087  protected:
5088  // property members:
5089  int mLevelCount;
5090  QMap<double, QColor> mColorStops;
5091  ColorInterpolation mColorInterpolation;
5092  bool mPeriodic;
5093 
5094  // non-property members:
5095  QVector<QRgb>
5096  mColorBuffer; // have colors premultiplied with alpha (for usage with
5097  // QImage::Format_ARGB32_Premultiplied)
5098  bool mColorBufferInvalidated;
5099 
5100  // non-virtual methods:
5101  bool stopsUseAlpha() const;
5103 };
5104 Q_DECLARE_METATYPE(QCPColorGradient::ColorInterpolation)
5105 Q_DECLARE_METATYPE(QCPColorGradient::GradientPreset)
5106 
5107 /* end of 'src/colorgradient.h' */
5108 
5109 /* including file 'src/selectiondecorator-bracket.h', size 4442 */
5110 /* commit ce344b3f96a62e5f652585e55f1ae7c7883cd45b 2018-06-25 01:03:39 +0200 */
5111 
5113  Q_GADGET
5114  public:
5122  bsSquareBracket
5123  ,
5124  bsHalfEllipse
5126  ,
5127  bsEllipse
5129  ,
5130  bsPlus
5131  ,
5132  bsUserStyle
5134  };
5135  Q_ENUMS(BracketStyle)
5136 
5139 
5140  // getters:
5141  QPen bracketPen() const { return mBracketPen; }
5142  QBrush bracketBrush() const { return mBracketBrush; }
5143  int bracketWidth() const { return mBracketWidth; }
5144  int bracketHeight() const { return mBracketHeight; }
5145  BracketStyle bracketStyle() const { return mBracketStyle; }
5146  bool tangentToData() const { return mTangentToData; }
5147  int tangentAverage() const { return mTangentAverage; }
5148 
5149  // setters:
5150  void setBracketPen(const QPen &pen);
5151  void setBracketBrush(const QBrush &brush);
5152  void setBracketWidth(int width);
5153  void setBracketHeight(int height);
5155  void setTangentToData(bool enabled);
5156  void setTangentAverage(int pointCount);
5157 
5158  // introduced virtual methods:
5159  virtual void drawBracket(QCPPainter *painter, int direction) const;
5160 
5161  // virtual methods:
5162  virtual void drawDecoration(QCPPainter *painter,
5163  QCPDataSelection selection) Q_DECL_OVERRIDE;
5164 
5165  protected:
5166  // property members:
5174 
5175  // non-virtual methods:
5176  double getTangentAngle(const QCPPlottableInterface1D *interface1d,
5177  int dataIndex, int direction) const;
5178  QPointF getPixelCoordinates(const QCPPlottableInterface1D *interface1d,
5179  int dataIndex) const;
5180 };
5182 
5183 /* end of 'src/selectiondecorator-bracket.h' */
5184 
5185 /* including file 'src/layoutelements/layoutelement-axisrect.h', size 7507 */
5186 /* commit ce344b3f96a62e5f652585e55f1ae7c7883cd45b 2018-06-25 01:03:39 +0200 */
5187 
5188 class QCP_LIB_DECL QCPAxisRect : public QCPLayoutElement {
5189  Q_OBJECT
5191  Q_PROPERTY(QPixmap background READ background WRITE setBackground)
5192  Q_PROPERTY(
5193  bool backgroundScaled READ backgroundScaled WRITE setBackgroundScaled)
5194  Q_PROPERTY(Qt::AspectRatioMode backgroundScaledMode READ backgroundScaledMode
5195  WRITE setBackgroundScaledMode)
5196  Q_PROPERTY(Qt::Orientations rangeDrag READ rangeDrag WRITE setRangeDrag)
5197  Q_PROPERTY(Qt::Orientations rangeZoom READ rangeZoom WRITE setRangeZoom)
5199  public:
5200  explicit QCPAxisRect(QCustomPlot *parentPlot, bool setupDefaultAxes = true);
5201  virtual ~QCPAxisRect();
5202 
5203  // getters:
5204  QPixmap background() const { return mBackgroundPixmap; }
5205  QBrush backgroundBrush() const { return mBackgroundBrush; }
5206  bool backgroundScaled() const { return mBackgroundScaled; }
5207  Qt::AspectRatioMode backgroundScaledMode() const {
5208  return mBackgroundScaledMode;
5209  }
5210  Qt::Orientations rangeDrag() const { return mRangeDrag; }
5211  Qt::Orientations rangeZoom() const { return mRangeZoom; }
5212  QCPAxis *rangeDragAxis(Qt::Orientation orientation);
5213  QCPAxis *rangeZoomAxis(Qt::Orientation orientation);
5214  QList<QCPAxis *> rangeDragAxes(Qt::Orientation orientation);
5215  QList<QCPAxis *> rangeZoomAxes(Qt::Orientation orientation);
5216  double rangeZoomFactor(Qt::Orientation orientation);
5217 
5218  // setters:
5219  void setBackground(const QPixmap &pm);
5220  void setBackground(const QPixmap &pm, bool scaled,
5221  Qt::AspectRatioMode mode = Qt::KeepAspectRatioByExpanding);
5222  void setBackground(const QBrush &brush);
5223  void setBackgroundScaled(bool scaled);
5224  void setBackgroundScaledMode(Qt::AspectRatioMode mode);
5225  void setRangeDrag(Qt::Orientations orientations);
5226  void setRangeZoom(Qt::Orientations orientations);
5227  void setRangeDragAxes(QCPAxis *horizontal, QCPAxis *vertical);
5228  void setRangeDragAxes(QList<QCPAxis *> axes);
5229  void setRangeDragAxes(QList<QCPAxis *> horizontal, QList<QCPAxis *> vertical);
5230  void setRangeZoomAxes(QCPAxis *horizontal, QCPAxis *vertical);
5231  void setRangeZoomAxes(QList<QCPAxis *> axes);
5232  void setRangeZoomAxes(QList<QCPAxis *> horizontal, QList<QCPAxis *> vertical);
5233  void setRangeZoomFactor(double horizontalFactor, double verticalFactor);
5234  void setRangeZoomFactor(double factor);
5235 
5236  // non-property methods:
5237  int axisCount(QCPAxis::AxisType type) const;
5238  QCPAxis *axis(QCPAxis::AxisType type, int index = 0) const;
5239  QList<QCPAxis *> axes(QCPAxis::AxisTypes types) const;
5240  QList<QCPAxis *> axes() const;
5242  QList<QCPAxis *> addAxes(QCPAxis::AxisTypes types);
5243  bool removeAxis(QCPAxis *axis);
5244  QCPLayoutInset *insetLayout() const { return mInsetLayout; }
5245 
5246  void zoom(const QRectF &pixelRect);
5247  void zoom(const QRectF &pixelRect, const QList<QCPAxis *> &affectedAxes);
5248  void setupFullAxesBox(bool connectRanges = false);
5249  QList<QCPAbstractPlottable *> plottables() const;
5250  QList<QCPGraph *> graphs() const;
5251  QList<QCPAbstractItem *> items() const;
5252 
5253  // read-only interface imitating a QRect:
5254  int left() const { return mRect.left(); }
5255  int right() const { return mRect.right(); }
5256  int top() const { return mRect.top(); }
5257  int bottom() const { return mRect.bottom(); }
5258  int width() const { return mRect.width(); }
5259  int height() const { return mRect.height(); }
5260  QSize size() const { return mRect.size(); }
5261  QPoint topLeft() const { return mRect.topLeft(); }
5262  QPoint topRight() const { return mRect.topRight(); }
5263  QPoint bottomLeft() const { return mRect.bottomLeft(); }
5264  QPoint bottomRight() const { return mRect.bottomRight(); }
5265  QPoint center() const { return mRect.center(); }
5266 
5267  // reimplemented virtual methods:
5268  virtual void update(UpdatePhase phase) Q_DECL_OVERRIDE;
5269  virtual QList<QCPLayoutElement *> elements(bool recursive) const
5271 
5272  protected:
5273  // property members:
5274  QBrush mBackgroundBrush;
5275  QPixmap mBackgroundPixmap;
5276  QPixmap mScaledBackgroundPixmap;
5277  bool mBackgroundScaled;
5278  Qt::AspectRatioMode mBackgroundScaledMode;
5279  QCPLayoutInset *mInsetLayout;
5280  Qt::Orientations mRangeDrag, mRangeZoom;
5281  QList<QPointer<QCPAxis> > mRangeDragHorzAxis, mRangeDragVertAxis;
5282  QList<QPointer<QCPAxis> > mRangeZoomHorzAxis, mRangeZoomVertAxis;
5283  double mRangeZoomFactorHorz, mRangeZoomFactorVert;
5284 
5285  // non-property members:
5286  QList<QCPRange> mDragStartHorzRange, mDragStartVertRange;
5287  QCP::AntialiasedElements mAADragBackup, mNotAADragBackup;
5288  bool mDragging;
5289  QHash<QCPAxis::AxisType, QList<QCPAxis *> > mAxes;
5290 
5291  // reimplemented virtual methods:
5292  virtual void applyDefaultAntialiasingHint(QCPPainter *painter) const
5294  virtual void draw(QCPPainter *painter) Q_DECL_OVERRIDE;
5297  // events:
5298  virtual void mousePressEvent(QMouseEvent *event,
5299  const QVariant &details) Q_DECL_OVERRIDE;
5300  virtual void mouseMoveEvent(QMouseEvent *event,
5301  const QPointF &startPos) Q_DECL_OVERRIDE;
5302  virtual void mouseReleaseEvent(QMouseEvent *event,
5303  const QPointF &startPos) Q_DECL_OVERRIDE;
5304  virtual void wheelEvent(QWheelEvent *event) Q_DECL_OVERRIDE;
5305 
5306  // non-property methods:
5307  void drawBackground(QCPPainter *painter);
5308  void updateAxesOffset(QCPAxis::AxisType type);
5309 
5310  private:
5311  Q_DISABLE_COPY(QCPAxisRect)
5312 
5313  friend class QCustomPlot;
5314 };
5315 
5316 /* end of 'src/layoutelements/layoutelement-axisrect.h' */
5317 
5318 /* including file 'src/layoutelements/layoutelement-legend.h', size 10397 */
5319 /* commit ce344b3f96a62e5f652585e55f1ae7c7883cd45b 2018-06-25 01:03:39 +0200 */
5320 
5322  Q_OBJECT
5324  Q_PROPERTY(QCPLegend *parentLegend READ parentLegend)
5325  Q_PROPERTY(QFont font READ font WRITE setFont)
5326  Q_PROPERTY(QColor textColor READ textColor WRITE setTextColor)
5327  Q_PROPERTY(QFont selectedFont READ selectedFont WRITE setSelectedFont)
5328  Q_PROPERTY(QColor selectedTextColor READ selectedTextColor WRITE
5329  setSelectedTextColor)
5330  Q_PROPERTY(bool selectable READ selectable WRITE setSelectable NOTIFY
5331  selectionChanged)
5332  Q_PROPERTY(
5333  bool selected READ selected WRITE setSelected NOTIFY selectableChanged)
5335  public:
5337 
5338  // getters:
5339  QCPLegend *parentLegend() const { return mParentLegend; }
5340  QFont font() const { return mFont; }
5341  QColor textColor() const { return mTextColor; }
5342  QFont selectedFont() const { return mSelectedFont; }
5343  QColor selectedTextColor() const { return mSelectedTextColor; }
5344  bool selectable() const { return mSelectable; }
5345  bool selected() const { return mSelected; }
5346 
5347  // setters:
5348  void setFont(const QFont &font);
5349  void setTextColor(const QColor &color);
5350  void setSelectedFont(const QFont &font);
5351  void setSelectedTextColor(const QColor &color);
5352  Q_SLOT void setSelectable(bool selectable);
5353  Q_SLOT void setSelected(bool selected);
5354 
5355  // reimplemented virtual methods:
5356  virtual double selectTest(const QPointF &pos, bool onlySelectable,
5357  QVariant *details = 0) const Q_DECL_OVERRIDE;
5358 
5359  signals:
5360  void selectionChanged(bool selected);
5361  void selectableChanged(bool selectable);
5362 
5363  protected:
5364  // property members:
5365  QCPLegend *mParentLegend;
5366  QFont mFont;
5367  QColor mTextColor;
5368  QFont mSelectedFont;
5369  QColor mSelectedTextColor;
5370  bool mSelectable, mSelected;
5371 
5372  // reimplemented virtual methods:
5373  virtual QCP::Interaction selectionCategory() const Q_DECL_OVERRIDE;
5374  virtual void applyDefaultAntialiasingHint(QCPPainter *painter) const
5376  virtual QRect clipRect() const Q_DECL_OVERRIDE;
5377  virtual void draw(QCPPainter *painter) Q_DECL_OVERRIDE = 0;
5378  // events:
5379  virtual void selectEvent(QMouseEvent *event, bool additive,
5380  const QVariant &details,
5381  bool *selectionStateChanged) Q_DECL_OVERRIDE;
5382  virtual void deselectEvent(bool *selectionStateChanged) Q_DECL_OVERRIDE;
5383 
5384  private:
5385  Q_DISABLE_COPY(QCPAbstractLegendItem)
5386 
5387  friend class QCPLegend;
5388 };
5389 
5391  Q_OBJECT
5392  public:
5394 
5395  // getters:
5396  QCPAbstractPlottable *plottable() { return mPlottable; }
5397 
5398  protected:
5399  // property members:
5400  QCPAbstractPlottable *mPlottable;
5401 
5402  // reimplemented virtual methods:
5403  virtual void draw(QCPPainter *painter) Q_DECL_OVERRIDE;
5404  virtual QSize minimumOuterSizeHint() const Q_DECL_OVERRIDE;
5405 
5406  // non-virtual methods:
5407  QPen getIconBorderPen() const;
5408  QColor getTextColor() const;
5409  QFont getFont() const;
5410 };
5411 
5412 class QCP_LIB_DECL QCPLegend : public QCPLayoutGrid {
5413  Q_OBJECT
5415  Q_PROPERTY(QPen borderPen READ borderPen WRITE setBorderPen)
5416  Q_PROPERTY(QBrush brush READ brush WRITE setBrush)
5417  Q_PROPERTY(QFont font READ font WRITE setFont)
5418  Q_PROPERTY(QColor textColor READ textColor WRITE setTextColor)
5419  Q_PROPERTY(QSize iconSize READ iconSize WRITE setIconSize)
5420  Q_PROPERTY(int iconTextPadding READ iconTextPadding WRITE setIconTextPadding)
5421  Q_PROPERTY(QPen iconBorderPen READ iconBorderPen WRITE setIconBorderPen)
5422  Q_PROPERTY(SelectableParts selectableParts READ selectableParts WRITE
5423  setSelectableParts NOTIFY selectionChanged)
5424  Q_PROPERTY(SelectableParts selectedParts READ selectedParts WRITE
5425  setSelectedParts NOTIFY selectableChanged)
5426  Q_PROPERTY(
5427  QPen selectedBorderPen READ selectedBorderPen WRITE setSelectedBorderPen)
5428  Q_PROPERTY(QPen selectedIconBorderPen READ selectedIconBorderPen WRITE
5429  setSelectedIconBorderPen)
5430  Q_PROPERTY(QBrush selectedBrush READ selectedBrush WRITE setSelectedBrush)
5431  Q_PROPERTY(QFont selectedFont READ selectedFont WRITE setSelectedFont)
5432  Q_PROPERTY(QColor selectedTextColor READ selectedTextColor WRITE
5433  setSelectedTextColor)
5435  public:
5442  spNone = 0x000
5443  ,
5444  spLegendBox = 0x001
5445  ,
5446  spItems = 0x002
5448  };
5449  Q_ENUMS(SelectablePart)
5450  Q_FLAGS(SelectableParts)
5451  Q_DECLARE_FLAGS(SelectableParts, SelectablePart)
5452 
5453  explicit QCPLegend();
5454  virtual ~QCPLegend();
5455 
5456  // getters:
5457  QPen borderPen() const { return mBorderPen; }
5458  QBrush brush() const { return mBrush; }
5459  QFont font() const { return mFont; }
5460  QColor textColor() const { return mTextColor; }
5461  QSize iconSize() const { return mIconSize; }
5462  int iconTextPadding() const { return mIconTextPadding; }
5463  QPen iconBorderPen() const { return mIconBorderPen; }
5464  SelectableParts selectableParts() const { return mSelectableParts; }
5465  SelectableParts selectedParts() const;
5466  QPen selectedBorderPen() const { return mSelectedBorderPen; }
5467  QPen selectedIconBorderPen() const { return mSelectedIconBorderPen; }
5468  QBrush selectedBrush() const { return mSelectedBrush; }
5469  QFont selectedFont() const { return mSelectedFont; }
5470  QColor selectedTextColor() const { return mSelectedTextColor; }
5471 
5472  // setters:
5473  void setBorderPen(const QPen &pen);
5474  void setBrush(const QBrush &brush);
5475  void setFont(const QFont &font);
5476  void setTextColor(const QColor &color);
5477  void setIconSize(const QSize &size);
5478  void setIconSize(int width, int height);
5479  void setIconTextPadding(int padding);
5480  void setIconBorderPen(const QPen &pen);
5481  Q_SLOT void setSelectableParts(const SelectableParts &selectableParts);
5482  Q_SLOT void setSelectedParts(const SelectableParts &selectedParts);
5483  void setSelectedBorderPen(const QPen &pen);
5484  void setSelectedIconBorderPen(const QPen &pen);
5485  void setSelectedBrush(const QBrush &brush);
5486  void setSelectedFont(const QFont &font);
5487  void setSelectedTextColor(const QColor &color);
5488 
5489  // reimplemented virtual methods:
5490  virtual double selectTest(const QPointF &pos, bool onlySelectable,
5491  QVariant *details = 0) const Q_DECL_OVERRIDE;
5492 
5493  // non-virtual methods:
5494  QCPAbstractLegendItem *item(int index) const;
5495  QCPPlottableLegendItem *itemWithPlottable(
5496  const QCPAbstractPlottable *plottable) const;
5497  int itemCount() const;
5498  bool hasItem(QCPAbstractLegendItem *item) const;
5499  bool hasItemWithPlottable(const QCPAbstractPlottable *plottable) const;
5500  bool addItem(QCPAbstractLegendItem *item);
5501  bool removeItem(int index);
5502  bool removeItem(QCPAbstractLegendItem *item);
5503  void clearItems();
5504  QList<QCPAbstractLegendItem *> selectedItems() const;
5505 
5506  signals:
5507  void selectionChanged(QCPLegend::SelectableParts parts);
5508  void selectableChanged(QCPLegend::SelectableParts parts);
5509 
5510  protected:
5511  // property members:
5512  QPen mBorderPen, mIconBorderPen;
5513  QBrush mBrush;
5514  QFont mFont;
5515  QColor mTextColor;
5516  QSize mIconSize;
5517  int mIconTextPadding;
5518  SelectableParts mSelectedParts, mSelectableParts;
5519  QPen mSelectedBorderPen, mSelectedIconBorderPen;
5520  QBrush mSelectedBrush;
5521  QFont mSelectedFont;
5522  QColor mSelectedTextColor;
5523 
5524  // reimplemented virtual methods:
5525  virtual void parentPlotInitialized(QCustomPlot *parentPlot) Q_DECL_OVERRIDE;
5526  virtual QCP::Interaction selectionCategory() const Q_DECL_OVERRIDE;
5527  virtual void applyDefaultAntialiasingHint(QCPPainter *painter) const
5529  virtual void draw(QCPPainter *painter) Q_DECL_OVERRIDE;
5530  // events:
5531  virtual void selectEvent(QMouseEvent *event, bool additive,
5532  const QVariant &details,
5533  bool *selectionStateChanged) Q_DECL_OVERRIDE;
5534  virtual void deselectEvent(bool *selectionStateChanged) Q_DECL_OVERRIDE;
5535 
5536  // non-virtual methods:
5537  QPen getBorderPen() const;
5538  QBrush getBrush() const;
5539 
5540  private:
5541  Q_DISABLE_COPY(QCPLegend)
5542 
5543  friend class QCustomPlot;
5544  friend class QCPAbstractLegendItem;
5545 };
5546 Q_DECLARE_OPERATORS_FOR_FLAGS(QCPLegend::SelectableParts)
5547 Q_DECLARE_METATYPE(QCPLegend::SelectablePart)
5548 
5549 /* end of 'src/layoutelements/layoutelement-legend.h' */
5550 
5551 /* including file 'src/layoutelements/layoutelement-textelement.h', size 5353 */
5552 /* commit ce344b3f96a62e5f652585e55f1ae7c7883cd45b 2018-06-25 01:03:39 +0200 */
5553 
5555  Q_OBJECT
5557  Q_PROPERTY(QString text READ text WRITE setText)
5558  Q_PROPERTY(QFont font READ font WRITE setFont)
5559  Q_PROPERTY(QColor textColor READ textColor WRITE setTextColor)
5560  Q_PROPERTY(QFont selectedFont READ selectedFont WRITE setSelectedFont)
5561  Q_PROPERTY(QColor selectedTextColor READ selectedTextColor WRITE
5562  setSelectedTextColor)
5563  Q_PROPERTY(bool selectable READ selectable WRITE setSelectable NOTIFY
5564  selectableChanged)
5565  Q_PROPERTY(
5566  bool selected READ selected WRITE setSelected NOTIFY selectionChanged)
5568  public:
5569  explicit QCPTextElement(QCustomPlot *parentPlot);
5570  QCPTextElement(QCustomPlot *parentPlot, const QString &text);
5571  QCPTextElement(QCustomPlot *parentPlot, const QString &text,
5572  double pointSize);
5573  QCPTextElement(QCustomPlot *parentPlot, const QString &text,
5574  const QString &fontFamily, double pointSize);
5575  QCPTextElement(QCustomPlot *parentPlot, const QString &text,
5576  const QFont &font);
5577 
5578  // getters:
5579  QString text() const { return mText; }
5580  int textFlags() const { return mTextFlags; }
5581  QFont font() const { return mFont; }
5582  QColor textColor() const { return mTextColor; }
5583  QFont selectedFont() const { return mSelectedFont; }
5584  QColor selectedTextColor() const { return mSelectedTextColor; }
5585  bool selectable() const { return mSelectable; }
5586  bool selected() const { return mSelected; }
5587 
5588  // setters:
5589  void setText(const QString &text);
5590  void setTextFlags(int flags);
5591  void setFont(const QFont &font);
5592  void setTextColor(const QColor &color);
5593  void setSelectedFont(const QFont &font);
5594  void setSelectedTextColor(const QColor &color);
5595  Q_SLOT void setSelectable(bool selectable);
5596  Q_SLOT void setSelected(bool selected);
5597 
5598  // reimplemented virtual methods:
5599  virtual double selectTest(const QPointF &pos, bool onlySelectable,
5600  QVariant *details = 0) const Q_DECL_OVERRIDE;
5601  virtual void mousePressEvent(QMouseEvent *event,
5602  const QVariant &details) Q_DECL_OVERRIDE;
5603  virtual void mouseReleaseEvent(QMouseEvent *event,
5604  const QPointF &startPos) Q_DECL_OVERRIDE;
5605  virtual void mouseDoubleClickEvent(QMouseEvent *event,
5606  const QVariant &details) Q_DECL_OVERRIDE;
5607 
5608  signals:
5609  void selectionChanged(bool selected);
5610  void selectableChanged(bool selectable);
5611  void clicked(QMouseEvent *event);
5612  void doubleClicked(QMouseEvent *event);
5613 
5614  protected:
5615  // property members:
5616  QString mText;
5617  int mTextFlags;
5618  QFont mFont;
5619  QColor mTextColor;
5620  QFont mSelectedFont;
5621  QColor mSelectedTextColor;
5622  QRect mTextBoundingRect;
5623  bool mSelectable, mSelected;
5624 
5625  // reimplemented virtual methods:
5626  virtual void applyDefaultAntialiasingHint(QCPPainter *painter) const
5628  virtual void draw(QCPPainter *painter) Q_DECL_OVERRIDE;
5629  virtual QSize minimumOuterSizeHint() const Q_DECL_OVERRIDE;
5630  virtual QSize maximumOuterSizeHint() const Q_DECL_OVERRIDE;
5631  // events:
5632  virtual void selectEvent(QMouseEvent *event, bool additive,
5633  const QVariant &details,
5634  bool *selectionStateChanged) Q_DECL_OVERRIDE;
5635  virtual void deselectEvent(bool *selectionStateChanged) Q_DECL_OVERRIDE;
5636 
5637  // non-virtual methods:
5638  QFont mainFont() const;
5639  QColor mainTextColor() const;
5640 
5641  private:
5642  Q_DISABLE_COPY(QCPTextElement)
5643 };
5644 
5645 /* end of 'src/layoutelements/layoutelement-textelement.h' */
5646 
5647 /* including file 'src/layoutelements/layoutelement-colorscale.h', size 5923 */
5648 /* commit ce344b3f96a62e5f652585e55f1ae7c7883cd45b 2018-06-25 01:03:39 +0200 */
5649 
5651  Q_OBJECT
5652  public:
5653  explicit QCPColorScaleAxisRectPrivate(QCPColorScale *parentColorScale);
5654 
5655  protected:
5656  QCPColorScale *mParentColorScale;
5657  QImage mGradientImage;
5658  bool mGradientImageInvalidated;
5659  // re-using some methods of QCPAxisRect to make them available to friend class
5660  // QCPColorScale
5665  using QCPAxisRect::update;
5667  virtual void draw(QCPPainter *painter) Q_DECL_OVERRIDE;
5669  Q_SLOT void axisSelectionChanged(QCPAxis::SelectableParts selectedParts);
5670  Q_SLOT void axisSelectableChanged(QCPAxis::SelectableParts selectableParts);
5671  friend class QCPColorScale;
5672 };
5673 
5675  Q_OBJECT
5677  Q_PROPERTY(QCPAxis::AxisType type READ type WRITE setType)
5678  Q_PROPERTY(QCPRange dataRange READ dataRange WRITE setDataRange NOTIFY
5679  dataRangeChanged)
5680  Q_PROPERTY(QCPAxis::ScaleType dataScaleType READ dataScaleType WRITE
5681  setDataScaleType NOTIFY dataScaleTypeChanged)
5682  Q_PROPERTY(QCPColorGradient gradient READ gradient WRITE setGradient NOTIFY
5683  gradientChanged)
5684  Q_PROPERTY(QString label READ label WRITE setLabel)
5685  Q_PROPERTY(int barWidth READ barWidth WRITE setBarWidth)
5686  Q_PROPERTY(bool rangeDrag READ rangeDrag WRITE setRangeDrag)
5687  Q_PROPERTY(bool rangeZoom READ rangeZoom WRITE setRangeZoom)
5689  public:
5690  explicit QCPColorScale(QCustomPlot *parentPlot);
5691  virtual ~QCPColorScale();
5692 
5693  // getters:
5694  QCPAxis *axis() const { return mColorAxis.data(); }
5695  QCPAxis::AxisType type() const { return mType; }
5696  QCPRange dataRange() const { return mDataRange; }
5697  QCPAxis::ScaleType dataScaleType() const { return mDataScaleType; }
5698  QCPColorGradient gradient() const { return mGradient; }
5699  QString label() const;
5700  int barWidth() const { return mBarWidth; }
5701  bool rangeDrag() const;
5702  bool rangeZoom() const;
5703 
5704  // setters:
5706  Q_SLOT void setDataRange(const QCPRange &dataRange);
5707  Q_SLOT void setDataScaleType(QCPAxis::ScaleType scaleType);
5708  Q_SLOT void setGradient(const QCPColorGradient &gradient);
5709  void setLabel(const QString &str);
5710  void setBarWidth(int width);
5711  void setRangeDrag(bool enabled);
5712  void setRangeZoom(bool enabled);
5713 
5714  // non-property methods:
5715  QList<QCPColorMap *> colorMaps() const;
5716  void rescaleDataRange(bool onlyVisibleMaps);
5717 
5718  // reimplemented virtual methods:
5719  virtual void update(UpdatePhase phase) Q_DECL_OVERRIDE;
5720 
5721  signals:
5722  void dataRangeChanged(const QCPRange &newRange);
5724  void gradientChanged(const QCPColorGradient &newGradient);
5725 
5726  protected:
5727  // property members:
5728  QCPAxis::AxisType mType;
5729  QCPRange mDataRange;
5730  QCPAxis::ScaleType mDataScaleType;
5731  QCPColorGradient mGradient;
5732  int mBarWidth;
5733 
5734  // non-property members:
5735  QPointer<QCPColorScaleAxisRectPrivate> mAxisRect;
5736  QPointer<QCPAxis> mColorAxis;
5737 
5738  // reimplemented virtual methods:
5739  virtual void applyDefaultAntialiasingHint(QCPPainter *painter) const
5741  // events:
5742  virtual void mousePressEvent(QMouseEvent *event,
5743  const QVariant &details) Q_DECL_OVERRIDE;
5744  virtual void mouseMoveEvent(QMouseEvent *event,
5745  const QPointF &startPos) Q_DECL_OVERRIDE;
5746  virtual void mouseReleaseEvent(QMouseEvent *event,
5747  const QPointF &startPos) Q_DECL_OVERRIDE;
5748  virtual void wheelEvent(QWheelEvent *event) Q_DECL_OVERRIDE;
5749 
5750  private:
5751  Q_DISABLE_COPY(QCPColorScale)
5752 
5753  friend class QCPColorScaleAxisRectPrivate;
5754 };
5755 
5756 /* end of 'src/layoutelements/layoutelement-colorscale.h' */
5757 
5758 /* including file 'src/plottables/plottable-graph.h', size 9294 */
5759 /* commit ce344b3f96a62e5f652585e55f1ae7c7883cd45b 2018-06-25 01:03:39 +0200 */
5760 
5762  public:
5764  QCPGraphData(double key, double value);
5765 
5766  inline double sortKey() const { return key; }
5767  inline static QCPGraphData fromSortKey(double sortKey) {
5768  return QCPGraphData(sortKey, 0);
5769  }
5770  inline static bool sortKeyIsMainKey() { return true; }
5771 
5772  inline double mainKey() const { return key; }
5773  inline double mainValue() const { return value; }
5774 
5775  inline QCPRange valueRange() const { return QCPRange(value, value); }
5776 
5777  double key, value;
5778 };
5780 
5793 
5794 class QCP_LIB_DECL QCPGraph : public QCPAbstractPlottable1D<QCPGraphData> {
5795  Q_OBJECT
5797  Q_PROPERTY(LineStyle lineStyle READ lineStyle WRITE setLineStyle)
5798  Q_PROPERTY(
5799  QCPScatterStyle scatterStyle READ scatterStyle WRITE setScatterStyle)
5800  Q_PROPERTY(int scatterSkip READ scatterSkip WRITE setScatterSkip)
5801  Q_PROPERTY(QCPGraph *channelFillGraph READ channelFillGraph WRITE
5802  setChannelFillGraph)
5803  Q_PROPERTY(
5804  bool adaptiveSampling READ adaptiveSampling WRITE setAdaptiveSampling)
5806  public:
5811  enum LineStyle {
5812  lsNone
5815  ,
5816  lsLine
5817  ,
5818  lsStepLeft
5820  ,
5821  lsStepRight
5823  ,
5824  lsStepCenter
5826  ,
5827  lsImpulse
5830  };
5831  Q_ENUMS(LineStyle)
5832 
5833  explicit QCPGraph(QCPAxis *keyAxis, QCPAxis *valueAxis);
5834  virtual ~QCPGraph();
5835 
5836  // getters:
5837  QSharedPointer<QCPGraphDataContainer> data() const { return mDataContainer; }
5838  LineStyle lineStyle() const { return mLineStyle; }
5839  QCPScatterStyle scatterStyle() const { return mScatterStyle; }
5840  int scatterSkip() const { return mScatterSkip; }
5841  QCPGraph *channelFillGraph() const { return mChannelFillGraph.data(); }
5842  bool adaptiveSampling() const { return mAdaptiveSampling; }
5843 
5844  // setters:
5845  void setData(QSharedPointer<QCPGraphDataContainer> data);
5846  void setData(const QVector<double> &keys, const QVector<double> &values,
5847  bool alreadySorted = false);
5849  void setScatterStyle(const QCPScatterStyle &style);
5850  void setScatterSkip(int skip);
5851  void setChannelFillGraph(QCPGraph *targetGraph);
5852  void setAdaptiveSampling(bool enabled);
5853 
5854  // non-property methods:
5855  void addData(const QVector<double> &keys, const QVector<double> &values,
5856  bool alreadySorted = false);
5857  void addData(double key, double value);
5858 
5859  // reimplemented virtual methods:
5860  virtual double selectTest(const QPointF &pos, bool onlySelectable,
5861  QVariant *details = 0) const Q_DECL_OVERRIDE;
5862  virtual QCPRange getKeyRange(bool &foundRange,
5863  QCP::SignDomain inSignDomain = QCP::sdBoth) const
5865  virtual QCPRange getValueRange(
5866  bool &foundRange, QCP::SignDomain inSignDomain = QCP::sdBoth,
5867  const QCPRange &inKeyRange = QCPRange()) const Q_DECL_OVERRIDE;
5868 
5869  protected:
5870  // property members:
5871  LineStyle mLineStyle;
5872  QCPScatterStyle mScatterStyle;
5873  int mScatterSkip;
5874  QPointer<QCPGraph> mChannelFillGraph;
5875  bool mAdaptiveSampling;
5876 
5877  // reimplemented virtual methods:
5878  virtual void draw(QCPPainter *painter) Q_DECL_OVERRIDE;
5879  virtual void drawLegendIcon(QCPPainter *painter,
5880  const QRectF &rect) const Q_DECL_OVERRIDE;
5881 
5882  // introduced virtual methods:
5883  virtual void drawFill(QCPPainter *painter, QVector<QPointF> *lines) const;
5884  virtual void drawScatterPlot(QCPPainter *painter,
5885  const QVector<QPointF> &scatters,
5886  const QCPScatterStyle &style) const;
5887  virtual void drawLinePlot(QCPPainter *painter,
5888  const QVector<QPointF> &lines) const;
5889  virtual void drawImpulsePlot(QCPPainter *painter,
5890  const QVector<QPointF> &lines) const;
5891 
5892  virtual void getOptimizedLineData(
5893  QVector<QCPGraphData> *lineData,
5894  const QCPGraphDataContainer::const_iterator &begin,
5895  const QCPGraphDataContainer::const_iterator &end) const;
5896  virtual void getOptimizedScatterData(
5897  QVector<QCPGraphData> *scatterData,
5898  QCPGraphDataContainer::const_iterator begin,
5899  QCPGraphDataContainer::const_iterator end) const;
5900 
5901  // non-virtual methods:
5902  void getVisibleDataBounds(QCPGraphDataContainer::const_iterator &begin,
5903  QCPGraphDataContainer::const_iterator &end,
5904  const QCPDataRange &rangeRestriction) const;
5905  void getLines(QVector<QPointF> *lines, const QCPDataRange &dataRange) const;
5906  void getScatters(QVector<QPointF> *scatters,
5907  const QCPDataRange &dataRange) const;
5908  QVector<QPointF> dataToLines(const QVector<QCPGraphData> &data) const;
5909  QVector<QPointF> dataToStepLeftLines(const QVector<QCPGraphData> &data) const;
5910  QVector<QPointF> dataToStepRightLines(
5911  const QVector<QCPGraphData> &data) const;
5912  QVector<QPointF> dataToStepCenterLines(
5913  const QVector<QCPGraphData> &data) const;
5914  QVector<QPointF> dataToImpulseLines(const QVector<QCPGraphData> &data) const;
5915  QVector<QCPDataRange> getNonNanSegments(const QVector<QPointF> *lineData,
5916  Qt::Orientation keyOrientation) const;
5917  QVector<QPair<QCPDataRange, QCPDataRange> > getOverlappingSegments(
5918  QVector<QCPDataRange> thisSegments, const QVector<QPointF> *thisData,
5919  QVector<QCPDataRange> otherSegments,
5920  const QVector<QPointF> *otherData) const;
5921  bool segmentsIntersect(double aLower, double aUpper, double bLower,
5922  double bUpper, int &bPrecedence) const;
5923  QPointF getFillBasePoint(QPointF matchingDataPoint) const;
5924  const QPolygonF getFillPolygon(const QVector<QPointF> *lineData,
5925  QCPDataRange segment) const;
5926  const QPolygonF getChannelFillPolygon(const QVector<QPointF> *lineData,
5927  QCPDataRange thisSegment,
5928  const QVector<QPointF> *otherData,
5929  QCPDataRange otherSegment) const;
5930  int findIndexBelowX(const QVector<QPointF> *data, double x) const;
5931  int findIndexAboveX(const QVector<QPointF> *data, double x) const;
5932  int findIndexBelowY(const QVector<QPointF> *data, double y) const;
5933  int findIndexAboveY(const QVector<QPointF> *data, double y) const;
5934  double pointDistance(
5935  const QPointF &pixelPoint,
5936  QCPGraphDataContainer::const_iterator &closestData) const;
5937 
5938  friend class QCustomPlot;
5939  friend class QCPLegend;
5940 };
5941 Q_DECLARE_METATYPE(QCPGraph::LineStyle)
5942 
5943 /* end of 'src/plottables/plottable-graph.h' */
5944 
5945 /* including file 'src/plottables/plottable-curve.h', size 7409 */
5946 /* commit ce344b3f96a62e5f652585e55f1ae7c7883cd45b 2018-06-25 01:03:39 +0200 */
5947 
5948 class QCP_LIB_DECL QCPCurveData {
5949  public:
5951  QCPCurveData(double t, double key, double value);
5952 
5953  inline double sortKey() const { return t; }
5954  inline static QCPCurveData fromSortKey(double sortKey) {
5955  return QCPCurveData(sortKey, 0, 0);
5956  }
5957  inline static bool sortKeyIsMainKey() { return false; }
5958 
5959  inline double mainKey() const { return key; }
5960  inline double mainValue() const { return value; }
5961 
5962  inline QCPRange valueRange() const { return QCPRange(value, value); }
5963 
5964  double t, key, value;
5965 };
5967 
5981 
5982 class QCP_LIB_DECL QCPCurve : public QCPAbstractPlottable1D<QCPCurveData> {
5983  Q_OBJECT
5985  Q_PROPERTY(
5986  QCPScatterStyle scatterStyle READ scatterStyle WRITE setScatterStyle)
5987  Q_PROPERTY(int scatterSkip READ scatterSkip WRITE setScatterSkip)
5988  Q_PROPERTY(LineStyle lineStyle READ lineStyle WRITE setLineStyle)
5990  public:
5995  enum LineStyle {
5996  lsNone
5997  ,
5998  lsLine
5999  };
6000  Q_ENUMS(LineStyle)
6001 
6002  explicit QCPCurve(QCPAxis *keyAxis, QCPAxis *valueAxis);
6003  virtual ~QCPCurve();
6004 
6005  // getters:
6006  QSharedPointer<QCPCurveDataContainer> data() const { return mDataContainer; }
6007  QCPScatterStyle scatterStyle() const { return mScatterStyle; }
6008  int scatterSkip() const { return mScatterSkip; }
6009  LineStyle lineStyle() const { return mLineStyle; }
6010 
6011  // setters:
6012  void setData(QSharedPointer<QCPCurveDataContainer> data);
6013  void setData(const QVector<double> &t, const QVector<double> &keys,
6014  const QVector<double> &values, bool alreadySorted = false);
6015  void setData(const QVector<double> &keys, const QVector<double> &values);
6016  void setScatterStyle(const QCPScatterStyle &style);
6017  void setScatterSkip(int skip);
6019 
6020  // non-property methods:
6021  void addData(const QVector<double> &t, const QVector<double> &keys,
6022  const QVector<double> &values, bool alreadySorted = false);
6023  void addData(const QVector<double> &keys, const QVector<double> &values);
6024  void addData(double t, double key, double value);
6025  void addData(double key, double value);
6026 
6027  // reimplemented virtual methods:
6028  virtual double selectTest(const QPointF &pos, bool onlySelectable,
6029  QVariant *details = 0) const Q_DECL_OVERRIDE;
6030  virtual QCPRange getKeyRange(bool &foundRange,
6031  QCP::SignDomain inSignDomain = QCP::sdBoth) const
6033  virtual QCPRange getValueRange(
6034  bool &foundRange, QCP::SignDomain inSignDomain = QCP::sdBoth,
6035  const QCPRange &inKeyRange = QCPRange()) const Q_DECL_OVERRIDE;
6036 
6037  protected:
6038  // property members:
6039  QCPScatterStyle mScatterStyle;
6040  int mScatterSkip;
6041  LineStyle mLineStyle;
6042 
6043  // reimplemented virtual methods:
6044  virtual void draw(QCPPainter *painter) Q_DECL_OVERRIDE;
6045  virtual void drawLegendIcon(QCPPainter *painter,
6046  const QRectF &rect) const Q_DECL_OVERRIDE;
6047 
6048  // introduced virtual methods:
6049  virtual void drawCurveLine(QCPPainter *painter,
6050  const QVector<QPointF> &lines) const;
6051  virtual void drawScatterPlot(QCPPainter *painter,
6052  const QVector<QPointF> &points,
6053  const QCPScatterStyle &style) const;
6054 
6055  // non-virtual methods:
6056  void getCurveLines(QVector<QPointF> *lines, const QCPDataRange &dataRange,
6057  double penWidth) const;
6058  void getScatters(QVector<QPointF> *scatters, const QCPDataRange &dataRange,
6059  double scatterWidth) const;
6060  int getRegion(double key, double value, double keyMin, double valueMax,
6061  double keyMax, double valueMin) const;
6062  QPointF getOptimizedPoint(int prevRegion, double prevKey, double prevValue,
6063  double key, double value, double keyMin,
6064  double valueMax, double keyMax,
6065  double valueMin) const;
6066  QVector<QPointF> getOptimizedCornerPoints(int prevRegion, int currentRegion,
6067  double prevKey, double prevValue,
6068  double key, double value,
6069  double keyMin, double valueMax,
6070  double keyMax,
6071  double valueMin) const;
6072  bool mayTraverse(int prevRegion, int currentRegion) const;
6073  bool getTraverse(double prevKey, double prevValue, double key, double value,
6074  double keyMin, double valueMax, double keyMax,
6075  double valueMin, QPointF &crossA, QPointF &crossB) const;
6076  void getTraverseCornerPoints(int prevRegion, int currentRegion, double keyMin,
6077  double valueMax, double keyMax, double valueMin,
6078  QVector<QPointF> &beforeTraverse,
6079  QVector<QPointF> &afterTraverse) const;
6080  double pointDistance(
6081  const QPointF &pixelPoint,
6082  QCPCurveDataContainer::const_iterator &closestData) const;
6083 
6084  friend class QCustomPlot;
6085  friend class QCPLegend;
6086 };
6087 Q_DECLARE_METATYPE(QCPCurve::LineStyle)
6088 
6089 /* end of 'src/plottables/plottable-curve.h' */
6090 
6091 /* including file 'src/plottables/plottable-bars.h', size 8933 */
6092 /* commit ce344b3f96a62e5f652585e55f1ae7c7883cd45b 2018-06-25 01:03:39 +0200 */
6093 
6094 class QCP_LIB_DECL QCPBarsGroup : public QObject {
6095  Q_OBJECT
6097  Q_PROPERTY(SpacingType spacingType READ spacingType WRITE setSpacingType)
6098  Q_PROPERTY(double spacing READ spacing WRITE setSpacing)
6100  public:
6108  stAbsolute
6109  ,
6110  stAxisRectRatio
6112  ,
6113  stPlotCoords
6115  };
6116  Q_ENUMS(SpacingType)
6117 
6118  explicit QCPBarsGroup(QCustomPlot *parentPlot);
6119  virtual ~QCPBarsGroup();
6120 
6121  // getters:
6122  SpacingType spacingType() const { return mSpacingType; }
6123  double spacing() const { return mSpacing; }
6124 
6125  // setters:
6126  void setSpacingType(SpacingType spacingType);
6127  void setSpacing(double spacing);
6128 
6129  // non-virtual methods:
6130  QList<QCPBars *> bars() const { return mBars; }
6131  QCPBars *bars(int index) const;
6132  int size() const { return mBars.size(); }
6133  bool isEmpty() const { return mBars.isEmpty(); }
6134  void clear();
6135  bool contains(QCPBars *bars) const { return mBars.contains(bars); }
6136  void append(QCPBars *bars);
6137  void insert(int i, QCPBars *bars);
6138  void remove(QCPBars *bars);
6139 
6140  protected:
6141  // non-property members:
6142  QCustomPlot *mParentPlot;
6143  SpacingType mSpacingType;
6144  double mSpacing;
6145  QList<QCPBars *> mBars;
6146 
6147  // non-virtual methods:
6148  void registerBars(QCPBars *bars);
6150 
6151  // virtual methods:
6152  double keyPixelOffset(const QCPBars *bars, double keyCoord);
6153  double getPixelSpacing(const QCPBars *bars, double keyCoord);
6154 
6155  private:
6156  Q_DISABLE_COPY(QCPBarsGroup)
6157 
6158  friend class QCPBars;
6159 };
6160 Q_DECLARE_METATYPE(QCPBarsGroup::SpacingType)
6161 
6163  public:
6165  QCPBarsData(double key, double value);
6166 
6167  inline double sortKey() const { return key; }
6168  inline static QCPBarsData fromSortKey(double sortKey) {
6169  return QCPBarsData(sortKey, 0);
6170  }
6171  inline static bool sortKeyIsMainKey() { return true; }
6172 
6173  inline double mainKey() const { return key; }
6174  inline double mainValue() const { return value; }
6175 
6176  inline QCPRange valueRange() const {
6177  return QCPRange(value, value);
6178  } // note that bar base value isn't held in each QCPBarsData and thus
6179  // can't/shouldn't be returned here
6180 
6181  double key, value;
6182 };
6183 Q_DECLARE_TYPEINFO(QCPBarsData, Q_PRIMITIVE_TYPE);
6184 
6197 
6198 class QCP_LIB_DECL QCPBars : public QCPAbstractPlottable1D<QCPBarsData> {
6199  Q_OBJECT
6201  Q_PROPERTY(double width READ width WRITE setWidth)
6202  Q_PROPERTY(WidthType widthType READ widthType WRITE setWidthType)
6203  Q_PROPERTY(QCPBarsGroup *barsGroup READ barsGroup WRITE setBarsGroup)
6204  Q_PROPERTY(double baseValue READ baseValue WRITE setBaseValue)
6205  Q_PROPERTY(double stackingGap READ stackingGap WRITE setStackingGap)
6206  Q_PROPERTY(QCPBars *barBelow READ barBelow)
6207  Q_PROPERTY(QCPBars *barAbove READ barAbove)
6209  public:
6216  enum WidthType {
6217  wtAbsolute
6218  ,
6219  wtAxisRectRatio
6220  ,
6221  wtPlotCoords
6223  };
6224  Q_ENUMS(WidthType)
6225 
6226  explicit QCPBars(QCPAxis *keyAxis, QCPAxis *valueAxis);
6227  virtual ~QCPBars();
6228 
6229  // getters:
6230  double width() const { return mWidth; }
6231  WidthType widthType() const { return mWidthType; }
6232  QCPBarsGroup *barsGroup() const { return mBarsGroup; }
6233  double baseValue() const { return mBaseValue; }
6234  double stackingGap() const { return mStackingGap; }
6235  QCPBars *barBelow() const { return mBarBelow.data(); }
6236  QCPBars *barAbove() const { return mBarAbove.data(); }
6237  QSharedPointer<QCPBarsDataContainer> data() const { return mDataContainer; }
6238 
6239  // setters:
6240  void setData(QSharedPointer<QCPBarsDataContainer> data);
6241  void setData(const QVector<double> &keys, const QVector<double> &values,
6242  bool alreadySorted = false);
6243  void setWidth(double width);
6244  void setWidthType(WidthType widthType);
6245  void setBarsGroup(QCPBarsGroup *barsGroup);
6246  void setBaseValue(double baseValue);
6247  void setStackingGap(double pixels);
6248 
6249  // non-property methods:
6250  void addData(const QVector<double> &keys, const QVector<double> &values,
6251  bool alreadySorted = false);
6252  void addData(double key, double value);
6253  void moveBelow(QCPBars *bars);
6254  void moveAbove(QCPBars *bars);
6255 
6256  // reimplemented virtual methods:
6258  const QRectF &rect, bool onlySelectable) const Q_DECL_OVERRIDE;
6259  virtual double selectTest(const QPointF &pos, bool onlySelectable,
6260  QVariant *details = 0) const Q_DECL_OVERRIDE;
6261  virtual QCPRange getKeyRange(bool &foundRange,
6262  QCP::SignDomain inSignDomain = QCP::sdBoth) const
6264  virtual QCPRange getValueRange(
6265  bool &foundRange, QCP::SignDomain inSignDomain = QCP::sdBoth,
6266  const QCPRange &inKeyRange = QCPRange()) const Q_DECL_OVERRIDE;
6267  virtual QPointF dataPixelPosition(int index) const Q_DECL_OVERRIDE;
6268 
6269  protected:
6270  // property members:
6271  double mWidth;
6272  WidthType mWidthType;
6273  QCPBarsGroup *mBarsGroup;
6274  double mBaseValue;
6275  double mStackingGap;
6276  QPointer<QCPBars> mBarBelow, mBarAbove;
6277 
6278  // reimplemented virtual methods:
6279  virtual void draw(QCPPainter *painter) Q_DECL_OVERRIDE;
6280  virtual void drawLegendIcon(QCPPainter *painter,
6281  const QRectF &rect) const Q_DECL_OVERRIDE;
6282 
6283  // non-virtual methods:
6284  void getVisibleDataBounds(QCPBarsDataContainer::const_iterator &begin,
6285  QCPBarsDataContainer::const_iterator &end) const;
6286  QRectF getBarRect(double key, double value) const;
6287  void getPixelWidth(double key, double &lower, double &upper) const;
6288  double getStackedBaseValue(double key, bool positive) const;
6289  static void connectBars(QCPBars *lower, QCPBars *upper);
6290 
6291  friend class QCustomPlot;
6292  friend class QCPLegend;
6293  friend class QCPBarsGroup;
6294 };
6295 Q_DECLARE_METATYPE(QCPBars::WidthType)
6296 
6297 /* end of 'src/plottables/plottable-bars.h' */
6298 
6299 /* including file 'src/plottables/plottable-statisticalbox.h', size 7516 */
6300 /* commit ce344b3f96a62e5f652585e55f1ae7c7883cd45b 2018-06-25 01:03:39 +0200 */
6301 
6303  public:
6305  QCPStatisticalBoxData(double key, double minimum, double lowerQuartile,
6306  double median, double upperQuartile, double maximum,
6307  const QVector<double> &outliers = QVector<double>());
6308 
6309  inline double sortKey() const { return key; }
6310  inline static QCPStatisticalBoxData fromSortKey(double sortKey) {
6311  return QCPStatisticalBoxData(sortKey, 0, 0, 0, 0, 0);
6312  }
6313  inline static bool sortKeyIsMainKey() { return true; }
6314 
6315  inline double mainKey() const { return key; }
6316  inline double mainValue() const { return median; }
6317 
6318  inline QCPRange valueRange() const {
6319  QCPRange result(minimum, maximum);
6320  for (QVector<double>::const_iterator it = outliers.constBegin();
6321  it != outliers.constEnd(); ++it)
6322  result.expand(*it);
6323  return result;
6324  }
6325 
6326  double key, minimum, lowerQuartile, median, upperQuartile, maximum;
6327  QVector<double> outliers;
6328 };
6330 
6343 
6345  : public QCPAbstractPlottable1D<QCPStatisticalBoxData> {
6346  Q_OBJECT
6348  Q_PROPERTY(double width READ width WRITE setWidth)
6349  Q_PROPERTY(double whiskerWidth READ whiskerWidth WRITE setWhiskerWidth)
6350  Q_PROPERTY(QPen whiskerPen READ whiskerPen WRITE setWhiskerPen)
6351  Q_PROPERTY(QPen whiskerBarPen READ whiskerBarPen WRITE setWhiskerBarPen)
6352  Q_PROPERTY(bool whiskerAntialiased READ whiskerAntialiased WRITE
6353  setWhiskerAntialiased)
6354  Q_PROPERTY(QPen medianPen READ medianPen WRITE setMedianPen)
6355  Q_PROPERTY(
6356  QCPScatterStyle outlierStyle READ outlierStyle WRITE setOutlierStyle)
6358  public:
6359  explicit QCPStatisticalBox(QCPAxis *keyAxis, QCPAxis *valueAxis);
6360 
6361  // getters:
6362  QSharedPointer<QCPStatisticalBoxDataContainer> data() const {
6363  return mDataContainer;
6364  }
6365  double width() const { return mWidth; }
6366  double whiskerWidth() const { return mWhiskerWidth; }
6367  QPen whiskerPen() const { return mWhiskerPen; }
6368  QPen whiskerBarPen() const { return mWhiskerBarPen; }
6369  bool whiskerAntialiased() const { return mWhiskerAntialiased; }
6370  QPen medianPen() const { return mMedianPen; }
6371  QCPScatterStyle outlierStyle() const { return mOutlierStyle; }
6372 
6373  // setters:
6374  void setData(QSharedPointer<QCPStatisticalBoxDataContainer> data);
6375  void setData(const QVector<double> &keys, const QVector<double> &minimum,
6376  const QVector<double> &lowerQuartile,
6377  const QVector<double> &median,
6378  const QVector<double> &upperQuartile,
6379  const QVector<double> &maximum, bool alreadySorted = false);
6380  void setWidth(double width);
6381  void setWhiskerWidth(double width);
6382  void setWhiskerPen(const QPen &pen);
6383  void setWhiskerBarPen(const QPen &pen);
6384  void setWhiskerAntialiased(bool enabled);
6385  void setMedianPen(const QPen &pen);
6386  void setOutlierStyle(const QCPScatterStyle &style);
6387 
6388  // non-property methods:
6389  void addData(const QVector<double> &keys, const QVector<double> &minimum,
6390  const QVector<double> &lowerQuartile,
6391  const QVector<double> &median,
6392  const QVector<double> &upperQuartile,
6393  const QVector<double> &maximum, bool alreadySorted = false);
6394  void addData(double key, double minimum, double lowerQuartile, double median,
6395  double upperQuartile, double maximum,
6396  const QVector<double> &outliers = QVector<double>());
6397 
6398  // reimplemented virtual methods:
6400  const QRectF &rect, bool onlySelectable) const Q_DECL_OVERRIDE;
6401  virtual double selectTest(const QPointF &pos, bool onlySelectable,
6402  QVariant *details = 0) const Q_DECL_OVERRIDE;
6403  virtual QCPRange getKeyRange(bool &foundRange,
6404  QCP::SignDomain inSignDomain = QCP::sdBoth) const
6406  virtual QCPRange getValueRange(
6407  bool &foundRange, QCP::SignDomain inSignDomain = QCP::sdBoth,
6408  const QCPRange &inKeyRange = QCPRange()) const Q_DECL_OVERRIDE;
6409 
6410  protected:
6411  // property members:
6412  double mWidth;
6413  double mWhiskerWidth;
6414  QPen mWhiskerPen, mWhiskerBarPen;
6415  bool mWhiskerAntialiased;
6416  QPen mMedianPen;
6417  QCPScatterStyle mOutlierStyle;
6418 
6419  // reimplemented virtual methods:
6420  virtual void draw(QCPPainter *painter) Q_DECL_OVERRIDE;
6421  virtual void drawLegendIcon(QCPPainter *painter,
6422  const QRectF &rect) const Q_DECL_OVERRIDE;
6423 
6424  // introduced virtual methods:
6425  virtual void drawStatisticalBox(
6426  QCPPainter *painter, QCPStatisticalBoxDataContainer::const_iterator it,
6427  const QCPScatterStyle &outlierStyle) const;
6428 
6429  // non-virtual methods:
6430  void getVisibleDataBounds(
6431  QCPStatisticalBoxDataContainer::const_iterator &begin,
6432  QCPStatisticalBoxDataContainer::const_iterator &end) const;
6433  QRectF getQuartileBox(
6434  QCPStatisticalBoxDataContainer::const_iterator it) const;
6435  QVector<QLineF> getWhiskerBackboneLines(
6436  QCPStatisticalBoxDataContainer::const_iterator it) const;
6437  QVector<QLineF> getWhiskerBarLines(
6438  QCPStatisticalBoxDataContainer::const_iterator it) const;
6439 
6440  friend class QCustomPlot;
6441  friend class QCPLegend;
6442 };
6443 
6444 /* end of 'src/plottables/plottable-statisticalbox.h' */
6445 
6446 /* including file 'src/plottables/plottable-colormap.h', size 7070 */
6447 /* commit ce344b3f96a62e5f652585e55f1ae7c7883cd45b 2018-06-25 01:03:39 +0200 */
6448 
6450  public:
6451  QCPColorMapData(int keySize, int valueSize, const QCPRange &keyRange,
6452  const QCPRange &valueRange);
6456 
6457  // getters:
6458  int keySize() const { return mKeySize; }
6459  int valueSize() const { return mValueSize; }
6460  QCPRange keyRange() const { return mKeyRange; }
6461  QCPRange valueRange() const { return mValueRange; }
6462  QCPRange dataBounds() const { return mDataBounds; }
6463  double data(double key, double value);
6464  double cell(int keyIndex, int valueIndex);
6465  unsigned char alpha(int keyIndex, int valueIndex);
6466 
6467  // setters:
6468  void setSize(int keySize, int valueSize);
6469  void setKeySize(int keySize);
6470  void setValueSize(int valueSize);
6471  void setRange(const QCPRange &keyRange, const QCPRange &valueRange);
6472  void setKeyRange(const QCPRange &keyRange);
6473  void setValueRange(const QCPRange &valueRange);
6474  void setData(double key, double value, double z);
6475  void setCell(int keyIndex, int valueIndex, double z);
6476  void setAlpha(int keyIndex, int valueIndex, unsigned char alpha);
6477 
6478  // non-property methods:
6480  void clear();
6481  void clearAlpha();
6482  void fill(double z);
6483  void fillAlpha(unsigned char alpha);
6484  bool isEmpty() const { return mIsEmpty; }
6485  void coordToCell(double key, double value, int *keyIndex,
6486  int *valueIndex) const;
6487  void cellToCoord(int keyIndex, int valueIndex, double *key,
6488  double *value) const;
6489 
6490  protected:
6491  // property members:
6492  int mKeySize, mValueSize;
6493  QCPRange mKeyRange, mValueRange;
6494  bool mIsEmpty;
6495 
6496  // non-property members:
6497  double *mData;
6498  unsigned char *mAlpha;
6499  QCPRange mDataBounds;
6500  bool mDataModified;
6501 
6502  bool createAlpha(bool initializeOpaque = true);
6503 
6504  friend class QCPColorMap;
6505 };
6506 
6508  Q_OBJECT
6510  Q_PROPERTY(QCPRange dataRange READ dataRange WRITE setDataRange NOTIFY
6511  dataRangeChanged)
6512  Q_PROPERTY(QCPAxis::ScaleType dataScaleType READ dataScaleType WRITE
6513  setDataScaleType NOTIFY dataScaleTypeChanged)
6514  Q_PROPERTY(QCPColorGradient gradient READ gradient WRITE setGradient NOTIFY
6515  gradientChanged)
6516  Q_PROPERTY(bool interpolate READ interpolate WRITE setInterpolate)
6517  Q_PROPERTY(bool tightBoundary READ tightBoundary WRITE setTightBoundary)
6518  Q_PROPERTY(QCPColorScale *colorScale READ colorScale WRITE setColorScale)
6520  public:
6521  explicit QCPColorMap(QCPAxis *keyAxis, QCPAxis *valueAxis);
6522  virtual ~QCPColorMap();
6523 
6524  // getters:
6525  QCPColorMapData *data() const { return mMapData; }
6526  QCPRange dataRange() const { return mDataRange; }
6527  QCPAxis::ScaleType dataScaleType() const { return mDataScaleType; }
6528  bool interpolate() const { return mInterpolate; }
6529  bool tightBoundary() const { return mTightBoundary; }
6530  QCPColorGradient gradient() const { return mGradient; }
6531  QCPColorScale *colorScale() const { return mColorScale.data(); }
6532 
6533  // setters:
6534  void setData(QCPColorMapData *data, bool copy = false);
6535  Q_SLOT void setDataRange(const QCPRange &dataRange);
6536  Q_SLOT void setDataScaleType(QCPAxis::ScaleType scaleType);
6537  Q_SLOT void setGradient(const QCPColorGradient &gradient);
6538  void setInterpolate(bool enabled);
6539  void setTightBoundary(bool enabled);
6540  void setColorScale(QCPColorScale *colorScale);
6541 
6542  // non-property methods:
6543  void rescaleDataRange(bool recalculateDataBounds = false);
6544  Q_SLOT void updateLegendIcon(
6545  Qt::TransformationMode transformMode = Qt::SmoothTransformation,
6546  const QSize &thumbSize = QSize(32, 18));
6547 
6548  // reimplemented virtual methods:
6549  virtual double selectTest(const QPointF &pos, bool onlySelectable,
6550  QVariant *details = 0) const Q_DECL_OVERRIDE;
6551  virtual QCPRange getKeyRange(bool &foundRange,
6552  QCP::SignDomain inSignDomain = QCP::sdBoth) const
6554  virtual QCPRange getValueRange(
6555  bool &foundRange, QCP::SignDomain inSignDomain = QCP::sdBoth,
6556  const QCPRange &inKeyRange = QCPRange()) const Q_DECL_OVERRIDE;
6557 
6558  signals:
6559  void dataRangeChanged(const QCPRange &newRange);
6560  void dataScaleTypeChanged(QCPAxis::ScaleType scaleType);
6561  void gradientChanged(const QCPColorGradient &newGradient);
6562 
6563  protected:
6564  // property members:
6565  QCPRange mDataRange;
6566  QCPAxis::ScaleType mDataScaleType;
6567  QCPColorMapData *mMapData;
6568  QCPColorGradient mGradient;
6569  bool mInterpolate;
6570  bool mTightBoundary;
6571  QPointer<QCPColorScale> mColorScale;
6572 
6573  // non-property members:
6574  QImage mMapImage, mUndersampledMapImage;
6575  QPixmap mLegendIcon;
6576  bool mMapImageInvalidated;
6577 
6578  // introduced virtual methods:
6579  virtual void updateMapImage();
6580 
6581  // reimplemented virtual methods:
6582  virtual void draw(QCPPainter *painter) Q_DECL_OVERRIDE;
6583  virtual void drawLegendIcon(QCPPainter *painter,
6584  const QRectF &rect) const Q_DECL_OVERRIDE;
6585 
6586  friend class QCustomPlot;
6587  friend class QCPLegend;
6588 };
6589 
6590 /* end of 'src/plottables/plottable-colormap.h' */
6591 
6592 /* including file 'src/plottables/plottable-financial.h', size 8622 */
6593 /* commit ce344b3f96a62e5f652585e55f1ae7c7883cd45b 2018-06-25 01:03:39 +0200 */
6594 
6596  public:
6598  QCPFinancialData(double key, double open, double high, double low,
6599  double close);
6600 
6601  inline double sortKey() const { return key; }
6602  inline static QCPFinancialData fromSortKey(double sortKey) {
6603  return QCPFinancialData(sortKey, 0, 0, 0, 0);
6604  }
6605  inline static bool sortKeyIsMainKey() { return true; }
6606 
6607  inline double mainKey() const { return key; }
6608  inline double mainValue() const { return open; }
6609 
6610  inline QCPRange valueRange() const {
6611  return QCPRange(low, high);
6612  } // open and close must lie between low and high, so we don't need to check
6613  // them
6614 
6615  double key, open, high, low, close;
6616 };
6618 
6631 
6633  : public QCPAbstractPlottable1D<QCPFinancialData> {
6634  Q_OBJECT
6636  Q_PROPERTY(ChartStyle chartStyle READ chartStyle WRITE setChartStyle)
6637  Q_PROPERTY(double width READ width WRITE setWidth)
6638  Q_PROPERTY(WidthType widthType READ widthType WRITE setWidthType)
6639  Q_PROPERTY(bool twoColored READ twoColored WRITE setTwoColored)
6640  Q_PROPERTY(QBrush brushPositive READ brushPositive WRITE setBrushPositive)
6641  Q_PROPERTY(QBrush brushNegative READ brushNegative WRITE setBrushNegative)
6642  Q_PROPERTY(QPen penPositive READ penPositive WRITE setPenPositive)
6643  Q_PROPERTY(QPen penNegative READ penNegative WRITE setPenNegative)
6645  public:
6652  enum WidthType {
6653  wtAbsolute
6654  ,
6655  wtAxisRectRatio
6656  ,
6657  wtPlotCoords
6659  };
6660  Q_ENUMS(WidthType)
6661 
6662 
6667  enum ChartStyle {
6668  csOhlc
6669  ,
6670  csCandlestick
6671  };
6672  Q_ENUMS(ChartStyle)
6673 
6674  explicit QCPFinancial(QCPAxis *keyAxis, QCPAxis *valueAxis);
6675  virtual ~QCPFinancial();
6676 
6677  // getters:
6678  QSharedPointer<QCPFinancialDataContainer> data() const {
6679  return mDataContainer;
6680  }
6681  ChartStyle chartStyle() const { return mChartStyle; }
6682  double width() const { return mWidth; }
6683  WidthType widthType() const { return mWidthType; }
6684  bool twoColored() const { return mTwoColored; }
6685  QBrush brushPositive() const { return mBrushPositive; }
6686  QBrush brushNegative() const { return mBrushNegative; }
6687  QPen penPositive() const { return mPenPositive; }
6688  QPen penNegative() const { return mPenNegative; }
6689 
6690  // setters:
6691  void setData(QSharedPointer<QCPFinancialDataContainer> data);
6692  void setData(const QVector<double> &keys, const QVector<double> &open,
6693  const QVector<double> &high, const QVector<double> &low,
6694  const QVector<double> &close, bool alreadySorted = false);
6696  void setWidth(double width);
6697  void setWidthType(WidthType widthType);
6698  void setTwoColored(bool twoColored);
6699  void setBrushPositive(const QBrush &brush);
6700  void setBrushNegative(const QBrush &brush);
6701  void setPenPositive(const QPen &pen);
6702  void setPenNegative(const QPen &pen);
6703 
6704  // non-property methods:
6705  void addData(const QVector<double> &keys, const QVector<double> &open,
6706  const QVector<double> &high, const QVector<double> &low,
6707  const QVector<double> &close, bool alreadySorted = false);
6708  void addData(double key, double open, double high, double low, double close);
6709 
6710  // reimplemented virtual methods:
6712  const QRectF &rect, bool onlySelectable) const Q_DECL_OVERRIDE;
6713  virtual double selectTest(const QPointF &pos, bool onlySelectable,
6714  QVariant *details = 0) const Q_DECL_OVERRIDE;
6715  virtual QCPRange getKeyRange(bool &foundRange,
6716  QCP::SignDomain inSignDomain = QCP::sdBoth) const
6718  virtual QCPRange getValueRange(
6719  bool &foundRange, QCP::SignDomain inSignDomain = QCP::sdBoth,
6720  const QCPRange &inKeyRange = QCPRange()) const Q_DECL_OVERRIDE;
6721 
6722  // static methods:
6723  static QCPFinancialDataContainer timeSeriesToOhlc(
6724  const QVector<double> &time, const QVector<double> &value,
6725  double timeBinSize, double timeBinOffset = 0);
6726 
6727  protected:
6728  // property members:
6729  ChartStyle mChartStyle;
6730  double mWidth;
6731  WidthType mWidthType;
6732  bool mTwoColored;
6733  QBrush mBrushPositive, mBrushNegative;
6734  QPen mPenPositive, mPenNegative;
6735 
6736  // reimplemented virtual methods:
6737  virtual void draw(QCPPainter *painter) Q_DECL_OVERRIDE;
6738  virtual void drawLegendIcon(QCPPainter *painter,
6739  const QRectF &rect) const Q_DECL_OVERRIDE;
6740 
6741  // non-virtual methods:
6742  void drawOhlcPlot(QCPPainter *painter,
6743  const QCPFinancialDataContainer::const_iterator &begin,
6744  const QCPFinancialDataContainer::const_iterator &end,
6745  bool isSelected);
6746  void drawCandlestickPlot(
6747  QCPPainter *painter,
6748  const QCPFinancialDataContainer::const_iterator &begin,
6749  const QCPFinancialDataContainer::const_iterator &end, bool isSelected);
6750  double getPixelWidth(double key, double keyPixel) const;
6751  double ohlcSelectTest(
6752  const QPointF &pos,
6753  const QCPFinancialDataContainer::const_iterator &begin,
6754  const QCPFinancialDataContainer::const_iterator &end,
6755  QCPFinancialDataContainer::const_iterator &closestDataPoint) const;
6756  double candlestickSelectTest(
6757  const QPointF &pos,
6758  const QCPFinancialDataContainer::const_iterator &begin,
6759  const QCPFinancialDataContainer::const_iterator &end,
6760  QCPFinancialDataContainer::const_iterator &closestDataPoint) const;
6761  void getVisibleDataBounds(
6762  QCPFinancialDataContainer::const_iterator &begin,
6763  QCPFinancialDataContainer::const_iterator &end) const;
6764  QRectF selectionHitBox(QCPFinancialDataContainer::const_iterator it) const;
6765 
6766  friend class QCustomPlot;
6767  friend class QCPLegend;
6768 };
6769 Q_DECLARE_METATYPE(QCPFinancial::ChartStyle)
6770 
6771 /* end of 'src/plottables/plottable-financial.h' */
6772 
6773 /* including file 'src/plottables/plottable-errorbar.h', size 7727 */
6774 /* commit ce344b3f96a62e5f652585e55f1ae7c7883cd45b 2018-06-25 01:03:39 +0200 */
6775 
6777  public:
6779  explicit QCPErrorBarsData(double error);
6780  QCPErrorBarsData(double errorMinus, double errorPlus);
6781 
6782  double errorMinus, errorPlus;
6783 };
6785 
6802 typedef QVector<QCPErrorBarsData> QCPErrorBarsDataContainer;
6803 
6805  public QCPPlottableInterface1D {
6806  Q_OBJECT
6808  Q_PROPERTY(
6809  QSharedPointer<QCPErrorBarsDataContainer> data READ data WRITE setData)
6810  Q_PROPERTY(QCPAbstractPlottable *dataPlottable READ dataPlottable WRITE
6811  setDataPlottable)
6812  Q_PROPERTY(ErrorType errorType READ errorType WRITE setErrorType)
6813  Q_PROPERTY(double whiskerWidth READ whiskerWidth WRITE setWhiskerWidth)
6814  Q_PROPERTY(double symbolGap READ symbolGap WRITE setSymbolGap)
6816  public:
6824  enum ErrorType {
6825  etKeyError
6827  ,
6828  etValueError
6830  };
6831  Q_ENUMS(ErrorType)
6832 
6833  explicit QCPErrorBars(QCPAxis *keyAxis, QCPAxis *valueAxis);
6834  virtual ~QCPErrorBars();
6835  // getters:
6836  QSharedPointer<QCPErrorBarsDataContainer> data() const {
6837  return mDataContainer;
6838  }
6839  QCPAbstractPlottable *dataPlottable() const { return mDataPlottable.data(); }
6840  ErrorType errorType() const { return mErrorType; }
6841  double whiskerWidth() const { return mWhiskerWidth; }
6842  double symbolGap() const { return mSymbolGap; }
6843 
6844  // setters:
6845  void setData(QSharedPointer<QCPErrorBarsDataContainer> data);
6846  void setData(const QVector<double> &error);
6847  void setData(const QVector<double> &errorMinus,
6848  const QVector<double> &errorPlus);
6851  void setWhiskerWidth(double pixels);
6852  void setSymbolGap(double pixels);
6853 
6854  // non-property methods:
6855  void addData(const QVector<double> &error);
6856  void addData(const QVector<double> &errorMinus,
6857  const QVector<double> &errorPlus);
6858  void addData(double error);
6859  void addData(double errorMinus, double errorPlus);
6860 
6861  // virtual methods of 1d plottable interface:
6862  virtual int dataCount() const Q_DECL_OVERRIDE;
6863  virtual double dataMainKey(int index) const Q_DECL_OVERRIDE;
6864  virtual double dataSortKey(int index) const Q_DECL_OVERRIDE;
6865  virtual double dataMainValue(int index) const Q_DECL_OVERRIDE;
6866  virtual QCPRange dataValueRange(int index) const Q_DECL_OVERRIDE;
6867  virtual QPointF dataPixelPosition(int index) const Q_DECL_OVERRIDE;
6868  virtual bool sortKeyIsMainKey() const Q_DECL_OVERRIDE;
6869  virtual QCPDataSelection selectTestRect(
6870  const QRectF &rect, bool onlySelectable) const Q_DECL_OVERRIDE;
6871  virtual int findBegin(double sortKey,
6872  bool expandedRange = true) const Q_DECL_OVERRIDE;
6873  virtual int findEnd(double sortKey,
6874  bool expandedRange = true) const Q_DECL_OVERRIDE;
6875 
6876  // reimplemented virtual methods:
6877  virtual double selectTest(const QPointF &pos, bool onlySelectable,
6878  QVariant *details = 0) const Q_DECL_OVERRIDE;
6879  virtual QCPPlottableInterface1D *interface1D() Q_DECL_OVERRIDE {
6880  return this;
6881  }
6882 
6883  protected:
6884  // property members:
6885  QSharedPointer<QCPErrorBarsDataContainer> mDataContainer;
6886  QPointer<QCPAbstractPlottable> mDataPlottable;
6889  double mSymbolGap;
6890 
6891  // reimplemented virtual methods:
6892  virtual void draw(QCPPainter *painter) Q_DECL_OVERRIDE;
6893  virtual void drawLegendIcon(QCPPainter *painter,
6894  const QRectF &rect) const Q_DECL_OVERRIDE;
6895  virtual QCPRange getKeyRange(bool &foundRange,
6896  QCP::SignDomain inSignDomain = QCP::sdBoth) const
6899  bool &foundRange, QCP::SignDomain inSignDomain = QCP::sdBoth,
6900  const QCPRange &inKeyRange = QCPRange()) const Q_DECL_OVERRIDE;
6901 
6902  // non-virtual methods:
6903  void getErrorBarLines(QCPErrorBarsDataContainer::const_iterator it,
6904  QVector<QLineF> &backbones,
6905  QVector<QLineF> &whiskers) const;
6906  void getVisibleDataBounds(QCPErrorBarsDataContainer::const_iterator &begin,
6907  QCPErrorBarsDataContainer::const_iterator &end,
6908  const QCPDataRange &rangeRestriction) const;
6909  double pointDistance(
6910  const QPointF &pixelPoint,
6911  QCPErrorBarsDataContainer::const_iterator &closestData) const;
6912  // helpers:
6913  void getDataSegments(QList<QCPDataRange> &selectedSegments,
6914  QList<QCPDataRange> &unselectedSegments) const;
6915  bool errorBarVisible(int index) const;
6916  bool rectIntersectsLine(const QRectF &pixelRect, const QLineF &line) const;
6917 
6918  friend class QCustomPlot;
6919  friend class QCPLegend;
6920 };
6921 
6922 /* end of 'src/plottables/plottable-errorbar.h' */
6923 
6924 /* including file 'src/items/item-straightline.h', size 3117 */
6925 /* commit ce344b3f96a62e5f652585e55f1ae7c7883cd45b 2018-06-25 01:03:39 +0200 */
6926 
6928  Q_OBJECT
6930  Q_PROPERTY(QPen pen READ pen WRITE setPen)
6931  Q_PROPERTY(QPen selectedPen READ selectedPen WRITE setSelectedPen)
6933  public:
6934  explicit QCPItemStraightLine(QCustomPlot *parentPlot);
6936 
6937  // getters:
6938  QPen pen() const { return mPen; }
6939  QPen selectedPen() const { return mSelectedPen; }
6940 
6941  // setters;
6942  void setPen(const QPen &pen);
6943  void setSelectedPen(const QPen &pen);
6944 
6945  // reimplemented virtual methods:
6946  virtual double selectTest(const QPointF &pos, bool onlySelectable,
6947  QVariant *details = 0) const Q_DECL_OVERRIDE;
6948 
6949  QCPItemPosition *const point1;
6950  QCPItemPosition *const point2;
6951 
6952  protected:
6953  // property members:
6954  QPen mPen, mSelectedPen;
6955 
6956  // reimplemented virtual methods:
6957  virtual void draw(QCPPainter *painter) Q_DECL_OVERRIDE;
6958 
6959  // non-virtual methods:
6960  QLineF getRectClippedStraightLine(const QCPVector2D &point1,
6961  const QCPVector2D &vec,
6962  const QRect &rect) const;
6963  QPen mainPen() const;
6964 };
6965 
6966 /* end of 'src/items/item-straightline.h' */
6967 
6968 /* including file 'src/items/item-line.h', size 3407 */
6969 /* commit ce344b3f96a62e5f652585e55f1ae7c7883cd45b 2018-06-25 01:03:39 +0200 */
6970 
6971 class QCP_LIB_DECL QCPItemLine : public QCPAbstractItem {
6972  Q_OBJECT
6974  Q_PROPERTY(QPen pen READ pen WRITE setPen)
6975  Q_PROPERTY(QPen selectedPen READ selectedPen WRITE setSelectedPen)
6976  Q_PROPERTY(QCPLineEnding head READ head WRITE setHead)
6977  Q_PROPERTY(QCPLineEnding tail READ tail WRITE setTail)
6979  public:
6980  explicit QCPItemLine(QCustomPlot *parentPlot);
6981  virtual ~QCPItemLine();
6982 
6983  // getters:
6984  QPen pen() const { return mPen; }
6985  QPen selectedPen() const { return mSelectedPen; }
6986  QCPLineEnding head() const { return mHead; }
6987  QCPLineEnding tail() const { return mTail; }
6988 
6989  // setters;
6990  void setPen(const QPen &pen);
6991  void setSelectedPen(const QPen &pen);
6992  void setHead(const QCPLineEnding &head);
6993  void setTail(const QCPLineEnding &tail);
6994 
6995  // reimplemented virtual methods:
6996  virtual double selectTest(const QPointF &pos, bool onlySelectable,
6997  QVariant *details = 0) const Q_DECL_OVERRIDE;
6998 
6999  QCPItemPosition *const start;
7000  QCPItemPosition *const end;
7001 
7002  protected:
7003  // property members:
7004  QPen mPen, mSelectedPen;
7005  QCPLineEnding mHead, mTail;
7006 
7007  // reimplemented virtual methods:
7008  virtual void draw(QCPPainter *painter) Q_DECL_OVERRIDE;
7009 
7010  // non-virtual methods:
7011  QLineF getRectClippedLine(const QCPVector2D &start, const QCPVector2D &end,
7012  const QRect &rect) const;
7013  QPen mainPen() const;
7014 };
7015 
7016 /* end of 'src/items/item-line.h' */
7017 
7018 /* including file 'src/items/item-curve.h', size 3379 */
7019 /* commit ce344b3f96a62e5f652585e55f1ae7c7883cd45b 2018-06-25 01:03:39 +0200 */
7020 
7021 class QCP_LIB_DECL QCPItemCurve : public QCPAbstractItem {
7022  Q_OBJECT
7024  Q_PROPERTY(QPen pen READ pen WRITE setPen)
7025  Q_PROPERTY(QPen selectedPen READ selectedPen WRITE setSelectedPen)
7026  Q_PROPERTY(QCPLineEnding head READ head WRITE setHead)
7027  Q_PROPERTY(QCPLineEnding tail READ tail WRITE setTail)
7029  public:
7030  explicit QCPItemCurve(QCustomPlot *parentPlot);
7031  virtual ~QCPItemCurve();
7032 
7033  // getters:
7034  QPen pen() const { return mPen; }
7035  QPen selectedPen() const { return mSelectedPen; }
7036  QCPLineEnding head() const { return mHead; }
7037  QCPLineEnding tail() const { return mTail; }
7038 
7039  // setters;
7040  void setPen(const QPen &pen);
7041  void setSelectedPen(const QPen &pen);
7042  void setHead(const QCPLineEnding &head);
7043  void setTail(const QCPLineEnding &tail);
7044 
7045  // reimplemented virtual methods:
7046  virtual double selectTest(const QPointF &pos, bool onlySelectable,
7047  QVariant *details = 0) const Q_DECL_OVERRIDE;
7048 
7049  QCPItemPosition *const start;
7050  QCPItemPosition *const startDir;
7051  QCPItemPosition *const endDir;
7052  QCPItemPosition *const end;
7053 
7054  protected:
7055  // property members:
7056  QPen mPen, mSelectedPen;
7057  QCPLineEnding mHead, mTail;
7058 
7059  // reimplemented virtual methods:
7060  virtual void draw(QCPPainter *painter) Q_DECL_OVERRIDE;
7061 
7062  // non-virtual methods:
7063  QPen mainPen() const;
7064 };
7065 
7066 /* end of 'src/items/item-curve.h' */
7067 
7068 /* including file 'src/items/item-rect.h', size 3688 */
7069 /* commit ce344b3f96a62e5f652585e55f1ae7c7883cd45b 2018-06-25 01:03:39 +0200 */
7070 
7071 class QCP_LIB_DECL QCPItemRect : public QCPAbstractItem {
7072  Q_OBJECT
7074  Q_PROPERTY(QPen pen READ pen WRITE setPen)
7075  Q_PROPERTY(QPen selectedPen READ selectedPen WRITE setSelectedPen)
7076  Q_PROPERTY(QBrush brush READ brush WRITE setBrush)
7077  Q_PROPERTY(QBrush selectedBrush READ selectedBrush WRITE setSelectedBrush)
7079  public:
7080  explicit QCPItemRect(QCustomPlot *parentPlot);
7081  virtual ~QCPItemRect();
7082 
7083  // getters:
7084  QPen pen() const { return mPen; }
7085  QPen selectedPen() const { return mSelectedPen; }
7086  QBrush brush() const { return mBrush; }
7087  QBrush selectedBrush() const { return mSelectedBrush; }
7088 
7089  // setters;
7090  void setPen(const QPen &pen);
7091  void setSelectedPen(const QPen &pen);
7092  void setBrush(const QBrush &brush);
7093  void setSelectedBrush(const QBrush &brush);
7094 
7095  // reimplemented virtual methods:
7096  virtual double selectTest(const QPointF &pos, bool onlySelectable,
7097  QVariant *details = 0) const Q_DECL_OVERRIDE;
7098 
7099  QCPItemPosition *const topLeft;
7100  QCPItemPosition *const bottomRight;
7101  QCPItemAnchor *const top;
7102  QCPItemAnchor *const topRight;
7103  QCPItemAnchor *const right;
7104  QCPItemAnchor *const bottom;
7105  QCPItemAnchor *const bottomLeft;
7106  QCPItemAnchor *const left;
7107 
7108  protected:
7110  aiTop,
7111  aiTopRight,
7112  aiRight,
7113  aiBottom,
7114  aiBottomLeft,
7115  aiLeft
7116  };
7117 
7118  // property members:
7119  QPen mPen, mSelectedPen;
7120  QBrush mBrush, mSelectedBrush;
7121 
7122  // reimplemented virtual methods:
7123  virtual void draw(QCPPainter *painter) Q_DECL_OVERRIDE;
7124  virtual QPointF anchorPixelPosition(int anchorId) const Q_DECL_OVERRIDE;
7125 
7126  // non-virtual methods:
7127  QPen mainPen() const;
7128  QBrush mainBrush() const;
7129 };
7130 
7131 /* end of 'src/items/item-rect.h' */
7132 
7133 /* including file 'src/items/item-text.h', size 5554 */
7134 /* commit ce344b3f96a62e5f652585e55f1ae7c7883cd45b 2018-06-25 01:03:39 +0200 */
7135 
7136 class QCP_LIB_DECL QCPItemText : public QCPAbstractItem {
7137  Q_OBJECT
7139  Q_PROPERTY(QColor color READ color WRITE setColor)
7140  Q_PROPERTY(QColor selectedColor READ selectedColor WRITE setSelectedColor)
7141  Q_PROPERTY(QPen pen READ pen WRITE setPen)
7142  Q_PROPERTY(QPen selectedPen READ selectedPen WRITE setSelectedPen)
7143  Q_PROPERTY(QBrush brush READ brush WRITE setBrush)
7144  Q_PROPERTY(QBrush selectedBrush READ selectedBrush WRITE setSelectedBrush)
7145  Q_PROPERTY(QFont font READ font WRITE setFont)
7146  Q_PROPERTY(QFont selectedFont READ selectedFont WRITE setSelectedFont)
7147  Q_PROPERTY(QString text READ text WRITE setText)
7148  Q_PROPERTY(Qt::Alignment positionAlignment READ positionAlignment WRITE
7149  setPositionAlignment)
7150  Q_PROPERTY(
7151  Qt::Alignment textAlignment READ textAlignment WRITE setTextAlignment)
7152  Q_PROPERTY(double rotation READ rotation WRITE setRotation)
7153  Q_PROPERTY(QMargins padding READ padding WRITE setPadding)
7155  public:
7156  explicit QCPItemText(QCustomPlot *parentPlot);
7157  virtual ~QCPItemText();
7158 
7159  // getters:
7160  QColor color() const { return mColor; }
7161  QColor selectedColor() const { return mSelectedColor; }
7162  QPen pen() const { return mPen; }
7163  QPen selectedPen() const { return mSelectedPen; }
7164  QBrush brush() const { return mBrush; }
7165  QBrush selectedBrush() const { return mSelectedBrush; }
7166  QFont font() const { return mFont; }
7167  QFont selectedFont() const { return mSelectedFont; }
7168  QString text() const { return mText; }
7169  Qt::Alignment positionAlignment() const { return mPositionAlignment; }
7170  Qt::Alignment textAlignment() const { return mTextAlignment; }
7171  double rotation() const { return mRotation; }
7172  QMargins padding() const { return mPadding; }
7173 
7174  // setters;
7175  void setColor(const QColor &color);
7176  void setSelectedColor(const QColor &color);
7177  void setPen(const QPen &pen);
7178  void setSelectedPen(const QPen &pen);
7179  void setBrush(const QBrush &brush);
7180  void setSelectedBrush(const QBrush &brush);
7181  void setFont(const QFont &font);
7182  void setSelectedFont(const QFont &font);
7183  void setText(const QString &text);
7184  void setPositionAlignment(Qt::Alignment alignment);
7185  void setTextAlignment(Qt::Alignment alignment);
7186  void setRotation(double degrees);
7187  void setPadding(const QMargins &padding);
7188 
7189  // reimplemented virtual methods:
7190  virtual double selectTest(const QPointF &pos, bool onlySelectable,
7191  QVariant *details = 0) const Q_DECL_OVERRIDE;
7192 
7193  QCPItemPosition *const position;
7194  QCPItemAnchor *const topLeft;
7195  QCPItemAnchor *const top;
7196  QCPItemAnchor *const topRight;
7197  QCPItemAnchor *const right;
7198  QCPItemAnchor *const bottomRight;
7199  QCPItemAnchor *const bottom;
7200  QCPItemAnchor *const bottomLeft;
7201  QCPItemAnchor *const left;
7202 
7203  protected:
7205  aiTopLeft,
7206  aiTop,
7207  aiTopRight,
7208  aiRight,
7209  aiBottomRight,
7210  aiBottom,
7211  aiBottomLeft,
7212  aiLeft
7213  };
7214 
7215  // property members:
7216  QColor mColor, mSelectedColor;
7217  QPen mPen, mSelectedPen;
7218  QBrush mBrush, mSelectedBrush;
7219  QFont mFont, mSelectedFont;
7220  QString mText;
7221  Qt::Alignment mPositionAlignment;
7222  Qt::Alignment mTextAlignment;
7223  double mRotation;
7224  QMargins mPadding;
7225 
7226  // reimplemented virtual methods:
7227  virtual void draw(QCPPainter *painter) Q_DECL_OVERRIDE;
7228  virtual QPointF anchorPixelPosition(int anchorId) const Q_DECL_OVERRIDE;
7229 
7230  // non-virtual methods:
7231  QPointF getTextDrawPoint(const QPointF &pos, const QRectF &rect,
7232  Qt::Alignment positionAlignment) const;
7233  QFont mainFont() const;
7234  QColor mainColor() const;
7235  QPen mainPen() const;
7236  QBrush mainBrush() const;
7237 };
7238 
7239 /* end of 'src/items/item-text.h' */
7240 
7241 /* including file 'src/items/item-ellipse.h', size 3868 */
7242 /* commit ce344b3f96a62e5f652585e55f1ae7c7883cd45b 2018-06-25 01:03:39 +0200 */
7243 
7245  Q_OBJECT
7247  Q_PROPERTY(QPen pen READ pen WRITE setPen)
7248  Q_PROPERTY(QPen selectedPen READ selectedPen WRITE setSelectedPen)
7249  Q_PROPERTY(QBrush brush READ brush WRITE setBrush)
7250  Q_PROPERTY(QBrush selectedBrush READ selectedBrush WRITE setSelectedBrush)
7252  public:
7253  explicit QCPItemEllipse(QCustomPlot *parentPlot);
7254  virtual ~QCPItemEllipse();
7255 
7256  // getters:
7257  QPen pen() const { return mPen; }
7258  QPen selectedPen() const { return mSelectedPen; }
7259  QBrush brush() const { return mBrush; }
7260  QBrush selectedBrush() const { return mSelectedBrush; }
7261 
7262  // setters;
7263  void setPen(const QPen &pen);
7264  void setSelectedPen(const QPen &pen);
7265  void setBrush(const QBrush &brush);
7266  void setSelectedBrush(const QBrush &brush);
7267 
7268  // reimplemented virtual methods:
7269  virtual double selectTest(const QPointF &pos, bool onlySelectable,
7270  QVariant *details = 0) const Q_DECL_OVERRIDE;
7271 
7272  QCPItemPosition *const topLeft;
7273  QCPItemPosition *const bottomRight;
7274  QCPItemAnchor *const topLeftRim;
7275  QCPItemAnchor *const top;
7276  QCPItemAnchor *const topRightRim;
7277  QCPItemAnchor *const right;
7278  QCPItemAnchor *const bottomRightRim;
7279  QCPItemAnchor *const bottom;
7280  QCPItemAnchor *const bottomLeftRim;
7281  QCPItemAnchor *const left;
7282  QCPItemAnchor *const center;
7283 
7284  protected:
7286  aiTopLeftRim,
7287  aiTop,
7288  aiTopRightRim,
7289  aiRight,
7290  aiBottomRightRim,
7291  aiBottom,
7292  aiBottomLeftRim,
7293  aiLeft,
7294  aiCenter
7295  };
7296 
7297  // property members:
7298  QPen mPen, mSelectedPen;
7299  QBrush mBrush, mSelectedBrush;
7300 
7301  // reimplemented virtual methods:
7302  virtual void draw(QCPPainter *painter) Q_DECL_OVERRIDE;
7303  virtual QPointF anchorPixelPosition(int anchorId) const Q_DECL_OVERRIDE;
7304 
7305  // non-virtual methods:
7306  QPen mainPen() const;
7307  QBrush mainBrush() const;
7308 };
7309 
7310 /* end of 'src/items/item-ellipse.h' */
7311 
7312 /* including file 'src/items/item-pixmap.h', size 4373 */
7313 /* commit ce344b3f96a62e5f652585e55f1ae7c7883cd45b 2018-06-25 01:03:39 +0200 */
7314 
7316  Q_OBJECT
7318  Q_PROPERTY(QPixmap pixmap READ pixmap WRITE setPixmap)
7319  Q_PROPERTY(bool scaled READ scaled WRITE setScaled)
7320  Q_PROPERTY(Qt::AspectRatioMode aspectRatioMode READ aspectRatioMode)
7321  Q_PROPERTY(Qt::TransformationMode transformationMode READ transformationMode)
7322  Q_PROPERTY(QPen pen READ pen WRITE setPen)
7323  Q_PROPERTY(QPen selectedPen READ selectedPen WRITE setSelectedPen)
7325  public:
7326  explicit QCPItemPixmap(QCustomPlot *parentPlot);
7327  virtual ~QCPItemPixmap();
7328 
7329  // getters:
7330  QPixmap pixmap() const { return mPixmap; }
7331  bool scaled() const { return mScaled; }
7332  Qt::AspectRatioMode aspectRatioMode() const { return mAspectRatioMode; }
7333  Qt::TransformationMode transformationMode() const {
7334  return mTransformationMode;
7335  }
7336  QPen pen() const { return mPen; }
7337  QPen selectedPen() const { return mSelectedPen; }
7338 
7339  // setters;
7340  void setPixmap(const QPixmap &pixmap);
7342  bool scaled, Qt::AspectRatioMode aspectRatioMode = Qt::KeepAspectRatio,
7343  Qt::TransformationMode transformationMode = Qt::SmoothTransformation);
7344  void setPen(const QPen &pen);
7345  void setSelectedPen(const QPen &pen);
7346 
7347  // reimplemented virtual methods:
7348  virtual double selectTest(const QPointF &pos, bool onlySelectable,
7349  QVariant *details = 0) const Q_DECL_OVERRIDE;
7350 
7351  QCPItemPosition *const topLeft;
7352  QCPItemPosition *const bottomRight;
7353  QCPItemAnchor *const top;
7354  QCPItemAnchor *const topRight;
7355  QCPItemAnchor *const right;
7356  QCPItemAnchor *const bottom;
7357  QCPItemAnchor *const bottomLeft;
7358  QCPItemAnchor *const left;
7359 
7360  protected:
7362  aiTop,
7363  aiTopRight,
7364  aiRight,
7365  aiBottom,
7366  aiBottomLeft,
7367  aiLeft
7368  };
7369 
7370  // property members:
7371  QPixmap mPixmap;
7372  QPixmap mScaledPixmap;
7373  bool mScaled;
7374  bool mScaledPixmapInvalidated;
7375  Qt::AspectRatioMode mAspectRatioMode;
7376  Qt::TransformationMode mTransformationMode;
7377  QPen mPen, mSelectedPen;
7378 
7379  // reimplemented virtual methods:
7380  virtual void draw(QCPPainter *painter) Q_DECL_OVERRIDE;
7381  virtual QPointF anchorPixelPosition(int anchorId) const Q_DECL_OVERRIDE;
7382 
7383  // non-virtual methods:
7384  void updateScaledPixmap(QRect finalRect = QRect(), bool flipHorz = false,
7385  bool flipVert = false);
7386  QRect getFinalRect(bool *flippedHorz = 0, bool *flippedVert = 0) const;
7387  QPen mainPen() const;
7388 };
7389 
7390 /* end of 'src/items/item-pixmap.h' */
7391 
7392 /* including file 'src/items/item-tracer.h', size 4762 */
7393 /* commit ce344b3f96a62e5f652585e55f1ae7c7883cd45b 2018-06-25 01:03:39 +0200 */
7394 
7396  Q_OBJECT
7398  Q_PROPERTY(QPen pen READ pen WRITE setPen)
7399  Q_PROPERTY(QPen selectedPen READ selectedPen WRITE setSelectedPen)
7400  Q_PROPERTY(QBrush brush READ brush WRITE setBrush)
7401  Q_PROPERTY(QBrush selectedBrush READ selectedBrush WRITE setSelectedBrush)
7402  Q_PROPERTY(double size READ size WRITE setSize)
7403  Q_PROPERTY(TracerStyle style READ style WRITE setStyle)
7404  Q_PROPERTY(QCPGraph *graph READ graph WRITE setGraph)
7405  Q_PROPERTY(double graphKey READ graphKey WRITE setGraphKey)
7406  Q_PROPERTY(bool interpolating READ interpolating WRITE setInterpolating)
7408  public:
7416  tsNone
7417  ,
7418  tsPlus
7419  ,
7420  tsCrosshair
7421  ,
7422  tsCircle
7423  ,
7424  tsSquare
7425  };
7426  Q_ENUMS(TracerStyle)
7427 
7428  explicit QCPItemTracer(QCustomPlot *parentPlot);
7429  virtual ~QCPItemTracer();
7430 
7431  // getters:
7432  QPen pen() const { return mPen; }
7433  QPen selectedPen() const { return mSelectedPen; }
7434  QBrush brush() const { return mBrush; }
7435  QBrush selectedBrush() const { return mSelectedBrush; }
7436  double size() const { return mSize; }
7437  TracerStyle style() const { return mStyle; }
7438  QCPGraph *graph() const { return mGraph; }
7439  double graphKey() const { return mGraphKey; }
7440  bool interpolating() const { return mInterpolating; }
7441 
7442  // setters;
7443  void setPen(const QPen &pen);
7444  void setSelectedPen(const QPen &pen);
7445  void setBrush(const QBrush &brush);
7446  void setSelectedBrush(const QBrush &brush);
7447  void setSize(double size);
7448  void setStyle(TracerStyle style);
7449  void setGraph(QCPGraph *graph);
7450  void setGraphKey(double key);
7451  void setInterpolating(bool enabled);
7452 
7453  // reimplemented virtual methods:
7454  virtual double selectTest(const QPointF &pos, bool onlySelectable,
7455  QVariant *details = 0) const Q_DECL_OVERRIDE;
7456 
7457  // non-virtual methods:
7458  void updatePosition();
7459 
7460  QCPItemPosition *const position;
7461 
7462  protected:
7463  // property members:
7464  QPen mPen, mSelectedPen;
7465  QBrush mBrush, mSelectedBrush;
7466  double mSize;
7467  TracerStyle mStyle;
7468  QCPGraph *mGraph;
7469  double mGraphKey;
7470  bool mInterpolating;
7471 
7472  // reimplemented virtual methods:
7473  virtual void draw(QCPPainter *painter) Q_DECL_OVERRIDE;
7474 
7475  // non-virtual methods:
7476  QPen mainPen() const;
7477  QBrush mainBrush() const;
7478 };
7479 Q_DECLARE_METATYPE(QCPItemTracer::TracerStyle)
7480 
7481 /* end of 'src/items/item-tracer.h' */
7482 
7483 /* including file 'src/items/item-bracket.h', size 3969 */
7484 /* commit ce344b3f96a62e5f652585e55f1ae7c7883cd45b 2018-06-25 01:03:39 +0200 */
7485 
7487  Q_OBJECT
7489  Q_PROPERTY(QPen pen READ pen WRITE setPen)
7490  Q_PROPERTY(QPen selectedPen READ selectedPen WRITE setSelectedPen)
7491  Q_PROPERTY(double length READ length WRITE setLength)
7492  Q_PROPERTY(BracketStyle style READ style WRITE setStyle)
7494  public:
7502  bsSquare
7503  ,
7504  bsRound
7505  ,
7506  bsCurly
7507  ,
7508  bsCalligraphic
7510  };
7511  Q_ENUMS(BracketStyle)
7512 
7513  explicit QCPItemBracket(QCustomPlot *parentPlot);
7514  virtual ~QCPItemBracket();
7515 
7516  // getters:
7517  QPen pen() const { return mPen; }
7518  QPen selectedPen() const { return mSelectedPen; }
7519  double length() const { return mLength; }
7520  BracketStyle style() const { return mStyle; }
7521 
7522  // setters;
7523  void setPen(const QPen &pen);
7524  void setSelectedPen(const QPen &pen);
7525  void setLength(double length);
7526  void setStyle(BracketStyle style);
7527 
7528  // reimplemented virtual methods:
7529  virtual double selectTest(const QPointF &pos, bool onlySelectable,
7530  QVariant *details = 0) const Q_DECL_OVERRIDE;
7531 
7532  QCPItemPosition *const left;
7533  QCPItemPosition *const right;
7534  QCPItemAnchor *const center;
7535 
7536  protected:
7537  // property members:
7538  enum AnchorIndex { aiCenter };
7539  QPen mPen, mSelectedPen;
7540  double mLength;
7541  BracketStyle mStyle;
7542 
7543  // reimplemented virtual methods:
7544  virtual void draw(QCPPainter *painter) Q_DECL_OVERRIDE;
7545  virtual QPointF anchorPixelPosition(int anchorId) const Q_DECL_OVERRIDE;
7546 
7547  // non-virtual methods:
7548  QPen mainPen() const;
7549 };
7550 Q_DECLARE_METATYPE(QCPItemBracket::BracketStyle)
7551 
7552 /* end of 'src/items/item-bracket.h' */
7553 
7554 #endif // QCUSTOMPLOT_H
Definition: qcustomplot.h:1847
QList< QCPItemAnchor * > anchors() const
Definition: qcustomplot.h:3982
void setClipToAxisRect(bool clip)
bool clipToAxisRect() const
Definition: qcustomplot.h:3965
void selectableChanged(bool selectable)
void setClipAxisRect(QCPAxisRect *rect)
QCPAxisRect * clipAxisRect() const
bool hasAnchor(const QString &name) const
QCPItemPosition * position(const QString &name) const
QCPAbstractItem(QCustomPlot *parentPlot)
bool selected() const
Definition: qcustomplot.h:3968
Q_SLOT void setSelected(bool selected)
void selectionChanged(bool selected)
Q_SLOT void setSelectable(bool selectable)
QCPItemAnchor * anchor(const QString &name) const
bool selectable() const
Definition: qcustomplot.h:3967
virtual ~QCPAbstractItem()
virtual double selectTest(const QPointF &pos, bool onlySelectable, QVariant *details=0) const Q_DECL_OVERRIDE=0
virtual QCP::Interaction selectionCategory() const Q_DECL_OVERRIDE
Definition: qcustomplot.h:2410
QColor selectedTextColor() const
Definition: qcustomplot.h:5343
QCPLegend * parentLegend() const
Definition: qcustomplot.h:5339
QColor textColor() const
Definition: qcustomplot.h:5341
void setFont(const QFont &font)
void setSelectedTextColor(const QColor &color)
QFont font() const
Definition: qcustomplot.h:5340
void setTextColor(const QColor &color)
Q_SLOT void setSelectable(bool selectable)
virtual double selectTest(const QPointF &pos, bool onlySelectable, QVariant *details=0) const Q_DECL_OVERRIDE
void setSelectedFont(const QFont &font)
QFont selectedFont() const
Definition: qcustomplot.h:5342
Q_SLOT void setSelected(bool selected)
bool selected() const
Definition: qcustomplot.h:5345
bool selectable() const
Definition: qcustomplot.h:5344
QCPAbstractLegendItem(QCPLegend *parent)
Definition: qcustomplot.h:672
virtual void draw(QCPPainter *painter) const =0
double mDevicePixelRatio
Definition: qcustomplot.h:696
bool mInvalidated
Definition: qcustomplot.h:699
QCPAbstractPaintBuffer(const QSize &size, double devicePixelRatio)
QSize size() const
Definition: qcustomplot.h:678
virtual QCPPainter * startPainting()=0
void setDevicePixelRatio(double ratio)
bool invalidated() const
Definition: qcustomplot.h:679
virtual void clear(const QColor &color)=0
void setSize(const QSize &size)
virtual void donePainting()
Definition: qcustomplot.h:689
virtual void reallocateBuffer()=0
double devicePixelRatio() const
Definition: qcustomplot.h:680
virtual ~QCPAbstractPaintBuffer()
QSize mSize
Definition: qcustomplot.h:695
void setInvalidated(bool invalidated=true)
A template base class for plottables with one-dimensional data.
Definition: qcustomplot.h:4384
virtual QCPDataSelection selectTestRect(const QRectF &rect, bool onlySelectable) const Q_DECL_OVERRIDE
Definition: qcustomplot.h:4741
QCPAbstractPlottable1D(QCPAxis *keyAxis, QCPAxis *valueAxis)
Definition: qcustomplot.h:4641
virtual double selectTest(const QPointF &pos, bool onlySelectable, QVariant *details=0) const Q_DECL_OVERRIDE
Definition: qcustomplot.h:4828
virtual QCPRange dataValueRange(int index) const Q_DECL_OVERRIDE
Definition: qcustomplot.h:4700
virtual double dataMainValue(int index) const Q_DECL_OVERRIDE
Definition: qcustomplot.h:4687
virtual QPointF dataPixelPosition(int index) const Q_DECL_OVERRIDE
Definition: qcustomplot.h:4713
virtual int findEnd(double sortKey, bool expandedRange=true) const Q_DECL_OVERRIDE
Definition: qcustomplot.h:4810
void drawPolyline(QCPPainter *painter, const QVector< QPointF > &lineData) const
Definition: qcustomplot.h:4934
virtual double dataSortKey(int index) const Q_DECL_OVERRIDE
Definition: qcustomplot.h:4674
virtual int dataCount() const Q_DECL_OVERRIDE
Definition: qcustomplot.h:4653
QSharedPointer< QCPDataContainer< DataType > > mDataContainer
Definition: qcustomplot.h:4415
virtual int findBegin(double sortKey, bool expandedRange=true) const Q_DECL_OVERRIDE
Definition: qcustomplot.h:4800
void getDataSegments(QList< QCPDataRange > &selectedSegments, QList< QCPDataRange > &unselectedSegments) const
Definition: qcustomplot.h:4902
virtual double dataMainKey(int index) const Q_DECL_OVERRIDE
Definition: qcustomplot.h:4661
virtual ~QCPAbstractPlottable1D()
Definition: qcustomplot.h:4647
virtual bool sortKeyIsMainKey() const Q_DECL_OVERRIDE
Definition: qcustomplot.h:4728
Definition: qcustomplot.h:1595
QCP::SelectionType selectable() const
Definition: qcustomplot.h:3728
bool antialiasedFill() const
Definition: qcustomplot.h:3722
QCPDataSelection selection() const
Definition: qcustomplot.h:3730
Q_SLOT void setSelectable(QCP::SelectionType selectable)
void setAntialiasedFill(bool enabled)
bool selected() const
Definition: qcustomplot.h:3729
QCPSelectionDecorator * mSelectionDecorator
Definition: qcustomplot.h:3789
QCPSelectionDecorator * selectionDecorator() const
Definition: qcustomplot.h:3731
void rescaleAxes(bool onlyEnlarge=false) const
virtual ~QCPAbstractPlottable()
QCPDataSelection mSelection
Definition: qcustomplot.h:3788
void setSelectionDecorator(QCPSelectionDecorator *decorator)
void pixelsToCoords(const QPointF &pixelPos, double &key, double &value) const
QCPAxis * keyAxis() const
Definition: qcustomplot.h:3726
void setAntialiasedScatters(bool enabled)
void pixelsToCoords(double x, double y, double &key, double &value) const
QCP::SelectionType mSelectable
Definition: qcustomplot.h:3787
void selectionChanged(bool selected)
bool removeFromLegend(QCPLegend *legend) const
QString name() const
Definition: qcustomplot.h:3721
virtual QCPRange getKeyRange(bool &foundRange, QCP::SignDomain inSignDomain=QCP::sdBoth) const =0
const QPointF coordsToPixels(double key, double value) const
SignDomain
Definition: qcustomplot.h:1667
void selectableChanged(QCP::SelectionType selectable)
void rescaleValueAxis(bool onlyEnlarge=false, bool inKeyRange=false) const
void setValueAxis(QCPAxis *axis)
void selectionChanged(const QCPDataSelection &selection)
bool antialiasedScatters() const
Definition: qcustomplot.h:3723
void setBrush(const QBrush &brush)
void coordsToPixels(double key, double value, double &x, double &y) const
void setKeyAxis(QCPAxis *axis)
QBrush brush() const
Definition: qcustomplot.h:3725
Q_SLOT void setSelection(QCPDataSelection selection)
bool addToLegend(QCPLegend *legend)
virtual QCPRange getValueRange(bool &foundRange, QCP::SignDomain inSignDomain=QCP::sdBoth, const QCPRange &inKeyRange=QCPRange()) const =0
void setPen(const QPen &pen)
void setName(const QString &name)
virtual QRect clipRect() const Q_DECL_OVERRIDE
bool removeFromLegend() const
QPen pen() const
Definition: qcustomplot.h:3724
virtual double selectTest(const QPointF &pos, bool onlySelectable, QVariant *details=0) const Q_DECL_OVERRIDE=0
void rescaleKeyAxis(bool onlyEnlarge=false) const
QCPAxis * valueAxis() const
Definition: qcustomplot.h:3727
QCPAbstractPlottable(QCPAxis *keyAxis, QCPAxis *valueAxis)
Definition: qcustomplot.h:1523
QCPAxisPainterPrivate(QCustomPlot *parentPlot)
virtual void drawTickLabel(QCPPainter *painter, double x, double y, const TickLabelData &labelData) const
virtual ~QCPAxisPainterPrivate()
virtual void getMaxTickLabelSize(const QFont &font, const QString &text, QSize *tickLabelsSize) const
virtual void draw(QCPPainter *painter)
virtual QByteArray generateLabelParameterHash() const
virtual void placeTickLabel(QCPPainter *painter, double position, int distanceToAxis, const QString &text, QSize *tickLabelsSize)
QRect axisSelectionBox() const
Definition: qcustomplot.h:2532
QRect tickLabelsSelectionBox() const
Definition: qcustomplot.h:2533
virtual int size() const
virtual TickLabelData getTickLabelData(const QFont &font, const QString &text) const
QRect labelSelectionBox() const
Definition: qcustomplot.h:2534
virtual QPointF getTickLabelDrawOffset(const TickLabelData &labelData) const
Definition: qcustomplot.h:2297
virtual ~QCPAxisRect()
bool removeAxis(QCPAxis *axis)
bool backgroundScaled() const
Definition: qcustomplot.h:5206
Qt::AspectRatioMode backgroundScaledMode() const
Definition: qcustomplot.h:5207
QCPAxis * rangeDragAxis(Qt::Orientation orientation)
virtual void wheelEvent(QWheelEvent *event)
QList< QCPAbstractItem * > items() const
virtual int calculateAutoMargin(QCP::MarginSide side)
int width() const
Definition: qcustomplot.h:5258
virtual void layoutChanged() Q_DECL_OVERRIDE
void setBackground(const QBrush &brush)
QList< QCPRange > mDragStartHorzRange
Definition: qcustomplot.h:5286
QCPAxis * rangeZoomAxis(Qt::Orientation orientation)
QPoint bottomRight() const
Definition: qcustomplot.h:5264
virtual void applyDefaultAntialiasingHint(QCPPainter *painter) const Q_DECL_OVERRIDE
QList< QCPAxis * > axes(QCPAxis::AxisTypes types) const
int right() const
Definition: qcustomplot.h:5255
int top() const
Definition: qcustomplot.h:5256
QList< QCPAxis * > rangeZoomAxes(Qt::Orientation orientation)
QPixmap background() const
Definition: qcustomplot.h:5204
QPoint topLeft() const
Definition: qcustomplot.h:5261
void setBackgroundScaledMode(Qt::AspectRatioMode mode)
void setupFullAxesBox(bool connectRanges=false)
void zoom(const QRectF &pixelRect)
QCPAxisRect(QCustomPlot *parentPlot, bool setupDefaultAxes=true)
void setRangeDragAxes(QCPAxis *horizontal, QCPAxis *vertical)
virtual QList< QCPLayoutElement * > elements(bool recursive) const Q_DECL_OVERRIDE
void setRangeZoom(Qt::Orientations orientations)
QSize size() const
Definition: qcustomplot.h:5260
QPoint topRight() const
Definition: qcustomplot.h:5262
QBrush backgroundBrush() const
Definition: qcustomplot.h:5205
void setRangeDragAxes(QList< QCPAxis * > horizontal, QList< QCPAxis * > vertical)
int axisCount(QCPAxis::AxisType type) const
void setRangeZoomFactor(double horizontalFactor, double verticalFactor)
void setRangeZoomAxes(QList< QCPAxis * > axes)
virtual void update(UpdatePhase phase) Q_DECL_OVERRIDE
void setRangeZoomAxes(QCPAxis *horizontal, QCPAxis *vertical)
virtual int calculateAutoMargin(QCP::MarginSide side) Q_DECL_OVERRIDE
QCPAxis * axis(QCPAxis::AxisType type, int index=0) const
virtual void mousePressEvent(QMouseEvent *event)
QList< QCPGraph * > graphs() const
Qt::Orientations rangeZoom() const
Definition: qcustomplot.h:5211
QList< QCPAxis * > rangeDragAxes(Qt::Orientation orientation)
QList< QPointer< QCPAxis > > mRangeZoomHorzAxis
Definition: qcustomplot.h:5282
Qt::Orientations rangeDrag() const
Definition: qcustomplot.h:5210
virtual void update(UpdatePhase phase)
QPoint bottomLeft() const
Definition: qcustomplot.h:5263
virtual void draw(QCPPainter *painter) Q_DECL_OVERRIDE
QCPAxis * addAxis(QCPAxis::AxisType type, QCPAxis *axis=0)
QList< QPointer< QCPAxis > > mRangeDragHorzAxis
Definition: qcustomplot.h:5281
void setBackground(const QPixmap &pm, bool scaled, Qt::AspectRatioMode mode=Qt::KeepAspectRatioByExpanding)
QList< QCPAxis * > axes() const
int height() const
Definition: qcustomplot.h:5259
int bottom() const
Definition: qcustomplot.h:5257
QList< QCPAxis * > addAxes(QCPAxis::AxisTypes types)
QPoint center() const
Definition: qcustomplot.h:5265
void setRangeZoomAxes(QList< QCPAxis * > horizontal, QList< QCPAxis * > vertical)
void zoom(const QRectF &pixelRect, const QList< QCPAxis * > &affectedAxes)
double rangeZoomFactor(Qt::Orientation orientation)
virtual void mouseReleaseEvent(QMouseEvent *event)
void setRangeDrag(Qt::Orientations orientations)
void setBackgroundScaled(bool scaled)
QList< QCPAbstractPlottable * > plottables() const
void setRangeZoomFactor(double factor)
virtual void mouseMoveEvent(QMouseEvent *event)
void setRangeDragAxes(QList< QCPAxis * > axes)
QCPLayoutInset * insetLayout() const
Definition: qcustomplot.h:5244
void setBackground(const QPixmap &pm)
int left() const
Definition: qcustomplot.h:5254
Definition: qcustomplot.h:1836
virtual int getSubTickCount(double tickStep) Q_DECL_OVERRIDE
static double dateTimeToKey(const QDate date)
void setTickOrigin(const QDateTime &origin)
virtual QVector< double > createTickVector(double tickStep, const QCPRange &range) Q_DECL_OVERRIDE
static double dateTimeToKey(const QDateTime dateTime)
void setTickOrigin(double origin)
Qt::TimeSpec mDateTimeSpec
Definition: qcustomplot.h:1860
static QDateTime keyToDateTime(double key)
virtual QString getTickLabel(double tick, const QLocale &locale, QChar formatChar, int precision) Q_DECL_OVERRIDE
QString dateTimeFormat() const
Definition: qcustomplot.h:1841
virtual double getTickStep(const QCPRange &range) Q_DECL_OVERRIDE
void setDateTimeFormat(const QString &format)
QString mDateTimeFormat
Definition: qcustomplot.h:1859
Qt::TimeSpec dateTimeSpec() const
Definition: qcustomplot.h:1842
DateStrategy
Definition: qcustomplot.h:1863
@ dsNone
Definition: qcustomplot.h:1864
@ dsUniformTimeInDay
Definition: qcustomplot.h:1865
void setDateTimeSpec(Qt::TimeSpec spec)
Definition: qcustomplot.h:1940
ScaleStrategy
Definition: qcustomplot.h:1949
ScaleStrategy scaleStrategy() const
Definition: qcustomplot.h:1966
double mTickStep
Definition: qcustomplot.h:1974
void setTickStep(double step)
ScaleStrategy mScaleStrategy
Definition: qcustomplot.h:1975
void setScaleStrategy(ScaleStrategy strategy)
virtual double getTickStep(const QCPRange &range) Q_DECL_OVERRIDE
Definition: qcustomplot.h:2091
int mSubTickCount
Definition: qcustomplot.h:2106
double mLogBase
Definition: qcustomplot.h:2105
virtual QVector< double > createTickVector(double tickStep, const QCPRange &range) Q_DECL_OVERRIDE
double logBase() const
Definition: qcustomplot.h:2096
void setLogBase(double base)
virtual int getSubTickCount(double tickStep) Q_DECL_OVERRIDE
void setSubTickCount(int subTicks)
double mLogBaseLnInv
Definition: qcustomplot.h:2109
int subTickCount() const
Definition: qcustomplot.h:2097
virtual double getTickStep(const QCPRange &range) Q_DECL_OVERRIDE
Definition: qcustomplot.h:2027
QString mPiSymbol
Definition: qcustomplot.h:2063
void simplifyFraction(int &numerator, int &denominator) const
virtual double getTickStep(const QCPRange &range) Q_DECL_OVERRIDE
FractionStyle
Definition: qcustomplot.h:2035
QString unicodeSuperscript(int number) const
FractionStyle mFractionStyle
Definition: qcustomplot.h:2066
void setPiValue(double pi)
void setPeriodicity(int multiplesOfPi)
QString unicodeSubscript(int number) const
void setFractionStyle(FractionStyle style)
virtual QString getTickLabel(double tick, const QLocale &locale, QChar formatChar, int precision) Q_DECL_OVERRIDE
virtual int getSubTickCount(double tickStep) Q_DECL_OVERRIDE
double mPiTickStep
Definition: qcustomplot.h:2069
bool periodicity() const
Definition: qcustomplot.h:2052
double mPiValue
Definition: qcustomplot.h:2064
FractionStyle fractionStyle() const
Definition: qcustomplot.h:2053
double piValue() const
Definition: qcustomplot.h:2051
void setPiSymbol(QString symbol)
QString unicodeFraction(int numerator, int denominator) const
int mPeriodicity
Definition: qcustomplot.h:2065
QString fractionToString(int numerator, int denominator) const
Definition: qcustomplot.h:1987
int mSubTickCount
Definition: qcustomplot.h:2011
QMap< double, QString > mTicks
Definition: qcustomplot.h:2010
void addTick(double position, const QString &label)
int subTickCount() const
Definition: qcustomplot.h:1993
void setTicks(const QVector< double > &positions, const QVector< QString > &labels)
void addTicks(const QVector< double > &positions, const QVector< QString > &labels)
void setTicks(const QMap< double, QString > &ticks)
void setSubTickCount(int subTicks)
virtual double getTickStep(const QCPRange &range) Q_DECL_OVERRIDE
QMap< double, QString > & ticks()
Definition: qcustomplot.h:1992
void addTicks(const QMap< double, QString > &ticks)
virtual int getSubTickCount(double tickStep) Q_DECL_OVERRIDE
virtual QString getTickLabel(double tick, const QLocale &locale, QChar formatChar, int precision) Q_DECL_OVERRIDE
virtual QVector< double > createTickVector(double tickStep, const QCPRange &range) Q_DECL_OVERRIDE
Definition: qcustomplot.h:1883
void replaceUnit(QString &text, TimeUnit unit, int value) const
virtual int getSubTickCount(double tickStep) Q_DECL_OVERRIDE
void setTimeFormat(const QString &format)
TimeUnit mBiggestUnit
Definition: qcustomplot.h:1921
virtual double getTickStep(const QCPRange &range) Q_DECL_OVERRIDE
QHash< TimeUnit, int > mFieldWidth
Definition: qcustomplot.h:1918
TimeUnit
Definition: qcustomplot.h:1891
virtual QString getTickLabel(double tick, const QLocale &locale, QChar formatChar, int precision) Q_DECL_OVERRIDE
int fieldWidth(TimeUnit unit) const
Definition: qcustomplot.h:1909
QString mTimeFormat
Definition: qcustomplot.h:1917
void setFieldWidth(TimeUnit unit, int width)
QHash< TimeUnit, QString > mFormatPattern
Definition: qcustomplot.h:1922
Definition: qcustomplot.h:1760
virtual QVector< double > createSubTickVector(int subTickCount, const QVector< double > &ticks)
int mTickCount
Definition: qcustomplot.h:1802
double getMantissa(double input, double *magnitude=0) const
void setTickCount(int count)
double pickClosest(double target, const QVector< double > &candidates) const
virtual double getTickStep(const QCPRange &range)
double mTickOrigin
Definition: qcustomplot.h:1803
void setTickStepStrategy(TickStepStrategy strategy)
virtual QVector< double > createTickVector(double tickStep, const QCPRange &range)
virtual int getSubTickCount(double tickStep)
int tickCount() const
Definition: qcustomplot.h:1785
virtual QVector< QString > createLabelVector(const QVector< double > &ticks, const QLocale &locale, QChar formatChar, int precision)
void trimTicks(const QCPRange &range, QVector< double > &ticks, bool keepOneOutlier) const
void setTickOrigin(double origin)
TickStepStrategy
Definition: qcustomplot.h:1769
TickStepStrategy mTickStepStrategy
Definition: qcustomplot.h:1801
double tickOrigin() const
Definition: qcustomplot.h:1786
double cleanMantissa(double input) const
virtual QString getTickLabel(double tick, const QLocale &locale, QChar formatChar, int precision)
virtual void generate(const QCPRange &range, const QLocale &locale, QChar formatChar, int precision, QVector< double > &ticks, QVector< double > *subTicks, QVector< QString > *tickLabels)
Definition: qcustomplot.h:1137
void setSelectedLabelFont(const QFont &font)
void setOffset(int offset)
void setTickLabels(bool show)
QColor labelColor() const
Definition: qcustomplot.h:2327
int padding() const
Definition: qcustomplot.h:2330
void rangeChanged(const QCPRange &newRange)
void setLowerEnding(const QCPLineEnding &ending)
SelectablePart getPartAt(const QPointF &pos) const
QFont selectedTickLabelFont() const
Definition: qcustomplot.h:2334
QFont tickLabelFont() const
Definition: qcustomplot.h:2310
QCPLineEnding lowerEnding() const
QPen selectedBasePen() const
Definition: qcustomplot.h:2338
QFont selectedLabelFont() const
Definition: qcustomplot.h:2335
void setTickLabelSide(LabelSide side)
void moveRange(double diff)
Q_SLOT void setRange(const QCPRange &range)
QVector< QString > tickVectorLabels() const
Definition: qcustomplot.h:2317
void setTickLabelRotation(double degrees)
SelectableParts selectableParts() const
Definition: qcustomplot.h:2333
QString numberFormat() const
QPen basePen() const
Definition: qcustomplot.h:2323
void setRangeReversed(bool reversed)
void setNumberPrecision(int precision)
LabelSide
Definition: qcustomplot.h:1248
int numberPrecision() const
Definition: qcustomplot.h:2315
void setSelectedSubTickPen(const QPen &pen)
void setTickLabelFont(const QFont &font)
QSharedPointer< QCPAxisTicker > ticker() const
Definition: qcustomplot.h:2306
QList< QCPAbstractItem * > items() const
void scaleRange(double factor)
QString label() const
Definition: qcustomplot.h:2328
void setLabel(const QString &str)
void scaleTypeChanged(QCPAxis::ScaleType scaleType)
ScaleType
Definition: qcustomplot.h:1259
void setTickLabelColor(const QColor &color)
void setTickLengthOut(int outside)
void setLabelPadding(int padding)
int pixelOrientation() const
Definition: qcustomplot.h:2398
void rescale(bool onlyVisiblePlottables=false)
QCPRange mDragStartRange
Definition: qcustomplot.h:2474
void setSubTickLengthOut(int outside)
void setTicker(QSharedPointer< QCPAxisTicker > ticker)
double pixelToCoord(double value) const
virtual QCP::Interaction selectionCategory() const Q_DECL_OVERRIDE
void setPadding(int padding)
void setRange(double lower, double upper)
QVector< double > tickVector() const
Definition: qcustomplot.h:2316
bool ticks() const
Definition: qcustomplot.h:2307
double tickLabelRotation() const
void setSelectedLabelColor(const QColor &color)
void selectionChanged(const QCPAxis::SelectableParts &parts)
void setTickLength(int inside, int outside=0)
virtual void draw(QCPPainter *painter) Q_DECL_OVERRIDE
void setUpperEnding(const QCPLineEnding &ending)
virtual int calculateMargin()
void setLabelColor(const QColor &color)
int labelPadding() const
void scaleRange(double factor, double center)
void setLabelFont(const QFont &font)
QPen selectedSubTickPen() const
Definition: qcustomplot.h:2340
QColor selectedTickLabelColor() const
Definition: qcustomplot.h:2336
QPen selectedTickPen() const
Definition: qcustomplot.h:2339
void setBasePen(const QPen &pen)
QPen subTickPen() const
Definition: qcustomplot.h:2325
QColor selectedLabelColor() const
Definition: qcustomplot.h:2337
QCPGrid * grid() const
Definition: qcustomplot.h:2343
Q_SLOT void setSelectedParts(const QCPAxis::SelectableParts &selectedParts)
void setSelectedTickPen(const QPen &pen)
void setSelectedTickLabelFont(const QFont &font)
SelectableParts selectedParts() const
Definition: qcustomplot.h:2332
static Qt::Orientation orientation(AxisType type)
Definition: qcustomplot.h:2414
void setSelectedTickLabelColor(const QColor &color)
QCP::AntialiasedElements mAADragBackup
Definition: qcustomplot.h:2475
virtual void applyDefaultAntialiasingHint(QCPPainter *painter) const Q_DECL_OVERRIDE
QColor tickLabelColor() const
Definition: qcustomplot.h:2311
QCPLineEnding upperEnding() const
static AxisType opposite(AxisType type)
void selectableChanged(const QCPAxis::SelectableParts &parts)
QFont labelFont() const
Definition: qcustomplot.h:2326
void rangeChanged(const QCPRange &newRange, const QCPRange &oldRange)
static AxisType marginSideToAxisType(QCP::MarginSide side)
Q_SLOT void setSelectableParts(const QCPAxis::SelectableParts &selectableParts)
void setSubTickLength(int inside, int outside=0)
bool rangeReversed() const
Definition: qcustomplot.h:2305
SelectablePart
Definition: qcustomplot.h:1271
const QCPRange range() const
Definition: qcustomplot.h:2304
void setSubTickLengthIn(int inside)
QList< QCPAbstractPlottable * > plottables() const
Q_SLOT void setScaleType(QCPAxis::ScaleType type)
void setTicks(bool show)
int subTickLengthOut() const
LabelSide tickLabelSide() const
void setRangeUpper(double upper)
int tickLengthIn() const
void setRange(double position, double size, Qt::AlignmentFlag alignment)
ScaleType scaleType() const
Definition: qcustomplot.h:2303
int tickLengthOut() const
bool mDragging
Definition: qcustomplot.h:2473
virtual double selectTest(const QPointF &pos, bool onlySelectable, QVariant *details=0) const Q_DECL_OVERRIDE
bool subTicks() const
Definition: qcustomplot.h:2320
void setTickPen(const QPen &pen)
QSharedPointer< QCPAxisTicker > mTicker
Definition: qcustomplot.h:2467
AxisType
Definition: qcustomplot.h:1211
bool tickLabels() const
Definition: qcustomplot.h:2308
void setNumberFormat(const QString &formatCode)
void setSelectedBasePen(const QPen &pen)
void setSubTickPen(const QPen &pen)
int offset() const
double coordToPixel(double value) const
bool mSubTicks
Definition: qcustomplot.h:2454
void setTickLabelPadding(int padding)
void setScaleRatio(const QCPAxis *otherAxis, double ratio=1.0)
int subTickLengthIn() const
void setSubTicks(bool show)
int tickLabelPadding() const
void setTickLengthIn(int inside)
QCPAxisRect * axisRect() const
Definition: qcustomplot.h:2302
void setRangeLower(double lower)
QList< QCPGraph * > graphs() const
QPen tickPen() const
Definition: qcustomplot.h:2324
Definition: qcustomplot.h:6162
double key
Definition: qcustomplot.h:6181
double sortKey() const
Definition: qcustomplot.h:6167
static bool sortKeyIsMainKey()
Definition: qcustomplot.h:6171
double mainValue() const
Definition: qcustomplot.h:6174
QCPBarsData(double key, double value)
double mainKey() const
Definition: qcustomplot.h:6173
QCPRange valueRange() const
Definition: qcustomplot.h:6176
static QCPBarsData fromSortKey(double sortKey)
Definition: qcustomplot.h:6168
Definition: qcustomplot.h:3157
double getPixelSpacing(const QCPBars *bars, double keyCoord)
void remove(QCPBars *bars)
void setSpacingType(SpacingType spacingType)
void insert(int i, QCPBars *bars)
double spacing() const
Definition: qcustomplot.h:6123
int size() const
Definition: qcustomplot.h:6132
SpacingType
Definition: qcustomplot.h:3170
void registerBars(QCPBars *bars)
void append(QCPBars *bars)
double keyPixelOffset(const QCPBars *bars, double keyCoord)
QCPBars * bars(int index) const
QList< QCPBars * > bars() const
Definition: qcustomplot.h:6130
void setSpacing(double spacing)
bool isEmpty() const
Definition: qcustomplot.h:6133
void unregisterBars(QCPBars *bars)
bool contains(QCPBars *bars) const
Definition: qcustomplot.h:6135
Definition: qcustomplot.h:3241
QCPBars * barAbove() const
Definition: qcustomplot.h:6236
QCPBarDataMap * data() const
Definition: qcustomplot.h:3278
double baseValue() const
Definition: qcustomplot.h:6233
void setData(const QVector< double > &keys, const QVector< double > &values, bool alreadySorted=false)
double stackingGap() const
Definition: qcustomplot.h:6234
void addData(const QVector< double > &keys, const QVector< double > &values, bool alreadySorted=false)
virtual QCPDataSelection selectTestRect(const QRectF &rect, bool onlySelectable) const Q_DECL_OVERRIDE
WidthType widthType() const
Definition: qcustomplot.h:6231
void setBaseValue(double baseValue)
QCPBarsGroup * barsGroup() const
Definition: qcustomplot.h:6232
WidthType
Definition: qcustomplot.h:3258
void addData(double key, double value)
void moveBelow(QCPBars *bars)
void setData(QSharedPointer< QCPBarsDataContainer > data)
QCPBars * barBelow() const
Definition: qcustomplot.h:6235
virtual double selectTest(const QPointF &pos, bool onlySelectable, QVariant *details=0) const Q_DECL_OVERRIDE
void moveAbove(QCPBars *bars)
QSharedPointer< QCPBarsDataContainer > data() const
Definition: qcustomplot.h:6237
void setWidthType(WidthType widthType)
void setStackingGap(double pixels)
void setBarsGroup(QCPBarsGroup *barsGroup)
void setWidth(double width)
Definition: qcustomplot.h:2192
QRgb color(double position, const QCPRange &range, bool logarithmic=false)
bool stopsUseAlpha() const
void setLevelCount(int n)
bool periodic() const
Definition: qcustomplot.h:5067
void updateColorBuffer()
void setPeriodic(bool enabled)
void setColorStopAt(double position, const QColor &color)
void setColorStops(const QMap< double, QColor > &colorStops)
void clearColorStops()
QCPColorGradient inverted() const
void loadPreset(GradientPreset preset)
void setColorInterpolation(ColorInterpolation interpolation)
QMap< double, QColor > colorStops() const
Definition: qcustomplot.h:5065
void colorize(const double *data, const QCPRange &range, QRgb *scanLine, int n, int dataIndexFactor=1, bool logarithmic=false)
ColorInterpolation colorInterpolation() const
Definition: qcustomplot.h:5066
int levelCount() const
Definition: qcustomplot.h:5064
ColorInterpolation
Definition: qcustomplot.h:2201
void colorize(const double *data, const unsigned char *alpha, const QCPRange &range, QRgb *scanLine, int n, int dataIndexFactor=1, bool logarithmic=false)
GradientPreset
Definition: qcustomplot.h:2214
Definition: qcustomplot.h:3423
void setKeyRange(const QCPRange &keyRange)
void setValueSize(int valueSize)
void setSize(int keySize, int valueSize)
QCPColorMapData & operator=(const QCPColorMapData &other)
QCPRange keyRange() const
Definition: qcustomplot.h:6460
unsigned char * mAlpha
Definition: qcustomplot.h:6498
double data(double key, double value)
void fill(double z)
bool createAlpha(bool initializeOpaque=true)
unsigned char alpha(int keyIndex, int valueIndex)
QCPColorMapData(const QCPColorMapData &other)
QCPRange valueRange() const
Definition: qcustomplot.h:6461
int valueSize() const
Definition: qcustomplot.h:6459
void setCell(int keyIndex, int valueIndex, double z)
void fillAlpha(unsigned char alpha)
QCPColorMapData(int keySize, int valueSize, const QCPRange &keyRange, const QCPRange &valueRange)
void setRange(const QCPRange &keyRange, const QCPRange &valueRange)
void setAlpha(int keyIndex, int valueIndex, unsigned char alpha)
void recalculateDataBounds()
QCPRange dataBounds() const
Definition: qcustomplot.h:6462
int keySize() const
Definition: qcustomplot.h:6458
void setKeySize(int keySize)
void coordToCell(double key, double value, int *keyIndex, int *valueIndex) const
void setValueRange(const QCPRange &valueRange)
bool isEmpty() const
Definition: qcustomplot.h:6484
void cellToCoord(int keyIndex, int valueIndex, double *key, double *value) const
double cell(int keyIndex, int valueIndex)
void setData(double key, double value, double z)
Definition: qcustomplot.h:3473
bool interpolate() const
Definition: qcustomplot.h:6528
Q_SLOT void setDataScaleType(QCPAxis::ScaleType scaleType)
void setInterpolate(bool enabled)
bool tightBoundary() const
Definition: qcustomplot.h:6529
Q_SLOT void updateLegendIcon(Qt::TransformationMode transformMode=Qt::SmoothTransformation, const QSize &thumbSize=QSize(32, 18))
void setData(QCPColorMapData *data, bool copy=false)
void rescaleDataRange(bool recalculateDataBounds=false)
QCPColorScale * colorScale() const
Definition: qcustomplot.h:6531
QCPColorMap(QCPAxis *keyAxis, QCPAxis *valueAxis)
void setColorScale(QCPColorScale *colorScale)
QCPAxis::ScaleType dataScaleType() const
Definition: qcustomplot.h:6527
QCPColorMapData * data() const
Definition: qcustomplot.h:6525
QCPColorGradient gradient() const
Definition: qcustomplot.h:6530
Q_SLOT void setGradient(const QCPColorGradient &gradient)
void setTightBoundary(bool enabled)
virtual double selectTest(const QPointF &pos, bool onlySelectable, QVariant *details=0) const Q_DECL_OVERRIDE
Q_SLOT void setDataRange(const QCPRange &dataRange)
QCPRange dataRange() const
Definition: qcustomplot.h:6526
virtual ~QCPColorMap()
Definition: qcustomplot.h:2708
Q_SLOT void axisSelectionChanged(QCPAxis::SelectableParts selectedParts)
Q_SLOT void axisSelectableChanged(QCPAxis::SelectableParts selectableParts)
virtual void draw(QCPPainter *painter) Q_DECL_OVERRIDE
QCPColorScaleAxisRectPrivate(QCPColorScale *parentColorScale)
Definition: qcustomplot.h:2732
void setType(QCPAxis::AxisType type)
void setRangeDrag(bool enabled)
bool rangeDrag() const
virtual ~QCPColorScale()
QCPColorGradient gradient() const
Definition: qcustomplot.h:5698
QString label() const
void rescaleDataRange(bool onlyVisibleMaps)
Q_SLOT void setGradient(const QCPColorGradient &gradient)
QCPRange dataRange() const
Definition: qcustomplot.h:5696
virtual void mouseMoveEvent(QMouseEvent *event, const QPointF &startPos) Q_DECL_OVERRIDE
virtual void update(UpdatePhase phase) Q_DECL_OVERRIDE
virtual void wheelEvent(QWheelEvent *event) Q_DECL_OVERRIDE
void gradientChanged(const QCPColorGradient &newGradient)
void dataScaleTypeChanged(QCPAxis::ScaleType scaleType)
void dataRangeChanged(const QCPRange &newRange)
QCPAxis::AxisType type() const
Definition: qcustomplot.h:5695
Q_SLOT void setDataScaleType(QCPAxis::ScaleType scaleType)
void setRangeZoom(bool enabled)
QList< QCPColorMap * > colorMaps() const
QCPColorScale(QCustomPlot *parentPlot)
virtual void mousePressEvent(QMouseEvent *event, const QVariant &details) Q_DECL_OVERRIDE
void setBarWidth(int width)
Q_SLOT void setDataRange(const QCPRange &dataRange)
QCPAxis::ScaleType dataScaleType() const
Definition: qcustomplot.h:5697
bool rangeZoom() const
int barWidth() const
Definition: qcustomplot.h:5700
virtual void mouseReleaseEvent(QMouseEvent *event, const QPointF &startPos) Q_DECL_OVERRIDE
virtual void applyDefaultAntialiasingHint(QCPPainter *painter) const Q_DECL_OVERRIDE
QCPAxis * axis() const
Definition: qcustomplot.h:5694
void setLabel(const QString &str)
Definition: qcustomplot.h:3037
static bool sortKeyIsMainKey()
Definition: qcustomplot.h:5957
QCPCurveData(double t, double key, double value)
double mainValue() const
Definition: qcustomplot.h:5960
static QCPCurveData fromSortKey(double sortKey)
Definition: qcustomplot.h:5954
double sortKey() const
Definition: qcustomplot.h:5953
double mainKey() const
Definition: qcustomplot.h:5959
QCPRange valueRange() const
Definition: qcustomplot.h:5962
Definition: qcustomplot.h:3058
LineStyle lineStyle() const
Definition: qcustomplot.h:6009
void setData(const QVector< double > &t, const QVector< double > &keys, const QVector< double > &values, bool alreadySorted=false)
int scatterSkip() const
Definition: qcustomplot.h:6008
virtual double selectTest(const QPointF &pos, bool onlySelectable, QVariant *details=0) const Q_DECL_OVERRIDE
void addData(double t, double key, double value)
LineStyle
Definition: qcustomplot.h:3070
void setData(QSharedPointer< QCPCurveDataContainer > data)
void setLineStyle(LineStyle style)
void setScatterStyle(const QCPScatterStyle &style)
void addData(const QVector< double > &keys, const QVector< double > &values)
void addData(const QVector< double > &t, const QVector< double > &keys, const QVector< double > &values, bool alreadySorted=false)
void setScatterSkip(int skip)
void setData(const QVector< double > &keys, const QVector< double > &values)
void addData(double key, double value)
QCPScatterStyle scatterStyle() const
Definition: qcustomplot.h:6007
The generic data container for one-dimensional plottables.
Definition: qcustomplot.h:2758
QVector< DataType >::iterator iterator
Definition: qcustomplot.h:2761
QVector< DataType >::const_iterator const_iterator
Definition: qcustomplot.h:2760
void setAutoSqueeze(bool enabled)
Definition: qcustomplot.h:2990
const_iterator findBegin(double sortKey, bool expandedRange=true) const
Definition: qcustomplot.h:3291
int mPreallocSize
Definition: qcustomplot.h:2812
QCPRange valueRange(bool &foundRange, QCP::SignDomain signDomain=QCP::sdBoth, const QCPRange &inKeyRange=QCPRange())
Definition: qcustomplot.h:3467
void add(const QCPDataContainer< DataType > &data)
Definition: qcustomplot.h:3035
bool autoSqueeze() const
Definition: qcustomplot.h:2768
QVector< DataType > mData
Definition: qcustomplot.h:2811
bool qcpLessThanSortKey(const DataType &a, const DataType &b)
Definition: qcustomplot.h:2751
void sort()
Definition: qcustomplot.h:3244
bool isEmpty() const
Definition: qcustomplot.h:2767
void clear()
Definition: qcustomplot.h:3225
iterator begin()
Definition: qcustomplot.h:2791
void squeeze(bool preAllocation=true, bool postAllocation=true)
Definition: qcustomplot.h:3260
void performAutoSqueeze()
Definition: qcustomplot.h:3613
int size() const
Definition: qcustomplot.h:2766
void limitIteratorsToDataRange(const_iterator &begin, const_iterator &end, const QCPDataRange &dataRange) const
Definition: qcustomplot.h:3560
void removeBefore(double sortKey)
Definition: qcustomplot.h:3146
const_iterator constEnd() const
Definition: qcustomplot.h:2790
bool mAutoSqueeze
Definition: qcustomplot.h:2808
void preallocateGrow(int minimumPreallocSize)
Definition: qcustomplot.h:3580
int mPreallocIteration
Definition: qcustomplot.h:2813
QCPRange keyRange(bool &foundRange, QCP::SignDomain signDomain=QCP::sdBoth)
Definition: qcustomplot.h:3351
void removeAfter(double sortKey)
Definition: qcustomplot.h:3163
iterator end()
Definition: qcustomplot.h:2792
void remove(double sortKeyFrom, double sortKeyTo)
Definition: qcustomplot.h:3181
void set(const QCPDataContainer< DataType > &data)
Definition: qcustomplot.h:3004
const_iterator at(int index) const
Definition: qcustomplot.h:2795
QCPDataRange dataRange() const
Definition: qcustomplot.h:2802
QCPDataContainer()
Definition: qcustomplot.h:2978
const_iterator findEnd(double sortKey, bool expandedRange=true) const
Definition: qcustomplot.h:3324
const_iterator constBegin() const
Definition: qcustomplot.h:2787
Definition: qcustomplot.h:1058
bool contains(const QCPDataRange &other) const
int length() const
Definition: qcustomplot.h:1072
void setEnd(int end)
Definition: qcustomplot.h:1076
QCPDataRange adjusted(int changeBegin, int changeEnd) const
Definition: qcustomplot.h:1084
QCPDataRange expanded(const QCPDataRange &other) const
QDebug operator<<(QDebug d, const QCPDataRange &dataRange)
Definition: qcustomplot.h:1251
void setBegin(int begin)
Definition: qcustomplot.h:1075
bool operator!=(const QCPDataRange &other) const
Definition: qcustomplot.h:1066
QCPDataRange(int begin, int end)
QCPDataRange intersection(const QCPDataRange &other) const
bool intersects(const QCPDataRange &other) const
bool operator==(const QCPDataRange &other) const
Definition: qcustomplot.h:1063
QCPDataRange bounded(const QCPDataRange &other) const
bool isValid() const
Definition: qcustomplot.h:1079
bool isEmpty() const
Definition: qcustomplot.h:1080
int size() const
Definition: qcustomplot.h:1071
int begin() const
Definition: qcustomplot.h:1069
int end() const
Definition: qcustomplot.h:1070
Definition: qcustomplot.h:1096
QCPDataSelection & operator+=(const QCPDataRange &other)
void enforceType(QCP::SelectionType type)
QCPDataSelection & operator-=(const QCPDataRange &other)
QCPDataSelection & operator+=(const QCPDataSelection &other)
void addDataRange(const QCPDataRange &dataRange, bool simplify=true)
QList< QCPDataRange > dataRanges() const
Definition: qcustomplot.h:1130
bool operator==(const QCPDataSelection &other) const
QCPDataRange dataRange(int index=0) const
QCPDataSelection(const QCPDataRange &range)
bool isEmpty() const
Definition: qcustomplot.h:1136
bool operator!=(const QCPDataSelection &other) const
Definition: qcustomplot.h:1102
QCPDataRange span() const
bool contains(const QCPDataSelection &other) const
int dataRangeCount() const
Definition: qcustomplot.h:1127
int dataPointCount() const
QCPDataSelection inverse(const QCPDataRange &outerRange) const
QDebug operator<<(QDebug d, const QCPDataSelection &selection)
Definition: qcustomplot.h:1261
QCPDataSelection intersection(const QCPDataSelection &other) const
QCPDataSelection intersection(const QCPDataRange &other) const
QCPDataSelection & operator-=(const QCPDataSelection &other)
Definition: qcustomplot.h:6776
QCPErrorBarsData(double error)
QCPErrorBarsData(double errorMinus, double errorPlus)
double errorMinus
Definition: qcustomplot.h:6782
Definition: qcustomplot.h:6805
QPointer< QCPAbstractPlottable > mDataPlottable
Definition: qcustomplot.h:6886
void addData(double errorMinus, double errorPlus)
void addData(const QVector< double > &errorMinus, const QVector< double > &errorPlus)
void setSymbolGap(double pixels)
double symbolGap() const
Definition: qcustomplot.h:6842
void setData(const QVector< double > &error)
double mWhiskerWidth
Definition: qcustomplot.h:6888
void addData(double error)
ErrorType errorType() const
Definition: qcustomplot.h:6840
double mSymbolGap
Definition: qcustomplot.h:6889
QSharedPointer< QCPErrorBarsDataContainer > mDataContainer
Definition: qcustomplot.h:6885
void setData(QSharedPointer< QCPErrorBarsDataContainer > data)
ErrorType
Definition: qcustomplot.h:6824
virtual QCPRange getValueRange(bool &foundRange, QCP::SignDomain inSignDomain=QCP::sdBoth, const QCPRange &inKeyRange=QCPRange()) const Q_DECL_OVERRIDE
virtual void draw(QCPPainter *painter) Q_DECL_OVERRIDE
virtual QCPRange getKeyRange(bool &foundRange, QCP::SignDomain inSignDomain=QCP::sdBoth) const Q_DECL_OVERRIDE
void setDataPlottable(QCPAbstractPlottable *plottable)
void setData(const QVector< double > &errorMinus, const QVector< double > &errorPlus)
void addData(const QVector< double > &error)
virtual int dataCount() const Q_DECL_OVERRIDE
void setWhiskerWidth(double pixels)
QCPAbstractPlottable * dataPlottable() const
Definition: qcustomplot.h:6839
double whiskerWidth() const
Definition: qcustomplot.h:6841
void setErrorType(ErrorType type)
virtual void drawLegendIcon(QCPPainter *painter, const QRectF &rect) const Q_DECL_OVERRIDE
ErrorType mErrorType
Definition: qcustomplot.h:6887
Definition: qcustomplot.h:3555
QCPFinancialData(double key, double open, double high, double low, double close)
QCPRange valueRange() const
Definition: qcustomplot.h:6610
static bool sortKeyIsMainKey()
Definition: qcustomplot.h:6605
static QCPFinancialData fromSortKey(double sortKey)
Definition: qcustomplot.h:6602
double mainValue() const
Definition: qcustomplot.h:6608
double sortKey() const
Definition: qcustomplot.h:6601
double mainKey() const
Definition: qcustomplot.h:6607
Definition: qcustomplot.h:3576
ChartStyle
Definition: qcustomplot.h:3593
double width() const
Definition: qcustomplot.h:6682
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)
void setTwoColored(bool twoColored)
void setWidthType(WidthType widthType)
QPen penNegative() const
Definition: qcustomplot.h:6688
virtual QCPDataSelection selectTestRect(const QRectF &rect, bool onlySelectable) const Q_DECL_OVERRIDE
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)
ChartStyle chartStyle() const
Definition: qcustomplot.h:6681
void setChartStyle(ChartStyle style)
void setBrushPositive(const QBrush &brush)
virtual double selectTest(const QPointF &pos, bool onlySelectable, QVariant *details=0) const Q_DECL_OVERRIDE
void addData(double key, double open, double high, double low, double close)
void setData(QSharedPointer< QCPFinancialDataContainer > data)
WidthType widthType() const
Definition: qcustomplot.h:6683
void setBrushNegative(const QBrush &brush)
void setWidth(double width)
void setPenPositive(const QPen &pen)
QBrush brushNegative() const
Definition: qcustomplot.h:6686
QPen penPositive() const
Definition: qcustomplot.h:6687
QBrush brushPositive() const
Definition: qcustomplot.h:6685
WidthType
Definition: qcustomplot.h:6652
bool twoColored() const
Definition: qcustomplot.h:6684
void setPenNegative(const QPen &pen)
Definition: qcustomplot.h:5761
double mainValue() const
Definition: qcustomplot.h:5773
QCPGraphData(double key, double value)
QCPRange valueRange() const
Definition: qcustomplot.h:5775
double key
Definition: qcustomplot.h:5777
static QCPGraphData fromSortKey(double sortKey)
Definition: qcustomplot.h:5767
double sortKey() const
Definition: qcustomplot.h:5766
static bool sortKeyIsMainKey()
Definition: qcustomplot.h:5770
double mainKey() const
Definition: qcustomplot.h:5772
Definition: qcustomplot.h:2833
void addData(double key, double value)
void setScatterStyle(const QCPScatterStyle &style)
void setScatterSkip(int skip)
bool adaptiveSampling() const
Definition: qcustomplot.h:5842
void setData(QSharedPointer< QCPGraphDataContainer > data)
void setChannelFillGraph(QCPGraph *targetGraph)
QCPScatterStyle scatterStyle() const
Definition: qcustomplot.h:5839
int scatterSkip() const
Definition: qcustomplot.h:5840
void setLineStyle(LineStyle ls)
void setData(const QVector< double > &keys, const QVector< double > &values, bool alreadySorted=false)
QCPDataMap * data() const
Definition: qcustomplot.h:2894
QCPGraph * channelFillGraph() const
Definition: qcustomplot.h:5841
void setAdaptiveSampling(bool enabled)
virtual double selectTest(const QPointF &pos, bool onlySelectable, QVariant *details=0) const Q_DECL_OVERRIDE
LineStyle lineStyle() const
Definition: qcustomplot.h:5838
LineStyle
Definition: qcustomplot.h:2854
void addData(const QVector< double > &keys, const QVector< double > &values, bool alreadySorted=false)
Definition: qcustomplot.h:1087
QPen pen() const
Definition: qcustomplot.h:2142
void setZeroLinePen(const QPen &pen)
void setAntialiasedZeroLine(bool enabled)
void setAntialiasedSubGrid(bool enabled)
bool antialiasedZeroLine() const
Definition: qcustomplot.h:2141
void drawSubGridLines(QCPPainter *painter) const
QPen zeroLinePen() const
Definition: qcustomplot.h:2144
virtual void applyDefaultAntialiasingHint(QCPPainter *painter) const Q_DECL_OVERRIDE
void setSubGridPen(const QPen &pen)
void setPen(const QPen &pen)
QCPGrid(QCPAxis *parentAxis)
virtual void draw(QCPPainter *painter) Q_DECL_OVERRIDE
void setSubGridVisible(bool visible)
QPen subGridPen() const
Definition: qcustomplot.h:2143
void drawGridLines(QCPPainter *painter) const
bool antialiasedSubGrid() const
Definition: qcustomplot.h:2140
bool subGridVisible() const
Definition: qcustomplot.h:2139
Definition: qcustomplot.h:1724
virtual ~QCPItemAnchor()
void removeChildX(QCPItemPosition *pos)
QCPItemAnchor(QCustomPlot *parentPlot, QCPAbstractItem *parentItem, const QString &name, int anchorId=-1)
virtual QCPItemPosition * toQCPItemPosition()
Definition: qcustomplot.h:3845
virtual QPointF pixelPosition() const
void removeChildY(QCPItemPosition *pos)
QString name() const
Definition: qcustomplot.h:3831
void addChildX(QCPItemPosition *pos)
void addChildY(QCPItemPosition *pos)
Definition: qcustomplot.h:4206
void setSelectedPen(const QPen &pen)
BracketStyle style() const
Definition: qcustomplot.h:7520
void setStyle(BracketStyle style)
BracketStyle
Definition: qcustomplot.h:4215
AnchorIndex
Definition: qcustomplot.h:4251
virtual QPointF anchorPixelPosition(int anchorId) const Q_DECL_OVERRIDE
virtual void draw(QCPPainter *painter) Q_DECL_OVERRIDE
void setPen(const QPen &pen)
void setLength(double length)
virtual double selectTest(const QPointF &pos, bool onlySelectable, QVariant *details=0) const Q_DECL_OVERRIDE
QPen mainPen() const
double length() const
Definition: qcustomplot.h:7519
QPen selectedPen() const
Definition: qcustomplot.h:7518
Definition: qcustomplot.h:3772
void setPen(const QPen &pen)
void setHead(const QCPLineEnding &head)
virtual double selectTest(const QPointF &pos, bool onlySelectable, QVariant *details=0) const Q_DECL_OVERRIDE
void setSelectedPen(const QPen &pen)
QPen selectedPen() const
Definition: qcustomplot.h:7035
QCPLineEnding head() const
Definition: qcustomplot.h:7036
QCPLineEnding tail() const
Definition: qcustomplot.h:7037
void setTail(const QCPLineEnding &tail)
QCPItemCurve(QCustomPlot *parentPlot)
QPen pen() const
Definition: qcustomplot.h:7034
virtual ~QCPItemCurve()
Definition: qcustomplot.h:3980
virtual ~QCPItemEllipse()
AnchorIndex
Definition: qcustomplot.h:4021
void setBrush(const QBrush &brush)
QBrush mainBrush() const
virtual QPointF anchorPixelPosition(int anchorId) const Q_DECL_OVERRIDE
void setSelectedPen(const QPen &pen)
QCPItemEllipse(QCustomPlot *parentPlot)
QPen pen() const
Definition: qcustomplot.h:7257
void setSelectedBrush(const QBrush &brush)
QPen selectedPen() const
Definition: qcustomplot.h:7258
QPen mainPen() const
QBrush brush() const
Definition: qcustomplot.h:7259
virtual void draw(QCPPainter *painter) Q_DECL_OVERRIDE
virtual double selectTest(const QPointF &pos, bool onlySelectable, QVariant *details=0) const Q_DECL_OVERRIDE
void setPen(const QPen &pen)
QBrush selectedBrush() const
Definition: qcustomplot.h:7260
Definition: qcustomplot.h:3727
virtual ~QCPItemLine()
QCPItemLine(QCustomPlot *parentPlot)
void setSelectedPen(const QPen &pen)
void setPen(const QPen &pen)
virtual double selectTest(const QPointF &pos, bool onlySelectable, QVariant *details=0) const Q_DECL_OVERRIDE
QCPLineEnding head() const
Definition: qcustomplot.h:6986
QPen pen() const
Definition: qcustomplot.h:6984
QCPLineEnding tail() const
Definition: qcustomplot.h:6987
void setTail(const QCPLineEnding &tail)
QPen selectedPen() const
Definition: qcustomplot.h:6985
void setHead(const QCPLineEnding &head)
Definition: qcustomplot.h:4046
AnchorIndex
Definition: qcustomplot.h:4092
virtual ~QCPItemPixmap()
QPen selectedPen() const
Definition: qcustomplot.h:7337
QRect getFinalRect(bool *flippedHorz=0, bool *flippedVert=0) const
virtual QPointF anchorPixelPosition(int anchorId) const Q_DECL_OVERRIDE
Qt::AspectRatioMode aspectRatioMode() const
Definition: qcustomplot.h:7332
QPen pen() const
Definition: qcustomplot.h:7336
virtual void draw(QCPPainter *painter) Q_DECL_OVERRIDE
void setPixmap(const QPixmap &pixmap)
QPixmap pixmap() const
Definition: qcustomplot.h:7330
bool scaled() const
Definition: qcustomplot.h:7331
void updateScaledPixmap(QRect finalRect=QRect(), bool flipHorz=false, bool flipVert=false)
virtual double selectTest(const QPointF &pos, bool onlySelectable, QVariant *details=0) const Q_DECL_OVERRIDE
QCPItemPixmap(QCustomPlot *parentPlot)
QPen mainPen() const
void setScaled(bool scaled, Qt::AspectRatioMode aspectRatioMode=Qt::KeepAspectRatio, Qt::TransformationMode transformationMode=Qt::SmoothTransformation)
Qt::TransformationMode transformationMode() const
Definition: qcustomplot.h:7333
void setPen(const QPen &pen)
void setSelectedPen(const QPen &pen)
Definition: qcustomplot.h:1763
PositionType typeX() const
Definition: qcustomplot.h:3905
virtual QPointF pixelPosition() const Q_DECL_OVERRIDE
QCPAxis * valueAxis() const
Definition: qcustomplot.h:3914
QCPItemAnchor * parentAnchorX() const
Definition: qcustomplot.h:3908
double key() const
Definition: qcustomplot.h:3910
QCPAxis * keyAxis() const
Definition: qcustomplot.h:3913
QCPItemAnchor * parentAnchorY() const
Definition: qcustomplot.h:3909
QPointF coords() const
Definition: qcustomplot.h:3912
PositionType
Definition: qcustomplot.h:1771
double value() const
Definition: qcustomplot.h:3911
QCPItemAnchor * parentAnchor() const
Definition: qcustomplot.h:3907
PositionType typeY() const
Definition: qcustomplot.h:3906
QCPAxisRect * axisRect() const
Definition: qcustomplot.h:3817
QBrush selectedBrush() const
Definition: qcustomplot.h:7087
virtual void draw(QCPPainter *painter) Q_DECL_OVERRIDE
QPen pen() const
Definition: qcustomplot.h:7084
QCPItemRect(QCustomPlot *parentPlot)
void setPen(const QPen &pen)
QBrush brush() const
Definition: qcustomplot.h:7086
void setSelectedPen(const QPen &pen)
virtual QPointF anchorPixelPosition(int anchorId) const Q_DECL_OVERRIDE
QBrush mainBrush() const
virtual double selectTest(const QPointF &pos, bool onlySelectable, QVariant *details=0) const Q_DECL_OVERRIDE
virtual ~QCPItemRect()
void setBrush(const QBrush &brush)
void setSelectedBrush(const QBrush &brush)
QPen selectedPen() const
Definition: qcustomplot.h:7085
AnchorIndex
Definition: qcustomplot.h:3855
QPen mainPen() const
Definition: qcustomplot.h:3686
QCPItemStraightLine(QCustomPlot *parentPlot)
void setSelectedPen(const QPen &pen)
void setPen(const QPen &pen)
QPen pen() const
Definition: qcustomplot.h:6938
virtual double selectTest(const QPointF &pos, bool onlySelectable, QVariant *details=0) const Q_DECL_OVERRIDE
virtual ~QCPItemStraightLine()
QPen selectedPen() const
Definition: qcustomplot.h:6939
Definition: qcustomplot.h:3877
virtual void draw(QCPPainter *painter) Q_DECL_OVERRIDE
double rotation() const
Definition: qcustomplot.h:7171
QColor color() const
Definition: qcustomplot.h:7160
void setSelectedFont(const QFont &font)
Qt::Alignment positionAlignment() const
Definition: qcustomplot.h:7169
AnchorIndex
Definition: qcustomplot.h:3945
void setBrush(const QBrush &brush)
QBrush brush() const
Definition: qcustomplot.h:7164
void setSelectedPen(const QPen &pen)
QPen mainPen() const
QBrush selectedBrush() const
Definition: qcustomplot.h:7165
virtual QPointF anchorPixelPosition(int anchorId) const Q_DECL_OVERRIDE
void setText(const QString &text)
QFont font() const
Definition: qcustomplot.h:7166
void setRotation(double degrees)
QPointF getTextDrawPoint(const QPointF &pos, const QRectF &rect, Qt::Alignment positionAlignment) const
QMargins padding() const
Definition: qcustomplot.h:7172
void setSelectedBrush(const QBrush &brush)
QColor selectedColor() const
Definition: qcustomplot.h:7161
QPen pen() const
Definition: qcustomplot.h:7162
QFont selectedFont() const
Definition: qcustomplot.h:7167
QCPItemText(QCustomPlot *parentPlot)
void setPositionAlignment(Qt::Alignment alignment)
QPen selectedPen() const
Definition: qcustomplot.h:7163
void setFont(const QFont &font)
Qt::Alignment textAlignment() const
Definition: qcustomplot.h:7170
void setPen(const QPen &pen)
void setColor(const QColor &color)
void setTextAlignment(Qt::Alignment alignment)
virtual double selectTest(const QPointF &pos, bool onlySelectable, QVariant *details=0) const Q_DECL_OVERRIDE
QColor mainColor() const
QBrush mainBrush() const
QString text() const
Definition: qcustomplot.h:7168
virtual ~QCPItemText()
void setSelectedColor(const QColor &color)
void setPadding(const QMargins &padding)
QFont mainFont() const
Definition: qcustomplot.h:4121
void setSelectedBrush(const QBrush &brush)
void setBrush(const QBrush &brush)
TracerStyle
Definition: qcustomplot.h:4141
void setStyle(TracerStyle style)
double size() const
Definition: qcustomplot.h:7436
void setGraphKey(double key)
virtual double selectTest(const QPointF &pos, bool onlySelectable, QVariant *details=0) const Q_DECL_OVERRIDE
void setInterpolating(bool enabled)
QBrush brush() const
Definition: qcustomplot.h:7434
double graphKey() const
Definition: qcustomplot.h:7439
QCPGraph * graph() const
Definition: qcustomplot.h:7438
QPen selectedPen() const
Definition: qcustomplot.h:7433
void setSelectedPen(const QPen &pen)
QBrush selectedBrush() const
Definition: qcustomplot.h:7435
void setSize(double size)
bool interpolating() const
Definition: qcustomplot.h:7440
void setGraph(QCPGraph *graph)
void setPen(const QPen &pen)
TracerStyle style() const
Definition: qcustomplot.h:7437
Definition: qcustomplot.h:480
LayerMode mMode
Definition: qcustomplot.h:827
QString name() const
Definition: qcustomplot.h:807
LayerMode mode() const
Definition: qcustomplot.h:811
void drawToPaintBuffer()
void addChild(QCPLayerable *layerable, bool prepend)
QList< QCPLayerable * > children() const
Definition: qcustomplot.h:809
LayerMode
Definition: qcustomplot.h:793
void setMode(LayerMode mode)
QWeakPointer< QCPAbstractPaintBuffer > mPaintBuffer
Definition: qcustomplot.h:830
void draw(QCPPainter *painter)
void setVisible(bool visible)
void removeChild(QCPLayerable *layerable)
bool visible() const
Definition: qcustomplot.h:810
int index() const
Definition: qcustomplot.h:808
void replot()
Definition: qcustomplot.h:522
virtual void mousePressEvent(QMouseEvent *event, const QVariant &details)
virtual void selectEvent(QMouseEvent *event, bool additive, const QVariant &details, bool *selectionStateChanged)
virtual void applyDefaultAntialiasingHint(QCPPainter *painter) const =0
virtual double selectTest(const QPointF &pos, bool onlySelectable, QVariant *details=0) const
virtual ~QCPLayerable()
virtual void mouseReleaseEvent(QMouseEvent *event, const QPointF &startPos)
void setVisible(bool on)
QCustomPlot * parentPlot() const
Definition: qcustomplot.h:862
void setAntialiased(bool enabled)
QCPLayer * layer() const
Definition: qcustomplot.h:864
bool antialiased() const
Definition: qcustomplot.h:865
QCPLayerable(QCustomPlot *plot, QString targetLayer=QString(), QCPLayerable *parentLayerable=0)
virtual void deselectEvent(bool *selectionStateChanged)
void initializeParentPlot(QCustomPlot *parentPlot)
void setParentLayerable(QCPLayerable *parentLayerable)
bool realVisibility() const
bool setLayer(const QString &layerName)
void layerChanged(QCPLayer *newLayer)
QCPLayerable * parentLayerable() const
Definition: qcustomplot.h:863
virtual void parentPlotInitialized(QCustomPlot *parentPlot)
void applyAntialiasingHint(QCPPainter *painter, bool localAntialiased, QCP::AntialiasedElement overrideElement) const
virtual void draw(QCPPainter *painter)=0
virtual QCP::Interaction selectionCategory() const
virtual void wheelEvent(QWheelEvent *event)
Q_SLOT bool setLayer(QCPLayer *layer)
bool visible() const
Definition: qcustomplot.h:861
bool moveToLayer(QCPLayer *layer, bool prepend)
virtual void mouseMoveEvent(QMouseEvent *event, const QPointF &startPos)
virtual QRect clipRect() const
virtual void mouseDoubleClickEvent(QMouseEvent *event, const QVariant &details)
Definition: qcustomplot.h:755
void setMaximumSize(int width, int height)
void setMinimumMargins(const QMargins &margins)
SizeConstraintRect
Definition: qcustomplot.h:1398
UpdatePhase
Definition: qcustomplot.h:772
QRect rect() const
Definition: qcustomplot.h:1411
QCP::MarginSides autoMargins() const
Definition: qcustomplot.h:1415
QRect outerRect() const
Definition: qcustomplot.h:1412
void setSizeConstraintRect(SizeConstraintRect constraintRect)
void setOuterRect(const QRect &rect)
void setMarginGroup(QCP::MarginSides sides, QCPMarginGroup *group)
void setMinimumSize(const QSize &size)
QMargins minimumMargins() const
Definition: qcustomplot.h:1414
QSize minimumSize() const
Definition: qcustomplot.h:1416
SizeConstraintRect sizeConstraintRect() const
Definition: qcustomplot.h:1418
virtual QList< QCPLayoutElement * > elements(bool recursive) const
void setMaximumSize(const QSize &size)
QHash< QCP::MarginSide, QCPMarginGroup * > marginGroups() const
Definition: qcustomplot.h:1422
QCPMarginGroup * marginGroup(QCP::MarginSide side) const
Definition: qcustomplot.h:1419
void setMinimumSize(int width, int height)
void setMargins(const QMargins &margins)
virtual QSize maximumOuterSizeHint() const
virtual double selectTest(const QPointF &pos, bool onlySelectable, QVariant *details=0) const Q_DECL_OVERRIDE
virtual void parentPlotInitialized(QCustomPlot *parentPlot) Q_DECL_OVERRIDE
virtual QSize minimumOuterSizeHint() const
void setAutoMargins(QCP::MarginSides sides)
virtual void draw(QCPPainter *painter) Q_DECL_OVERRIDE
Definition: qcustomplot.h:1467
virtual void update(UpdatePhase phase)
QMargins margins() const
Definition: qcustomplot.h:1413
QSize maximumSize() const
Definition: qcustomplot.h:1417
Definition: qcustomplot.h:894
virtual void simplify() Q_DECL_OVERRIDE
int columnCount() const
Definition: qcustomplot.h:1557
void setRowStretchFactors(const QList< double > &factors)
virtual QList< QCPLayoutElement * > elements(bool recursive) const Q_DECL_OVERRIDE
void setColumnSpacing(int pixels)
int rowSpacing() const
Definition: qcustomplot.h:1563
void setColumnStretchFactors(const QList< double > &factors)
virtual QCPLayoutElement * takeAt(int index) Q_DECL_OVERRIDE
FillOrder fillOrder() const
Definition: qcustomplot.h:1565
void setRowStretchFactor(int row, double factor)
FillOrder
Definition: qcustomplot.h:1542
virtual QCPLayoutElement * elementAt(int index) const Q_DECL_OVERRIDE
int wrap() const
Definition: qcustomplot.h:1564
QList< double > columnStretchFactors() const
Definition: qcustomplot.h:1560
virtual bool take(QCPLayoutElement *element) Q_DECL_OVERRIDE
QList< double > rowStretchFactors() const
Definition: qcustomplot.h:1561
virtual void updateLayout() Q_DECL_OVERRIDE
void setRowSpacing(int pixels)
void setWrap(int count)
int columnSpacing() const
Definition: qcustomplot.h:1562
void setColumnStretchFactor(int column, double factor)
void setFillOrder(FillOrder order, bool rearrange=true)
Definition: qcustomplot.h:962
virtual double selectTest(const QPointF &pos, bool onlySelectable, QVariant *details=0) const Q_DECL_OVERRIDE
InsetPlacement
Definition: qcustomplot.h:969
Definition: qcustomplot.h:856
void clear()
bool removeAt(int index)
virtual void update(UpdatePhase phase) Q_DECL_OVERRIDE
virtual QCPLayoutElement * takeAt(int index)=0
static QSize getFinalMaximumOuterSize(const QCPLayoutElement *el)
void releaseElement(QCPLayoutElement *el)
bool remove(QCPLayoutElement *element)
virtual QList< QCPLayoutElement * > elements(bool recursive) const Q_DECL_OVERRIDE
QVector< int > getSectionSizes(QVector< int > maxSizes, QVector< int > minSizes, QVector< double > stretchFactors, int totalSize) const
static QSize getFinalMinimumOuterSize(const QCPLayoutElement *el)
virtual QCPLayoutElement * elementAt(int index) const =0
virtual int elementCount() const =0
virtual bool take(QCPLayoutElement *element)=0
virtual void simplify()
void sizeConstraintsChanged() const
void adoptElement(QCPLayoutElement *el)
virtual void updateLayout()
Definition: qcustomplot.h:2500
int iconTextPadding() const
Definition: qcustomplot.h:5462
SelectableParts selectedParts() const
void setSelectedBorderPen(const QPen &pen)
void setIconBorderPen(const QPen &pen)
Q_SLOT void setSelectableParts(const SelectableParts &selectableParts)
QFont selectedFont() const
Definition: qcustomplot.h:5469
void setBrush(const QBrush &brush)
SelectablePart
Definition: qcustomplot.h:2529
QPen iconBorderPen() const
Definition: qcustomplot.h:5463
void setIconTextPadding(int padding)
void setSelectedTextColor(const QColor &color)
QBrush selectedBrush() const
Definition: qcustomplot.h:5468
void setBorderPen(const QPen &pen)
void setSelectedBrush(const QBrush &brush)
void setIconSize(const QSize &size)
Q_SLOT void setSelectedParts(const SelectableParts &selectedParts)
void setIconSize(int width, int height)
virtual double selectTest(const QPointF &pos, bool onlySelectable, QVariant *details=0) const Q_DECL_OVERRIDE
void setFont(const QFont &font)
QColor textColor() const
Definition: qcustomplot.h:5460
QBrush brush() const
Definition: qcustomplot.h:5458
void setSelectedFont(const QFont &font)
QColor selectedTextColor() const
Definition: qcustomplot.h:5470
SelectableParts selectableParts() const
Definition: qcustomplot.h:5464
QPen selectedIconBorderPen() const
Definition: qcustomplot.h:5467
QPen selectedBorderPen() const
Definition: qcustomplot.h:5466
void setSelectedIconBorderPen(const QPen &pen)
void setTextColor(const QColor &color)
QFont font() const
Definition: qcustomplot.h:5459
QSize iconSize() const
Definition: qcustomplot.h:5461
Definition: qcustomplot.h:1015
double boundingDistance() const
bool inverted() const
Definition: qcustomplot.h:1731
void setWidth(double width)
void draw(QCPPainter *painter, const QCPVector2D &pos, const QCPVector2D &dir) const
void setStyle(EndingStyle style)
void setInverted(bool inverted)
EndingStyle
Definition: qcustomplot.h:1032
double realLength() const
void setLength(double length)
double width() const
Definition: qcustomplot.h:1729
double length() const
Definition: qcustomplot.h:1730
void draw(QCPPainter *painter, const QCPVector2D &pos, double angle) const
Definition: qcustomplot.h:726
void removeChild(QCP::MarginSide side, QCPLayoutElement *element)
QList< QCPLayoutElement * > elements(QCP::MarginSide side) const
Definition: qcustomplot.h:1336
virtual ~QCPMarginGroup()
QCPMarginGroup(QCustomPlot *parentPlot)
void addChild(QCP::MarginSide side, QCPLayoutElement *element)
bool isEmpty() const
virtual int commonMargin(QCP::MarginSide side) const
Definition: qcustomplot.h:705
virtual QCPPainter * startPainting() Q_DECL_OVERRIDE
virtual ~QCPPaintBufferPixmap()
QCPPaintBufferPixmap(const QSize &size, double devicePixelRatio)
Definition: qcustomplot.h:414
bool begin(QPaintDevice *device)
void drawLine(const QLineF &line)
PainterMode
Definition: qcustomplot.h:422
@ pmNoCaching
Definition: qcustomplot.h:430
@ pmVectorized
Definition: qcustomplot.h:426
void setPen(Qt::PenStyle penStyle)
void setPen(const QColor &color)
void setModes(PainterModes modes)
void restore()
void makeNonCosmetic()
void save()
void setAntialiasing(bool enabled)
void drawLine(const QPointF &p1, const QPointF &p2)
Definition: qcustomplot.h:647
PainterModes modes() const
Definition: qcustomplot.h:634
void setMode(PainterMode mode, bool enabled=true)
void setPen(const QPen &pen)
Defines an abstract interface for one-dimensional plottables.
Definition: qcustomplot.h:4362
virtual int dataCount() const =0
virtual bool sortKeyIsMainKey() const =0
virtual double dataMainKey(int index) const =0
virtual int findBegin(double sortKey, bool expandedRange=true) const =0
virtual int findEnd(double sortKey, bool expandedRange=true) const =0
virtual QCPDataSelection selectTestRect(const QRectF &rect, bool onlySelectable) const =0
virtual QPointF dataPixelPosition(int index) const =0
virtual ~QCPPlottableInterface1D()
Definition: qcustomplot.h:4364
virtual QCPRange dataValueRange(int index) const =0
virtual double dataMainValue(int index) const =0
virtual double dataSortKey(int index) const =0
Definition: qcustomplot.h:2478
virtual QSize minimumOuterSizeHint() const Q_DECL_OVERRIDE
virtual void draw(QCPPainter *painter) Q_DECL_OVERRIDE
QCPPlottableLegendItem(QCPLegend *parent, QCPAbstractPlottable *plottable)
QCPAbstractPlottable * plottable()
Definition: qcustomplot.h:5396
Definition: qcustomplot.h:593
void expand(const QCPRange &otherRange)
QCPRange(double lower, double upper)
QCPRange & operator*=(const double &value)
Definition: qcustomplot.h:952
QCPRange bounded(double lowerBound, double upperBound) const
QCPRange & operator-=(const double &value)
Definition: qcustomplot.h:947
static bool validRange(const QCPRange &range)
QCPRange sanitizedForLogScale() const
bool operator!=(const QCPRange &other) const
Definition: qcustomplot.h:940
static bool validRange(double lower, double upper)
void expand(double includeCoord)
double size() const
Definition: qcustomplot.h:969
QCPRange sanitizedForLinScale() const
QCPRange & operator/=(const double &value)
Definition: qcustomplot.h:957
QCPRange expanded(const QCPRange &otherRange) const
bool operator==(const QCPRange &other) const
Definition: qcustomplot.h:937
double lower
Definition: qcustomplot.h:595
QDebug operator<<(QDebug d, const QCPRange &range)
Definition: qcustomplot.h:994
QCPRange & operator+=(const double &value)
Definition: qcustomplot.h:942
double upper
Definition: qcustomplot.h:595
bool contains(double value) const
Definition: qcustomplot.h:981
double center() const
Definition: qcustomplot.h:970
QCPRange expanded(double includeCoord) const
void normalize()
Definition: qcustomplot.h:971
Definition: qcustomplot.h:305
bool isPenDefined() const
Definition: qcustomplot.h:2717
void setPixmap(const QPixmap &pixmap)
bool isNone() const
Definition: qcustomplot.h:2716
void setBrush(const QBrush &brush)
void setPen(const QPen &pen)
void setShape(ScatterShape shape)
void setFromOther(const QCPScatterStyle &other, ScatterProperties properties)
ScatterProperty
Definition: qcustomplot.h:2612
@ spPen
0x01 The pen property, see setPen
Definition: qcustomplot.h:2615
void drawShape(QCPPainter *painter, const QPointF &pos) const
void drawShape(QCPPainter *painter, double x, double y) const
void setCustomPath(const QPainterPath &customPath)
QPixmap pixmap() const
Definition: qcustomplot.h:2703
void setSize(double size)
QPen pen() const
Definition: qcustomplot.h:2701
ScatterShape
Definition: qcustomplot.h:317
QBrush brush() const
Definition: qcustomplot.h:2702
QPainterPath customPath() const
Definition: qcustomplot.h:2704
ScatterShape shape() const
Definition: qcustomplot.h:2700
void applyTo(QCPPainter *painter, const QPen &defaultPen) const
Definition: qcustomplot.h:5112
void setBracketStyle(BracketStyle style)
BracketStyle bracketStyle() const
Definition: qcustomplot.h:5145
bool tangentToData() const
Definition: qcustomplot.h:5146
void setBracketWidth(int width)
void setBracketBrush(const QBrush &brush)
int mBracketWidth
Definition: qcustomplot.h:5169
int mBracketHeight
Definition: qcustomplot.h:5170
int tangentAverage() const
Definition: qcustomplot.h:5147
int bracketHeight() const
Definition: qcustomplot.h:5144
BracketStyle mBracketStyle
Definition: qcustomplot.h:5171
int mTangentAverage
Definition: qcustomplot.h:5173
virtual void drawDecoration(QCPPainter *painter, QCPDataSelection selection) Q_DECL_OVERRIDE
void setTangentToData(bool enabled)
QPointF getPixelCoordinates(const QCPPlottableInterface1D *interface1d, int dataIndex) const
BracketStyle
Definition: qcustomplot.h:5121
double getTangentAngle(const QCPPlottableInterface1D *interface1d, int dataIndex, int direction) const
bool mTangentToData
Definition: qcustomplot.h:5172
void setBracketPen(const QPen &pen)
QBrush bracketBrush() const
Definition: qcustomplot.h:5142
QPen mBracketPen
Definition: qcustomplot.h:5167
virtual void drawBracket(QCPPainter *painter, int direction) const
void setTangentAverage(int pointCount)
int bracketWidth() const
Definition: qcustomplot.h:5143
QBrush mBracketBrush
Definition: qcustomplot.h:5168
void setBracketHeight(int height)
Definition: qcustomplot.h:3647
virtual void copyFrom(const QCPSelectionDecorator *other)
QCPScatterStyle getFinalScatterStyle(const QCPScatterStyle &unselectedStyle) const
virtual bool registerWithPlottable(QCPAbstractPlottable *plottable)
void applyBrush(QCPPainter *painter) const
QCPAbstractPlottable * mPlottable
Definition: qcustomplot.h:3687
QBrush mBrush
Definition: qcustomplot.h:3683
virtual void drawDecoration(QCPPainter *painter, QCPDataSelection selection)
virtual ~QCPSelectionDecorator()
QCPScatterStyle mScatterStyle
Definition: qcustomplot.h:3684
QPen mPen
Definition: qcustomplot.h:3682
void applyPen(QCPPainter *painter) const
QBrush brush() const
Definition: qcustomplot.h:3655
void setUsedScatterProperties(const QCPScatterStyle::ScatterProperties &properties)
QPen pen() const
Definition: qcustomplot.h:3654
QCPScatterStyle scatterStyle() const
Definition: qcustomplot.h:3656
void setBrush(const QBrush &brush)
QCPScatterStyle::ScatterProperties usedScatterProperties() const
Definition: qcustomplot.h:3657
void setScatterStyle(const QCPScatterStyle &scatterStyle, QCPScatterStyle::ScatterProperties usedProperties=QCPScatterStyle::spPen)
void setPen(const QPen &pen)
QCPScatterStyle::ScatterProperties mUsedScatterProperties
Definition: qcustomplot.h:3685
Definition: qcustomplot.h:1276
virtual void keyPressEvent(QKeyEvent *event)
void accepted(const QRect &rect, QMouseEvent *event)
void changed(const QRect &rect, QMouseEvent *event)
QBrush mBrush
Definition: qcustomplot.h:1306
bool mActive
Definition: qcustomplot.h:1308
QCPRange range(const QCPAxis *axis) const
virtual void endSelection(QMouseEvent *event)
QRect rect() const
Definition: qcustomplot.h:1283
virtual void startSelection(QMouseEvent *event)
QRect mRect
Definition: qcustomplot.h:1304
virtual void draw(QCPPainter *painter) Q_DECL_OVERRIDE
virtual void moveSelection(QMouseEvent *event)
void started(QMouseEvent *event)
virtual void applyDefaultAntialiasingHint(QCPPainter *painter) const Q_DECL_OVERRIDE
QBrush brush() const
Definition: qcustomplot.h:1286
void setBrush(const QBrush &brush)
QPen pen() const
Definition: qcustomplot.h:1285
bool isActive() const
Definition: qcustomplot.h:1287
void setPen(const QPen &pen)
QCPSelectionRect(QCustomPlot *parentPlot)
QPen mPen
Definition: qcustomplot.h:1305
void canceled(const QRect &rect, QInputEvent *event)
Q_SLOT void cancel()
virtual ~QCPSelectionRect()
Definition: qcustomplot.h:6302
double mainValue() const
Definition: qcustomplot.h:6316
double sortKey() const
Definition: qcustomplot.h:6309
QCPRange valueRange() const
Definition: qcustomplot.h:6318
double key
Definition: qcustomplot.h:6326
double mainKey() const
Definition: qcustomplot.h:6315
QCPStatisticalBoxData(double key, double minimum, double lowerQuartile, double median, double upperQuartile, double maximum, const QVector< double > &outliers=QVector< double >())
static QCPStatisticalBoxData fromSortKey(double sortKey)
Definition: qcustomplot.h:6310
QVector< double > outliers
Definition: qcustomplot.h:6327
static bool sortKeyIsMainKey()
Definition: qcustomplot.h:6313
Definition: qcustomplot.h:3337
void addData(double key, double minimum, double lowerQuartile, double median, double upperQuartile, double maximum, const QVector< double > &outliers=QVector< double >())
void setData(QSharedPointer< QCPStatisticalBoxDataContainer > data)
void setWidth(double width)
bool whiskerAntialiased() const
Definition: qcustomplot.h:6369
QPen whiskerBarPen() const
Definition: qcustomplot.h:6368
void setWhiskerPen(const QPen &pen)
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)
void setWhiskerAntialiased(bool enabled)
QPen whiskerPen() const
Definition: qcustomplot.h:6367
virtual QCPDataSelection selectTestRect(const QRectF &rect, bool onlySelectable) const Q_DECL_OVERRIDE
void setMedianPen(const QPen &pen)
QCPStatisticalBox(QCPAxis *keyAxis, QCPAxis *valueAxis)
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)
void setWhiskerBarPen(const QPen &pen)
double whiskerWidth() const
Definition: qcustomplot.h:6366
void setOutlierStyle(const QCPScatterStyle &style)
QSharedPointer< QCPStatisticalBoxDataContainer > data() const
Definition: qcustomplot.h:6362
void setWhiskerWidth(double width)
double width() const
Definition: qcustomplot.h:6365
virtual double selectTest(const QPointF &pos, bool onlySelectable, QVariant *details=0) const Q_DECL_OVERRIDE
QCPScatterStyle outlierStyle() const
Definition: qcustomplot.h:6371
QPen medianPen() const
Definition: qcustomplot.h:6370
Definition: qcustomplot.h:5554
QCPTextElement(QCustomPlot *parentPlot, const QString &text, const QFont &font)
QCPTextElement(QCustomPlot *parentPlot, const QString &text)
void setFont(const QFont &font)
void setSelectedFont(const QFont &font)
bool selected() const
Definition: qcustomplot.h:5586
int textFlags() const
Definition: qcustomplot.h:5580
Q_SLOT void setSelectable(bool selectable)
QCPTextElement(QCustomPlot *parentPlot, const QString &text, double pointSize)
virtual double selectTest(const QPointF &pos, bool onlySelectable, QVariant *details=0) const Q_DECL_OVERRIDE
QString text() const
Definition: qcustomplot.h:5579
QColor textColor() const
Definition: qcustomplot.h:5582
void setTextColor(const QColor &color)
QFont selectedFont() const
Definition: qcustomplot.h:5583
QFont font() const
Definition: qcustomplot.h:5581
bool selectable() const
Definition: qcustomplot.h:5585
QColor selectedTextColor() const
Definition: qcustomplot.h:5584
Q_SLOT void setSelected(bool selected)
void setTextFlags(int flags)
void setSelectedTextColor(const QColor &color)
void setText(const QString &text)
QCPTextElement(QCustomPlot *parentPlot, const QString &text, const QString &fontFamily, double pointSize)
QCPTextElement(QCustomPlot *parentPlot)
Definition: qcustomplot.h:508
double distanceSquaredToLine(const QLineF &line) const
QCPVector2D perpendicular() const
Definition: qcustomplot.h:534
double length() const
Definition: qcustomplot.h:526
double distanceSquaredToLine(const QCPVector2D &start, const QCPVector2D &end) const
double & rx()
Definition: qcustomplot.h:518
QCPVector2D & operator/=(double divisor)
double dot(const QCPVector2D &vec) const
Definition: qcustomplot.h:535
QCPVector2D(const QPointF &point)
QCPVector2D & operator+=(const QCPVector2D &vector)
QCPVector2D & operator*=(double factor)
QCPVector2D(double x, double y)
double x() const
Definition: qcustomplot.h:516
double y() const
Definition: qcustomplot.h:517
QDebug operator<<(QDebug d, const QCPVector2D &vec)
Definition: qcustomplot.h:590
QCPVector2D normalized() const
double lengthSquared() const
Definition: qcustomplot.h:527
QCPVector2D & operator-=(const QCPVector2D &vector)
double & ry()
Definition: qcustomplot.h:519
void setX(double x)
Definition: qcustomplot.h:522
QPointF toPointF() const
Definition: qcustomplot.h:529
bool isNull() const
Definition: qcustomplot.h:531
void normalize()
QCPVector2D(const QPoint &point)
void setY(double y)
Definition: qcustomplot.h:523
QPoint toPoint() const
Definition: qcustomplot.h:528
double distanceToStraightLine(const QCPVector2D &base, const QCPVector2D &direction) const
Definition: qcustomplot.h:1925
void legendDoubleClick(QCPLegend *legend, QCPAbstractLegendItem *item, QMouseEvent *event)
bool mOpenGl
Definition: qcustomplot.h:4288
void setSelectionRect(QCPSelectionRect *selectionRect)
void beforeReplot()
QCPGraph * graph() const
void setBackground(const QPixmap &pm)
void setBufferDevicePixelRatio(double ratio)
int itemCount() const
void toPainter(QCPPainter *painter, int width=0, int height=0)
bool setCurrentLayer(QCPLayer *layer)
QPointer< QCPLayerable > mMouseEventLayerable
Definition: qcustomplot.h:4294
Qt::KeyboardModifier multiSelectModifier() const
Definition: qcustomplot.h:4114
const QCP::Interactions interactions() const
Definition: qcustomplot.h:4110
QVariant mMouseSignalLayerableDetails
Definition: qcustomplot.h:4297
void setBackgroundScaled(bool scaled)
Q_SLOT void deselectAll()
void setPlottingHint(QCP::PlottingHint hint, bool enabled=true)
QList< QCPGraph * > selectedGraphs() const
void setViewport(const QRect &rect)
bool removeLayer(QCPLayer *layer)
void setInteraction(const QCP::Interaction &interaction, bool enabled=true)
RefreshPriority
Definition: qcustomplot.h:1963
@ rpRefreshHint
Definition: qcustomplot.h:4080
QCPSelectionRect * mSelectionRect
Definition: qcustomplot.h:4287
virtual QSize minimumSizeHint() const Q_DECL_OVERRIDE
void setBackgroundScaledMode(Qt::AspectRatioMode mode)
void setSelectionTolerance(int pixels)
QCPAbstractItem * item() const
void selectionChangedByUser()
double bufferDevicePixelRatio() const
Definition: qcustomplot.h:4096
int selectionTolerance() const
Definition: qcustomplot.h:4111
QList< QSharedPointer< QCPAbstractPaintBuffer > > mPaintBuffers
Definition: qcustomplot.h:4291
QPixmap background() const
Definition: qcustomplot.h:4097
QCPLayer * layer(const QString &name) const
int graphCount() const
void setInteractions(const QCP::Interactions &interactions)
int plottableCount() const
QCP::AntialiasedElements antialiasedElements() const
Definition: qcustomplot.h:4103
double mBufferDevicePixelRatio
Definition: qcustomplot.h:4266
QCPLayer * currentLayer() const
QCPAxisRect * axisRectAt(const QPointF &pos) const
void axisDoubleClick(QCPAxis *axis, QCPAxis::SelectablePart part, QMouseEvent *event)
QCP::SelectionRectMode selectionRectMode() const
Definition: qcustomplot.h:4117
void afterReplot()
QList< QCPAbstractPlottable * > selectedPlottables() const
bool hasPlottable(QCPAbstractPlottable *plottable) const
bool setCurrentLayer(const QString &name)
void mouseMove(QMouseEvent *event)
QCP::AntialiasedElements notAntialiasedElements() const
Definition: qcustomplot.h:4106
LayerInsertMode
Definition: qcustomplot.h:1950
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)
void setNoAntialiasingOnDrag(bool enabled)
void legendClick(QCPLegend *legend, QCPAbstractLegendItem *item, QMouseEvent *event)
void setOpenGl(bool enabled, int multisampling=16)
void setSelectionRectMode(QCP::SelectionRectMode mode)
QCPGraph * addGraph(QCPAxis *keyAxis=0, QCPAxis *valueAxis=0)
void setBackground(const QPixmap &pm, bool scaled, Qt::AspectRatioMode mode=Qt::KeepAspectRatioByExpanding)
void plottableDoubleClick(QCPAbstractPlottable *plottable, int dataIndex, QMouseEvent *event)
QCPLayoutGrid * plotLayout() const
Definition: qcustomplot.h:4102
Q_SLOT void rescaleAxes(bool onlyVisiblePlottables=false)
void setBackground(const QBrush &brush)
int axisRectCount() const
void setMultiSelectModifier(Qt::KeyboardModifier modifier)
bool removeGraph(QCPGraph *graph)
Q_SLOT void replot(QCustomPlot::RefreshPriority refreshPriority=QCustomPlot::rpRefreshHint)
void setPlottingHints(const QCP::PlottingHints &hints)
bool removeGraph(int index)
int clearPlottables()
void mouseDoubleClick(QMouseEvent *event)
QList< QCPLegend * > selectedLegends() const
QPixmap toPixmap(int width=0, int height=0, double scale=1.0)
bool backgroundScaled() const
Definition: qcustomplot.h:4098
int mOpenGlMultisamples
Definition: qcustomplot.h:4300
int clearGraphs()
bool mOpenGlCacheLabelsBackup
Definition: qcustomplot.h:4302
QCPLayoutElement * layoutElementAt(const QPointF &pos) const
QCPLayer * layer(int index) const
QList< QCPAxis * > selectedAxes() const
bool removeItem(int index)
int clearItems()
QCP::SelectionRectMode mSelectionRectMode
Definition: qcustomplot.h:4286
bool openGl() const
Definition: qcustomplot.h:4121
QCPAbstractItem * item(int index) const
void axisClick(QCPAxis *axis, QCPAxis::SelectablePart part, QMouseEvent *event)
QCPAbstractPlottable * plottableAt(const QPointF &pos, bool onlySelectable=false) const
QCPAbstractPlottable * plottable()
bool autoAddPlottableToLegend() const
Definition: qcustomplot.h:4109
QCP::PlottingHints plottingHints() const
Definition: qcustomplot.h:4113
void mouseWheel(QWheelEvent *event)
void itemDoubleClick(QCPAbstractItem *item, QMouseEvent *event)
void mouseRelease(QMouseEvent *event)
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)
QCPAbstractItem * itemAt(const QPointF &pos, bool onlySelectable=false) const
bool noAntialiasingOnDrag() const
Definition: qcustomplot.h:4112
void mousePress(QMouseEvent *event)
bool mReplotQueued
Definition: qcustomplot.h:4299
bool mMouseHasMoved
Definition: qcustomplot.h:4293
QCPAbstractPlottable * plottable(int index)
bool addLayer(const QString &name, QCPLayer *otherLayer=0, LayerInsertMode insertMode=limAbove)
QList< QCPAbstractItem * > selectedItems() const
bool savePdf(const QString &fileName, int width=0, int height=0, QCP::ExportPen exportPen=QCP::epAllowCosmetic, const QString &pdfCreator=QString(), const QString &pdfTitle=QString())
QVariant mMouseEventLayerableDetails
Definition: qcustomplot.h:4296
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)
void setAutoAddPlottableToLegend(bool on)
QCP::AntialiasedElements mOpenGlAntialiasedElementsBackup
Definition: qcustomplot.h:4301
QPointer< QCPLayerable > mMouseSignalLayerable
Definition: qcustomplot.h:4295
bool removeItem(QCPAbstractItem *item)
void setNotAntialiasedElements(const QCP::AntialiasedElements &notAntialiasedElements)
void itemClick(QCPAbstractItem *item, QMouseEvent *event)
bool saveBmp(const QString &fileName, int width=0, int height=0, double scale=1.0, int resolution=96, QCP::ResolutionUnit resolutionUnit=QCP::ruDotsPerInch)
bool moveLayer(QCPLayer *layer, QCPLayer *otherLayer, LayerInsertMode insertMode=limAbove)
QCPGraph * graph(int index) const
void setAntialiasedElement(QCP::AntialiasedElement antialiasedElement, bool enabled=true)
bool hasItem(QCPAbstractItem *item) const
QCPAxisRect * axisRect(int index=0) const
bool removePlottable(QCPAbstractPlottable *plottable)
void plottableClick(QCPAbstractPlottable *plottable, int dataIndex, QMouseEvent *event)
void setAntialiasedElements(const QCP::AntialiasedElements &antialiasedElements)
QCPSelectionRect * selectionRect() const
Definition: qcustomplot.h:4120
QList< QCPAxisRect * > axisRects() const
Qt::AspectRatioMode backgroundScaledMode() const
Definition: qcustomplot.h:4099
int layerCount() const
bool removePlottable(int index)
void setNotAntialiasedElement(QCP::AntialiasedElement notAntialiasedElement, bool enabled=true)
Definition: qcustomplot.h:94
bool isInvalidData(double value)
Definition: qcustomplot.h:234
const QMetaObject staticMetaObject
ExportPen
Definition: qcustomplot.h:190
@ epAllowCosmetic
Definition: qcustomplot.h:194
@ epNoCosmetic
Definition: qcustomplot.h:191
int getMarginValue(const QMargins &margins, QCP::MarginSide side)
Definition: qcustomplot.h:282
Interaction
Definition: qcustomplot.h:195
@ iRangeDrag
Definition: qcustomplot.h:196
@ iSelectItems
Definition: qcustomplot.h:218
@ iSelectLegend
Definition: qcustomplot.h:215
@ iSelectOther
Definition: qcustomplot.h:221
@ iSelectAxes
Definition: qcustomplot.h:212
@ iSelectPlottables
Definition: qcustomplot.h:208
@ iMultiSelect
Definition: qcustomplot.h:204
@ iRangeZoom
Definition: qcustomplot.h:200
PlottingHint
Definition: qcustomplot.h:166
@ phFastPolylines
Definition: qcustomplot.h:169
@ phImmediateRefresh
Definition: qcustomplot.h:295
@ phCacheLabels
Definition: qcustomplot.h:183
@ phNone
0x000 No hints are set
Definition: qcustomplot.h:167
ResolutionUnit
Definition: qcustomplot.h:176
@ ruDotsPerCentimeter
Resolution is given in dots per centimeter (dpcm)
Definition: qcustomplot.h:179
@ ruDotsPerMeter
Resolution is given in dots per meter (dpm)
Definition: qcustomplot.h:177
@ ruDotsPerInch
Resolution is given in dots per inch (DPI/PPI)
Definition: qcustomplot.h:181
MarginSide
Definition: qcustomplot.h:100
@ msTop
0x04 top margin
Definition: qcustomplot.h:105
@ msNone
0x00 no margin
Definition: qcustomplot.h:111
@ msRight
0x02 right margin
Definition: qcustomplot.h:103
@ msAll
0xFF all margins
Definition: qcustomplot.h:109
@ msLeft
0x01 left margin
Definition: qcustomplot.h:101
@ msBottom
0x08 bottom margin
Definition: qcustomplot.h:107
SelectionType
Definition: qcustomplot.h:396
@ stMultipleDataRanges
Definition: qcustomplot.h:408
@ stDataRange
Definition: qcustomplot.h:405
@ stNone
The plottable is not selectable.
Definition: qcustomplot.h:397
@ stSingleData
One individual data point can be selected at a time.
Definition: qcustomplot.h:403
@ stWhole
Definition: qcustomplot.h:399
SelectionRectMode
Definition: qcustomplot.h:353
@ srmCustom
Definition: qcustomplot.h:369
@ srmSelect
Definition: qcustomplot.h:363
@ srmZoom
Definition: qcustomplot.h:358
@ srmNone
Definition: qcustomplot.h:354
AntialiasedElement
Definition: qcustomplot.h:126
@ aeAxes
0x0001 Axis base line and tick marks
Definition: qcustomplot.h:127
@ aeOther
Definition: qcustomplot.h:270
@ aeItems
0x0040 Main lines of items
Definition: qcustomplot.h:141
@ aeScatters
Definition: qcustomplot.h:143
@ aeLegendItems
0x0010 Legend items
Definition: qcustomplot.h:135
@ aePlottables
0x0020 Main lines of plottables
Definition: qcustomplot.h:137
@ aeNone
0x0000 No elements
Definition: qcustomplot.h:156
@ aeSubGrid
0x0004 Sub grid lines
Definition: qcustomplot.h:131
@ aeFills
Definition: qcustomplot.h:148
@ aeAll
0xFFFF All elements
Definition: qcustomplot.h:154
@ aeGrid
0x0002 Grid lines
Definition: qcustomplot.h:129
@ aeZeroLine
0x0400 Zero-lines, see QCPGrid::setZeroLinePen
Definition: qcustomplot.h:151
@ aeLegend
0x0008 Legend box
Definition: qcustomplot.h:133
void setMarginValue(QMargins &margins, QCP::MarginSide side, int value)
Definition: qcustomplot.h:253
SignDomain
Definition: qcustomplot.h:207
@ sdNegative
The negative sign domain, i.e. numbers smaller than zero.
Definition: qcustomplot.h:208
@ sdPositive
The positive sign domain, i.e. numbers greater than zero.
Definition: qcustomplot.h:212
@ sdBoth
Both sign domains, including zero, i.e. all numbers.
Definition: qcustomplot.h:210
const QCPRange operator/(const QCPRange &range, double value)
Definition: qcustomplot.h:720
const QCPRange operator*(const QCPRange &range, double value)
Definition: qcustomplot.h:702
const QCPRange operator-(const QCPRange &range, double value)
Definition: qcustomplot.h:693
Q_DECLARE_TYPEINFO(QCPScatterStyle, Q_MOVABLE_TYPE)
const QCPRange operator+(const QCPRange &range, double value)
Definition: qcustomplot.h:675
QCPDataContainer< QCPGraphData > QCPGraphDataContainer
Definition: qcustomplot.h:5792
#define Q_DECL_OVERRIDE
Definition: qcustomplot.h:137
QCPDataContainer< QCPBarsData > QCPBarsDataContainer
Definition: qcustomplot.h:6196
#define QCP_LIB_DECL
Definition: qcustomplot.h:132
QCPDataContainer< QCPStatisticalBoxData > QCPStatisticalBoxDataContainer
Definition: qcustomplot.h:6342
QVector< QCPErrorBarsData > QCPErrorBarsDataContainer
Definition: qcustomplot.h:6802
QCPDataContainer< QCPCurveData > QCPCurveDataContainer
Definition: qcustomplot.h:5980
QCPDataContainer< QCPFinancialData > QCPFinancialDataContainer
Definition: qcustomplot.h:6630
Definition: qcustomplot.h:1570
QString suffixPart
Definition: qcustomplot.h:2571
QRect suffixBounds
Definition: qcustomplot.h:2572