iCub-main
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, 2012, 2013, 2014 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: 07.04.14 **
23 ** Version: 1.2.1 **
24 ****************************************************************************/
25 
26 #ifndef QCUSTOMPLOT_H
27 #define QCUSTOMPLOT_H
28 
29 #include <QObject>
30 #include <QPointer>
31 #include <QWidget>
32 #include <QPainter>
33 #include <QPaintEvent>
34 #include <QMouseEvent>
35 #include <QPixmap>
36 #include <QVector>
37 #include <QString>
38 #include <QDateTime>
39 #include <QMultiMap>
40 #include <QFlags>
41 #include <QDebug>
42 #include <QVector2D>
43 #include <QStack>
44 #include <QCache>
45 #include <QMargins>
46 #include <qmath.h>
47 #include <limits>
48 #if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
49 # include <qnumeric.h>
50 # include <QPrinter>
51 # include <QPrintEngine>
52 #else
53 # include <QtNumeric>
54 # include <QtPrintSupport>
55 #endif
56 
57 class QCPPainter;
58 class QCustomPlot;
59 class QCPLayerable;
60 class QCPLayoutElement;
61 class QCPLayout;
62 class QCPAxis;
63 class QCPAxisRect;
66 class QCPGraph;
67 class QCPAbstractItem;
68 class QCPItemPosition;
69 class QCPLayer;
70 class QCPPlotTitle;
71 class QCPLegend;
73 class QCPColorMap;
74 class QCPColorScale;
75 
76 
80 // decl definitions for shared library compilation/usage:
81 #if defined(QCUSTOMPLOT_COMPILE_LIBRARY)
82 # define QCP_LIB_DECL Q_DECL_EXPORT
83 #elif defined(QCUSTOMPLOT_USE_LIBRARY)
84 # define QCP_LIB_DECL Q_DECL_IMPORT
85 #else
86 # define QCP_LIB_DECL
87 #endif
88 
92 namespace QCP
93 {
99 enum MarginSide { msLeft = 0x01
100  ,msRight = 0x02
101  ,msTop = 0x04
102  ,msBottom = 0x08
103  ,msAll = 0xFF
104  ,msNone = 0x00
105  };
106 Q_DECLARE_FLAGS(MarginSides, MarginSide)
107 
108 
117 enum AntialiasedElement { aeAxes = 0x0001
118  ,aeGrid = 0x0002
119  ,aeSubGrid = 0x0004
120  ,aeLegend = 0x0008
121  ,aeLegendItems = 0x0010
122  ,aePlottables = 0x0020
123  ,aeItems = 0x0040
124  ,aeScatters = 0x0080
125  ,aeErrorBars = 0x0100
126  ,aeFills = 0x0200
127  ,aeZeroLine = 0x0400
128  ,aeAll = 0xFFFF
129  ,aeNone = 0x0000
130  };
131 Q_DECLARE_FLAGS(AntialiasedElements, AntialiasedElement)
132 
133 
138 enum PlottingHint { phNone = 0x000
139  ,phFastPolylines = 0x001
141  ,phForceRepaint = 0x002
143  ,phCacheLabels = 0x004
144  };
145 Q_DECLARE_FLAGS(PlottingHints, PlottingHint)
146 
147 
154 enum Interaction { iRangeDrag = 0x001
155  ,iRangeZoom = 0x002
156  ,iMultiSelect = 0x004
158  ,iSelectAxes = 0x010
159  ,iSelectLegend = 0x020
160  ,iSelectItems = 0x040
161  ,iSelectOther = 0x080
162  };
163 Q_DECLARE_FLAGS(Interactions, Interaction)
164 
165 
171 inline bool isInvalidData(double value)
172 {
173  return qIsNaN(value) || qIsInf(value);
174 }
175 
181 inline bool isInvalidData(double value1, double value2)
182 {
183  return isInvalidData(value1) || isInvalidData(value2);
184 }
185 
192 inline void setMarginValue(QMargins &margins, QCP::MarginSide side, int value)
193 {
194  switch (side)
195  {
196  case QCP::msLeft: margins.setLeft(value); break;
197  case QCP::msRight: margins.setRight(value); break;
198  case QCP::msTop: margins.setTop(value); break;
199  case QCP::msBottom: margins.setBottom(value); break;
200  case QCP::msAll: margins = QMargins(value, value, value, value); break;
201  default: break;
202  }
203 }
204 
212 inline int getMarginValue(const QMargins &margins, QCP::MarginSide side)
213 {
214  switch (side)
215  {
216  case QCP::msLeft: return margins.left();
217  case QCP::msRight: return margins.right();
218  case QCP::msTop: return margins.top();
219  case QCP::msBottom: return margins.bottom();
220  default: break;
221  }
222  return 0;
223 }
224 
225 } // end of namespace QCP
226 
227 Q_DECLARE_OPERATORS_FOR_FLAGS(QCP::AntialiasedElements)
228 Q_DECLARE_OPERATORS_FOR_FLAGS(QCP::PlottingHints)
229 Q_DECLARE_OPERATORS_FOR_FLAGS(QCP::MarginSides)
230 Q_DECLARE_OPERATORS_FOR_FLAGS(QCP::Interactions)
231 
232 
234 {
235  Q_GADGET
236 public:
244  Q_ENUMS(ScatterShape)
245  enum ScatterShape { ssNone
246  ,ssDot
247  ,ssCross
248  ,ssPlus
249  ,ssCircle
250  ,ssDisc
251  ,ssSquare
252  ,ssDiamond
253  ,ssStar
254  ,ssTriangle
255  ,ssTriangleInverted
256  ,ssCrossSquare
257  ,ssPlusSquare
258  ,ssCrossCircle
259  ,ssPlusCircle
260  ,ssPeace
261  ,ssPixmap
262  ,ssCustom
263  };
264 
265  QCPScatterStyle();
266  QCPScatterStyle(ScatterShape shape, double size=6);
267  QCPScatterStyle(ScatterShape shape, const QColor &color, double size);
268  QCPScatterStyle(ScatterShape shape, const QColor &color, const QColor &fill, double size);
269  QCPScatterStyle(ScatterShape shape, const QPen &pen, const QBrush &brush, double size);
270  QCPScatterStyle(const QPixmap &pixmap);
271  QCPScatterStyle(const QPainterPath &customPath, const QPen &pen, const QBrush &brush=Qt::NoBrush, double size=6);
272 
273  // getters:
274  double size() const { return mSize; }
275  ScatterShape shape() const { return mShape; }
276  QPen pen() const { return mPen; }
277  QBrush brush() const { return mBrush; }
278  QPixmap pixmap() const { return mPixmap; }
279  QPainterPath customPath() const { return mCustomPath; }
280 
281  // setters:
282  void setSize(double size);
283  void setShape(ScatterShape shape);
284  void setPen(const QPen &pen);
285  void setBrush(const QBrush &brush);
286  void setPixmap(const QPixmap &pixmap);
287  void setCustomPath(const QPainterPath &customPath);
288 
289  // non-property methods:
290  bool isNone() const { return mShape == ssNone; }
291  bool isPenDefined() const { return mPenDefined; }
292  void applyTo(QCPPainter *painter, const QPen &defaultPen) const;
293  void drawShape(QCPPainter *painter, QPointF pos) const;
294  void drawShape(QCPPainter *painter, double x, double y) const;
295 
296 protected:
297  // property members:
298  double mSize;
300  QPen mPen;
301  QBrush mBrush;
302  QPixmap mPixmap;
303  QPainterPath mCustomPath;
304 
305  // non-property members:
307 };
309 
310 
311 class QCP_LIB_DECL QCPPainter : public QPainter
312 {
313  Q_GADGET
314 public:
319  enum PainterMode { pmDefault = 0x00
320  ,pmVectorized = 0x01
321  ,pmNoCaching = 0x02
322  ,pmNonCosmetic = 0x04
323  };
324  Q_FLAGS(PainterMode PainterModes)
325  Q_DECLARE_FLAGS(PainterModes, PainterMode)
326 
327  QCPPainter();
328  QCPPainter(QPaintDevice *device);
329  ~QCPPainter();
330 
331  // getters:
332  bool antialiasing() const { return testRenderHint(QPainter::Antialiasing); }
333  PainterModes modes() const { return mModes; }
334 
335  // setters:
336  void setAntialiasing(bool enabled);
337  void setMode(PainterMode mode, bool enabled=true);
338  void setModes(PainterModes modes);
339 
340  // methods hiding non-virtual base class functions (QPainter bug workarounds):
341  bool begin(QPaintDevice *device);
342  void setPen(const QPen &pen);
343  void setPen(const QColor &color);
344  void setPen(Qt::PenStyle penStyle);
345  void drawLine(const QLineF &line);
346  void drawLine(const QPointF &p1, const QPointF &p2) {drawLine(QLineF(p1, p2));}
347  void save();
348  void restore();
349 
350  // non-virtual methods:
351  void makeNonCosmetic();
352 
353 protected:
354  // property members:
355  PainterModes mModes;
357 
358  // non-property members:
359  QStack<bool> mAntialiasingStack;
360 };
361 Q_DECLARE_OPERATORS_FOR_FLAGS(QCPPainter::PainterModes)
362 
363 
364 class QCP_LIB_DECL QCPLayer : public QObject
365 {
366  Q_OBJECT
368  Q_PROPERTY(QCustomPlot* parentPlot READ parentPlot)
369  Q_PROPERTY(QString name READ name)
370  Q_PROPERTY(int index READ index)
371  Q_PROPERTY(QList<QCPLayerable*> children READ children)
372  Q_PROPERTY(bool visible READ visible WRITE setVisible)
374 public:
375  QCPLayer(QCustomPlot* parentPlot, const QString &layerName);
376  ~QCPLayer();
377 
378  // getters:
379  QCustomPlot *parentPlot() const { return mParentPlot; }
380  QString name() const { return mName; }
381  int index() const { return mIndex; }
382  QList<QCPLayerable*> children() const { return mChildren; }
383  bool visible() const { return mVisible; }
384 
385  // setters:
386  void setVisible(bool visible);
387 
388 protected:
389  // property members:
391  QString mName;
392  int mIndex;
393  QList<QCPLayerable*> mChildren;
394  bool mVisible;
395 
396  // non-virtual methods:
397  void addChild(QCPLayerable *layerable, bool prepend);
398  void removeChild(QCPLayerable *layerable);
399 
400 private:
401  Q_DISABLE_COPY(QCPLayer)
402 
403  friend class QCustomPlot;
404  friend class QCPLayerable;
405 };
406 
407 class QCP_LIB_DECL QCPLayerable : public QObject
408 {
409  Q_OBJECT
411  Q_PROPERTY(bool visible READ visible WRITE setVisible)
412  Q_PROPERTY(QCustomPlot* parentPlot READ parentPlot)
413  Q_PROPERTY(QCPLayerable* parentLayerable READ parentLayerable)
414  Q_PROPERTY(QCPLayer* layer READ layer WRITE setLayer NOTIFY layerChanged)
415  Q_PROPERTY(bool antialiased READ antialiased WRITE setAntialiased)
417 public:
418  QCPLayerable(QCustomPlot *plot, QString targetLayer="", QCPLayerable *parentLayerable=0);
419  ~QCPLayerable();
420 
421  // getters:
422  bool visible() const { return mVisible; }
423  QCustomPlot *parentPlot() const { return mParentPlot; }
424  QCPLayerable *parentLayerable() const { return mParentLayerable.data(); }
425  QCPLayer *layer() const { return mLayer; }
426  bool antialiased() const { return mAntialiased; }
427 
428  // setters:
429  void setVisible(bool on);
430  Q_SLOT bool setLayer(QCPLayer *layer);
431  bool setLayer(const QString &layerName);
432  void setAntialiased(bool enabled);
433 
434  // introduced virtual methods:
435  virtual double selectTest(const QPointF &pos, bool onlySelectable, QVariant *details=0) const;
436 
437  // non-property methods:
438  bool realVisibility() const;
439 
440 signals:
441  void layerChanged(QCPLayer *newLayer);
442 
443 protected:
444  // property members:
445  bool mVisible;
447  QPointer<QCPLayerable> mParentLayerable;
450 
451  // introduced virtual methods:
452  virtual void parentPlotInitialized(QCustomPlot *parentPlot);
453  virtual QCP::Interaction selectionCategory() const;
454  virtual QRect clipRect() const;
455  virtual void applyDefaultAntialiasingHint(QCPPainter *painter) const = 0;
456  virtual void draw(QCPPainter *painter) = 0;
457  // events:
458  virtual void selectEvent(QMouseEvent *event, bool additive, const QVariant &details, bool *selectionStateChanged);
459  virtual void deselectEvent(bool *selectionStateChanged);
460 
461  // non-property methods:
462  void initializeParentPlot(QCustomPlot *parentPlot);
463  void setParentLayerable(QCPLayerable* parentLayerable);
464  bool moveToLayer(QCPLayer *layer, bool prepend);
465  void applyAntialiasingHint(QCPPainter *painter, bool localAntialiased, QCP::AntialiasedElement overrideElement) const;
466 
467 private:
468  Q_DISABLE_COPY(QCPLayerable)
469 
470  friend class QCustomPlot;
471  friend class QCPAxisRect;
472 };
473 
474 
476 {
477 public:
478  double lower, upper;
479 
480  QCPRange();
481  QCPRange(double lower, double upper);
482 
483  bool operator==(const QCPRange& other) { return lower == other.lower && upper == other.upper; }
484  bool operator!=(const QCPRange& other) { return !(*this == other); }
485 
486  QCPRange &operator+=(const double& value) { lower+=value; upper+=value; return *this; }
487  QCPRange &operator-=(const double& value) { lower-=value; upper-=value; return *this; }
488  QCPRange &operator*=(const double& value) { lower*=value; upper*=value; return *this; }
489  QCPRange &operator/=(const double& value) { lower/=value; upper/=value; return *this; }
490  friend inline const QCPRange operator+(const QCPRange&, double);
491  friend inline const QCPRange operator+(double, const QCPRange&);
492  friend inline const QCPRange operator-(const QCPRange& range, double value);
493  friend inline const QCPRange operator*(const QCPRange& range, double value);
494  friend inline const QCPRange operator*(double value, const QCPRange& range);
495  friend inline const QCPRange operator/(const QCPRange& range, double value);
496 
497  double size() const;
498  double center() const;
499  void normalize();
500  void expand(const QCPRange &otherRange);
501  QCPRange expanded(const QCPRange &otherRange) const;
502  QCPRange sanitizedForLogScale() const;
503  QCPRange sanitizedForLinScale() const;
504  bool contains(double value) const;
505 
506  static bool validRange(double lower, double upper);
507  static bool validRange(const QCPRange &range);
508  static const double minRange; //1e-280;
509  static const double maxRange; //1e280;
510 
511 };
512 Q_DECLARE_TYPEINFO(QCPRange, Q_MOVABLE_TYPE);
513 
514 /* documentation of inline functions */
515 
536 /* end documentation of inline functions */
537 
541 inline const QCPRange operator+(const QCPRange& range, double value)
542 {
543  QCPRange result(range);
544  result += value;
545  return result;
546 }
547 
551 inline const QCPRange operator+(double value, const QCPRange& range)
552 {
553  QCPRange result(range);
554  result += value;
555  return result;
556 }
557 
561 inline const QCPRange operator-(const QCPRange& range, double value)
562 {
563  QCPRange result(range);
564  result -= value;
565  return result;
566 }
567 
571 inline const QCPRange operator*(const QCPRange& range, double value)
572 {
573  QCPRange result(range);
574  result *= value;
575  return result;
576 }
577 
581 inline const QCPRange operator*(double value, const QCPRange& range)
582 {
583  QCPRange result(range);
584  result *= value;
585  return result;
586 }
587 
591 inline const QCPRange operator/(const QCPRange& range, double value)
592 {
593  QCPRange result(range);
594  result /= value;
595  return result;
596 }
597 
598 
599 class QCP_LIB_DECL QCPMarginGroup : public QObject
600 {
601  Q_OBJECT
602 public:
603  QCPMarginGroup(QCustomPlot *parentPlot);
604  ~QCPMarginGroup();
605 
606  // non-virtual methods:
607  QList<QCPLayoutElement*> elements(QCP::MarginSide side) const { return mChildren.value(side); }
608  bool isEmpty() const;
609  void clear();
610 
611 protected:
612  // non-property members:
614  QHash<QCP::MarginSide, QList<QCPLayoutElement*> > mChildren;
615 
616  // non-virtual methods:
617  int commonMargin(QCP::MarginSide side) const;
618  void addChild(QCP::MarginSide side, QCPLayoutElement *element);
619  void removeChild(QCP::MarginSide side, QCPLayoutElement *element);
620 
621 private:
622  Q_DISABLE_COPY(QCPMarginGroup)
623 
624  friend class QCPLayoutElement;
625 };
626 
627 
629 {
630  Q_OBJECT
632  Q_PROPERTY(QCPLayout* layout READ layout)
633  Q_PROPERTY(QRect rect READ rect)
634  Q_PROPERTY(QRect outerRect READ outerRect WRITE setOuterRect)
635  Q_PROPERTY(QMargins margins READ margins WRITE setMargins)
636  Q_PROPERTY(QMargins minimumMargins READ minimumMargins WRITE setMinimumMargins)
637  Q_PROPERTY(QSize minimumSize READ minimumSize WRITE setMinimumSize)
638  Q_PROPERTY(QSize maximumSize READ maximumSize WRITE setMaximumSize)
640 public:
645  enum UpdatePhase { upPreparation
646  ,upMargins
647  ,upLayout
648  };
649  Q_ENUMS(UpdatePhase)
650 
651  explicit QCPLayoutElement(QCustomPlot *parentPlot=0);
652  virtual ~QCPLayoutElement();
653 
654  // getters:
655  QCPLayout *layout() const { return mParentLayout; }
656  QRect rect() const { return mRect; }
657  QRect outerRect() const { return mOuterRect; }
658  QMargins margins() const { return mMargins; }
659  QMargins minimumMargins() const { return mMinimumMargins; }
660  QCP::MarginSides autoMargins() const { return mAutoMargins; }
661  QSize minimumSize() const { return mMinimumSize; }
662  QSize maximumSize() const { return mMaximumSize; }
663  QCPMarginGroup *marginGroup(QCP::MarginSide side) const { return mMarginGroups.value(side, (QCPMarginGroup*)0); }
664  QHash<QCP::MarginSide, QCPMarginGroup*> marginGroups() const { return mMarginGroups; }
665 
666  // setters:
667  void setOuterRect(const QRect &rect);
668  void setMargins(const QMargins &margins);
669  void setMinimumMargins(const QMargins &margins);
670  void setAutoMargins(QCP::MarginSides sides);
671  void setMinimumSize(const QSize &size);
672  void setMinimumSize(int width, int height);
673  void setMaximumSize(const QSize &size);
674  void setMaximumSize(int width, int height);
675  void setMarginGroup(QCP::MarginSides sides, QCPMarginGroup *group);
676 
677  // introduced virtual methods:
678  virtual void update(UpdatePhase phase);
679  virtual QSize minimumSizeHint() const;
680  virtual QSize maximumSizeHint() const;
681  virtual QList<QCPLayoutElement*> elements(bool recursive) const;
682 
683  // reimplemented virtual methods:
684  virtual double selectTest(const QPointF &pos, bool onlySelectable, QVariant *details=0) const;
685 
686 protected:
687  // property members:
689  QSize mMinimumSize, mMaximumSize;
690  QRect mRect, mOuterRect;
691  QMargins mMargins, mMinimumMargins;
692  QCP::MarginSides mAutoMargins;
693  QHash<QCP::MarginSide, QCPMarginGroup*> mMarginGroups;
694 
695  // introduced virtual methods:
696  virtual int calculateAutoMargin(QCP::MarginSide side);
697  // events:
698  virtual void mousePressEvent(QMouseEvent *event) {Q_UNUSED(event)}
699  virtual void mouseMoveEvent(QMouseEvent *event) {Q_UNUSED(event)}
700  virtual void mouseReleaseEvent(QMouseEvent *event) {Q_UNUSED(event)}
701  virtual void mouseDoubleClickEvent(QMouseEvent *event) {Q_UNUSED(event)}
702  virtual void wheelEvent(QWheelEvent *event) {Q_UNUSED(event)}
703 
704  // reimplemented virtual methods:
705  virtual void applyDefaultAntialiasingHint(QCPPainter *painter) const { Q_UNUSED(painter) }
706  virtual void draw(QCPPainter *painter) { Q_UNUSED(painter) }
707  virtual void parentPlotInitialized(QCustomPlot *parentPlot);
708 
709 private:
710  Q_DISABLE_COPY(QCPLayoutElement)
711 
712  friend class QCustomPlot;
713  friend class QCPLayout;
714  friend class QCPMarginGroup;
715 };
716 
717 
719 {
720  Q_OBJECT
721 public:
722  explicit QCPLayout();
723 
724  // reimplemented virtual methods:
725  virtual void update(UpdatePhase phase);
726  virtual QList<QCPLayoutElement*> elements(bool recursive) const;
727 
728  // introduced virtual methods:
729  virtual int elementCount() const = 0;
730  virtual QCPLayoutElement* elementAt(int index) const = 0;
731  virtual QCPLayoutElement* takeAt(int index) = 0;
732  virtual bool take(QCPLayoutElement* element) = 0;
733  virtual void simplify();
734 
735  // non-virtual methods:
736  bool removeAt(int index);
737  bool remove(QCPLayoutElement* element);
738  void clear();
739 
740 protected:
741  // introduced virtual methods:
742  virtual void updateLayout();
743 
744  // non-virtual methods:
745  void sizeConstraintsChanged() const;
746  void adoptElement(QCPLayoutElement *el);
747  void releaseElement(QCPLayoutElement *el);
748  QVector<int> getSectionSizes(QVector<int> maxSizes, QVector<int> minSizes, QVector<double> stretchFactors, int totalSize) const;
749 
750 private:
751  Q_DISABLE_COPY(QCPLayout)
752  friend class QCPLayoutElement;
753 };
754 
755 
757 {
758  Q_OBJECT
760  Q_PROPERTY(int rowCount READ rowCount)
761  Q_PROPERTY(int columnCount READ columnCount)
762  Q_PROPERTY(QList<double> columnStretchFactors READ columnStretchFactors WRITE setColumnStretchFactors)
763  Q_PROPERTY(QList<double> rowStretchFactors READ rowStretchFactors WRITE setRowStretchFactors)
764  Q_PROPERTY(int columnSpacing READ columnSpacing WRITE setColumnSpacing)
765  Q_PROPERTY(int rowSpacing READ rowSpacing WRITE setRowSpacing)
767 public:
768  explicit QCPLayoutGrid();
769  virtual ~QCPLayoutGrid();
770 
771  // getters:
772  int rowCount() const;
773  int columnCount() const;
774  QList<double> columnStretchFactors() const { return mColumnStretchFactors; }
775  QList<double> rowStretchFactors() const { return mRowStretchFactors; }
776  int columnSpacing() const { return mColumnSpacing; }
777  int rowSpacing() const { return mRowSpacing; }
778 
779  // setters:
780  void setColumnStretchFactor(int column, double factor);
781  void setColumnStretchFactors(const QList<double> &factors);
782  void setRowStretchFactor(int row, double factor);
783  void setRowStretchFactors(const QList<double> &factors);
784  void setColumnSpacing(int pixels);
785  void setRowSpacing(int pixels);
786 
787  // reimplemented virtual methods:
788  virtual void updateLayout();
789  virtual int elementCount() const;
790  virtual QCPLayoutElement* elementAt(int index) const;
791  virtual QCPLayoutElement* takeAt(int index);
792  virtual bool take(QCPLayoutElement* element);
793  virtual QList<QCPLayoutElement*> elements(bool recursive) const;
794  virtual void simplify();
795  virtual QSize minimumSizeHint() const;
796  virtual QSize maximumSizeHint() const;
797 
798  // non-virtual methods:
799  QCPLayoutElement *element(int row, int column) const;
800  bool addElement(int row, int column, QCPLayoutElement *element);
801  bool hasElement(int row, int column);
802  void expandTo(int newRowCount, int newColumnCount);
803  void insertRow(int newIndex);
804  void insertColumn(int newIndex);
805 
806 protected:
807  // property members:
808  QList<QList<QCPLayoutElement*> > mElements;
809  QList<double> mColumnStretchFactors;
810  QList<double> mRowStretchFactors;
811  int mColumnSpacing, mRowSpacing;
812 
813  // non-virtual methods:
814  void getMinimumRowColSizes(QVector<int> *minColWidths, QVector<int> *minRowHeights) const;
815  void getMaximumRowColSizes(QVector<int> *maxColWidths, QVector<int> *maxRowHeights) const;
816 
817 private:
818  Q_DISABLE_COPY(QCPLayoutGrid)
819 };
820 
821 
823 {
824  Q_OBJECT
825 public:
829  enum InsetPlacement { ipFree
830  ,ipBorderAligned
831  };
832 
833  explicit QCPLayoutInset();
834  virtual ~QCPLayoutInset();
835 
836  // getters:
837  InsetPlacement insetPlacement(int index) const;
838  Qt::Alignment insetAlignment(int index) const;
839  QRectF insetRect(int index) const;
840 
841  // setters:
842  void setInsetPlacement(int index, InsetPlacement placement);
843  void setInsetAlignment(int index, Qt::Alignment alignment);
844  void setInsetRect(int index, const QRectF &rect);
845 
846  // reimplemented virtual methods:
847  virtual void updateLayout();
848  virtual int elementCount() const;
849  virtual QCPLayoutElement* elementAt(int index) const;
850  virtual QCPLayoutElement* takeAt(int index);
851  virtual bool take(QCPLayoutElement* element);
852  virtual void simplify() {}
853  virtual double selectTest(const QPointF &pos, bool onlySelectable, QVariant *details=0) const;
854 
855  // non-virtual methods:
856  void addElement(QCPLayoutElement *element, Qt::Alignment alignment);
857  void addElement(QCPLayoutElement *element, const QRectF &rect);
858 
859 protected:
860  // property members:
861  QList<QCPLayoutElement*> mElements;
862  QList<InsetPlacement> mInsetPlacement;
863  QList<Qt::Alignment> mInsetAlignment;
864  QList<QRectF> mInsetRect;
865 
866 private:
867  Q_DISABLE_COPY(QCPLayoutInset)
868 };
869 
870 
872 {
873  Q_GADGET
874 public:
886  Q_ENUMS(EndingStyle)
887  enum EndingStyle { esNone
888  ,esFlatArrow
889  ,esSpikeArrow
890  ,esLineArrow
891  ,esDisc
892  ,esSquare
893  ,esDiamond
894  ,esBar
895  ,esHalfBar
896  ,esSkewedBar
897  };
898 
899  QCPLineEnding();
900  QCPLineEnding(EndingStyle style, double width=8, double length=10, bool inverted=false);
901 
902  // getters:
903  EndingStyle style() const { return mStyle; }
904  double width() const { return mWidth; }
905  double length() const { return mLength; }
906  bool inverted() const { return mInverted; }
907 
908  // setters:
909  void setStyle(EndingStyle style);
910  void setWidth(double width);
911  void setLength(double length);
912  void setInverted(bool inverted);
913 
914  // non-property methods:
915  double boundingDistance() const;
916  double realLength() const;
917  void draw(QCPPainter *painter, const QVector2D &pos, const QVector2D &dir) const;
918  void draw(QCPPainter *painter, const QVector2D &pos, double angle) const;
919 
920 protected:
921  // property members:
923  double mWidth, mLength;
924  bool mInverted;
925 };
927 
928 
930 {
931  Q_OBJECT
933  Q_PROPERTY(bool subGridVisible READ subGridVisible WRITE setSubGridVisible)
934  Q_PROPERTY(bool antialiasedSubGrid READ antialiasedSubGrid WRITE setAntialiasedSubGrid)
935  Q_PROPERTY(bool antialiasedZeroLine READ antialiasedZeroLine WRITE setAntialiasedZeroLine)
936  Q_PROPERTY(QPen pen READ pen WRITE setPen)
937  Q_PROPERTY(QPen subGridPen READ subGridPen WRITE setSubGridPen)
938  Q_PROPERTY(QPen zeroLinePen READ zeroLinePen WRITE setZeroLinePen)
940 public:
941  QCPGrid(QCPAxis *parentAxis);
942 
943  // getters:
944  bool subGridVisible() const { return mSubGridVisible; }
945  bool antialiasedSubGrid() const { return mAntialiasedSubGrid; }
946  bool antialiasedZeroLine() const { return mAntialiasedZeroLine; }
947  QPen pen() const { return mPen; }
948  QPen subGridPen() const { return mSubGridPen; }
949  QPen zeroLinePen() const { return mZeroLinePen; }
950 
951  // setters:
952  void setSubGridVisible(bool visible);
953  void setAntialiasedSubGrid(bool enabled);
954  void setAntialiasedZeroLine(bool enabled);
955  void setPen(const QPen &pen);
956  void setSubGridPen(const QPen &pen);
957  void setZeroLinePen(const QPen &pen);
958 
959 protected:
960  // property members:
962  bool mAntialiasedSubGrid, mAntialiasedZeroLine;
963  QPen mPen, mSubGridPen, mZeroLinePen;
964  // non-property members:
966 
967  // reimplemented virtual methods:
968  virtual void applyDefaultAntialiasingHint(QCPPainter *painter) const;
969  virtual void draw(QCPPainter *painter);
970 
971  // non-virtual methods:
972  void drawGridLines(QCPPainter *painter) const;
973  void drawSubGridLines(QCPPainter *painter) const;
974 
975  friend class QCPAxis;
976 };
977 
978 
980 {
981  Q_OBJECT
983  Q_PROPERTY(AxisType axisType READ axisType)
984  Q_PROPERTY(QCPAxisRect* axisRect READ axisRect)
985  Q_PROPERTY(ScaleType scaleType READ scaleType WRITE setScaleType NOTIFY scaleTypeChanged)
986  Q_PROPERTY(double scaleLogBase READ scaleLogBase WRITE setScaleLogBase)
987  Q_PROPERTY(QCPRange range READ range WRITE setRange NOTIFY rangeChanged)
988  Q_PROPERTY(bool rangeReversed READ rangeReversed WRITE setRangeReversed)
989  Q_PROPERTY(bool autoTicks READ autoTicks WRITE setAutoTicks)
990  Q_PROPERTY(int autoTickCount READ autoTickCount WRITE setAutoTickCount)
991  Q_PROPERTY(bool autoTickLabels READ autoTickLabels WRITE setAutoTickLabels)
992  Q_PROPERTY(bool autoTickStep READ autoTickStep WRITE setAutoTickStep)
993  Q_PROPERTY(bool autoSubTicks READ autoSubTicks WRITE setAutoSubTicks)
994  Q_PROPERTY(bool ticks READ ticks WRITE setTicks)
995  Q_PROPERTY(bool tickLabels READ tickLabels WRITE setTickLabels)
996  Q_PROPERTY(int tickLabelPadding READ tickLabelPadding WRITE setTickLabelPadding)
997  Q_PROPERTY(LabelType tickLabelType READ tickLabelType WRITE setTickLabelType)
998  Q_PROPERTY(QFont tickLabelFont READ tickLabelFont WRITE setTickLabelFont)
999  Q_PROPERTY(QColor tickLabelColor READ tickLabelColor WRITE setTickLabelColor)
1000  Q_PROPERTY(double tickLabelRotation READ tickLabelRotation WRITE setTickLabelRotation)
1001  Q_PROPERTY(QString dateTimeFormat READ dateTimeFormat WRITE setDateTimeFormat)
1002  Q_PROPERTY(Qt::TimeSpec dateTimeSpec READ dateTimeSpec WRITE setDateTimeSpec)
1003  Q_PROPERTY(QString numberFormat READ numberFormat WRITE setNumberFormat)
1004  Q_PROPERTY(int numberPrecision READ numberPrecision WRITE setNumberPrecision)
1005  Q_PROPERTY(double tickStep READ tickStep WRITE setTickStep)
1006  Q_PROPERTY(QVector<double> tickVector READ tickVector WRITE setTickVector)
1007  Q_PROPERTY(QVector<QString> tickVectorLabels READ tickVectorLabels WRITE setTickVectorLabels)
1008  Q_PROPERTY(int tickLengthIn READ tickLengthIn WRITE setTickLengthIn)
1009  Q_PROPERTY(int tickLengthOut READ tickLengthOut WRITE setTickLengthOut)
1010  Q_PROPERTY(int subTickCount READ subTickCount WRITE setSubTickCount)
1011  Q_PROPERTY(int subTickLengthIn READ subTickLengthIn WRITE setSubTickLengthIn)
1012  Q_PROPERTY(int subTickLengthOut READ subTickLengthOut WRITE setSubTickLengthOut)
1013  Q_PROPERTY(QPen basePen READ basePen WRITE setBasePen)
1014  Q_PROPERTY(QPen tickPen READ tickPen WRITE setTickPen)
1015  Q_PROPERTY(QPen subTickPen READ subTickPen WRITE setSubTickPen)
1016  Q_PROPERTY(QFont labelFont READ labelFont WRITE setLabelFont)
1017  Q_PROPERTY(QColor labelColor READ labelColor WRITE setLabelColor)
1018  Q_PROPERTY(QString label READ label WRITE setLabel)
1019  Q_PROPERTY(int labelPadding READ labelPadding WRITE setLabelPadding)
1020  Q_PROPERTY(int padding READ padding WRITE setPadding)
1021  Q_PROPERTY(int offset READ offset WRITE setOffset)
1022  Q_PROPERTY(SelectableParts selectedParts READ selectedParts WRITE setSelectedParts NOTIFY selectionChanged)
1023  Q_PROPERTY(SelectableParts selectableParts READ selectableParts WRITE setSelectableParts NOTIFY selectableChanged)
1024  Q_PROPERTY(QFont selectedTickLabelFont READ selectedTickLabelFont WRITE setSelectedTickLabelFont)
1025  Q_PROPERTY(QFont selectedLabelFont READ selectedLabelFont WRITE setSelectedLabelFont)
1026  Q_PROPERTY(QColor selectedTickLabelColor READ selectedTickLabelColor WRITE setSelectedTickLabelColor)
1027  Q_PROPERTY(QColor selectedLabelColor READ selectedLabelColor WRITE setSelectedLabelColor)
1028  Q_PROPERTY(QPen selectedBasePen READ selectedBasePen WRITE setSelectedBasePen)
1029  Q_PROPERTY(QPen selectedTickPen READ selectedTickPen WRITE setSelectedTickPen)
1030  Q_PROPERTY(QPen selectedSubTickPen READ selectedSubTickPen WRITE setSelectedSubTickPen)
1031  Q_PROPERTY(QCPLineEnding lowerEnding READ lowerEnding WRITE setLowerEnding)
1032  Q_PROPERTY(QCPLineEnding upperEnding READ upperEnding WRITE setUpperEnding)
1033  Q_PROPERTY(QCPGrid* grid READ grid)
1035 public:
1040  enum AxisType { atLeft = 0x01
1041  ,atRight = 0x02
1042  ,atTop = 0x04
1043  ,atBottom = 0x08
1044  };
1045  Q_FLAGS(AxisType AxisTypes)
1046  Q_DECLARE_FLAGS(AxisTypes, AxisType)
1053  enum LabelType { ltNumber
1054  ,ltDateTime
1055  };
1056  Q_ENUMS(LabelType)
1061  enum ScaleType { stLinear
1062  ,stLogarithmic
1063  };
1064  Q_ENUMS(ScaleType)
1069  enum SelectablePart { spNone = 0
1070  ,spAxis = 0x001
1071  ,spTickLabels = 0x002
1072  ,spAxisLabel = 0x004
1073  };
1074  Q_FLAGS(SelectablePart SelectableParts)
1075  Q_DECLARE_FLAGS(SelectableParts, SelectablePart)
1076 
1077  explicit QCPAxis(QCPAxisRect *parent, AxisType type);
1078  virtual ~QCPAxis();
1079 
1080  // getters:
1081  AxisType axisType() const { return mAxisType; }
1082  QCPAxisRect *axisRect() const { return mAxisRect; }
1083  ScaleType scaleType() const { return mScaleType; }
1084  double scaleLogBase() const { return mScaleLogBase; }
1085  const QCPRange range() const { return mRange; }
1086  bool rangeReversed() const { return mRangeReversed; }
1087  bool autoTicks() const { return mAutoTicks; }
1088  int autoTickCount() const { return mAutoTickCount; }
1089  bool autoTickLabels() const { return mAutoTickLabels; }
1090  bool autoTickStep() const { return mAutoTickStep; }
1091  bool autoSubTicks() const { return mAutoSubTicks; }
1092  bool ticks() const { return mTicks; }
1093  bool tickLabels() const { return mTickLabels; }
1094  int tickLabelPadding() const;
1095  LabelType tickLabelType() const { return mTickLabelType; }
1096  QFont tickLabelFont() const { return mTickLabelFont; }
1097  QColor tickLabelColor() const { return mTickLabelColor; }
1098  double tickLabelRotation() const;
1099  QString dateTimeFormat() const { return mDateTimeFormat; }
1100  Qt::TimeSpec dateTimeSpec() const { return mDateTimeSpec; }
1101  QString numberFormat() const;
1102  int numberPrecision() const { return mNumberPrecision; }
1103  double tickStep() const { return mTickStep; }
1104  QVector<double> tickVector() const { return mTickVector; }
1105  QVector<QString> tickVectorLabels() const { return mTickVectorLabels; }
1106  int tickLengthIn() const;
1107  int tickLengthOut() const;
1108  int subTickCount() const { return mSubTickCount; }
1109  int subTickLengthIn() const;
1110  int subTickLengthOut() const;
1111  QPen basePen() const { return mBasePen; }
1112  QPen tickPen() const { return mTickPen; }
1113  QPen subTickPen() const { return mSubTickPen; }
1114  QFont labelFont() const { return mLabelFont; }
1115  QColor labelColor() const { return mLabelColor; }
1116  QString label() const { return mLabel; }
1117  int labelPadding() const;
1118  int padding() const { return mPadding; }
1119  int offset() const;
1120  SelectableParts selectedParts() const { return mSelectedParts; }
1121  SelectableParts selectableParts() const { return mSelectableParts; }
1122  QFont selectedTickLabelFont() const { return mSelectedTickLabelFont; }
1123  QFont selectedLabelFont() const { return mSelectedLabelFont; }
1124  QColor selectedTickLabelColor() const { return mSelectedTickLabelColor; }
1125  QColor selectedLabelColor() const { return mSelectedLabelColor; }
1126  QPen selectedBasePen() const { return mSelectedBasePen; }
1127  QPen selectedTickPen() const { return mSelectedTickPen; }
1128  QPen selectedSubTickPen() const { return mSelectedSubTickPen; }
1129  QCPLineEnding lowerEnding() const;
1130  QCPLineEnding upperEnding() const;
1131  QCPGrid *grid() const { return mGrid; }
1132 
1133  // setters:
1134  Q_SLOT void setScaleType(QCPAxis::ScaleType type);
1135  void setScaleLogBase(double base);
1136  Q_SLOT void setRange(const QCPRange &range);
1137  void setRange(double lower, double upper);
1138  void setRange(double position, double size, Qt::AlignmentFlag alignment);
1139  void setRangeLower(double lower);
1140  void setRangeUpper(double upper);
1141  void setRangeReversed(bool reversed);
1142  void setAutoTicks(bool on);
1143  void setAutoTickCount(int approximateCount);
1144  void setAutoTickLabels(bool on);
1145  void setAutoTickStep(bool on);
1146  void setAutoSubTicks(bool on);
1147  void setTicks(bool show);
1148  void setTickLabels(bool show);
1149  void setTickLabelPadding(int padding);
1150  void setTickLabelType(LabelType type);
1151  void setTickLabelFont(const QFont &font);
1152  void setTickLabelColor(const QColor &color);
1153  void setTickLabelRotation(double degrees);
1154  void setDateTimeFormat(const QString &format);
1155  void setDateTimeSpec(const Qt::TimeSpec &timeSpec);
1156  void setNumberFormat(const QString &formatCode);
1157  void setNumberPrecision(int precision);
1158  void setTickStep(double step);
1159  void setTickVector(const QVector<double> &vec);
1160  void setTickVectorLabels(const QVector<QString> &vec);
1161  void setTickLength(int inside, int outside=0);
1162  void setTickLengthIn(int inside);
1163  void setTickLengthOut(int outside);
1164  void setSubTickCount(int count);
1165  void setSubTickLength(int inside, int outside=0);
1166  void setSubTickLengthIn(int inside);
1167  void setSubTickLengthOut(int outside);
1168  void setBasePen(const QPen &pen);
1169  void setTickPen(const QPen &pen);
1170  void setSubTickPen(const QPen &pen);
1171  void setLabelFont(const QFont &font);
1172  void setLabelColor(const QColor &color);
1173  void setLabel(const QString &str);
1174  void setLabelPadding(int padding);
1175  void setPadding(int padding);
1176  void setOffset(int offset);
1177  void setSelectedTickLabelFont(const QFont &font);
1178  void setSelectedLabelFont(const QFont &font);
1179  void setSelectedTickLabelColor(const QColor &color);
1180  void setSelectedLabelColor(const QColor &color);
1181  void setSelectedBasePen(const QPen &pen);
1182  void setSelectedTickPen(const QPen &pen);
1183  void setSelectedSubTickPen(const QPen &pen);
1184  Q_SLOT void setSelectableParts(const QCPAxis::SelectableParts &selectableParts);
1185  Q_SLOT void setSelectedParts(const QCPAxis::SelectableParts &selectedParts);
1186  void setLowerEnding(const QCPLineEnding &ending);
1187  void setUpperEnding(const QCPLineEnding &ending);
1188 
1189  // reimplemented virtual methods:
1190  virtual double selectTest(const QPointF &pos, bool onlySelectable, QVariant *details=0) const;
1191 
1192  // non-property methods:
1193  Qt::Orientation orientation() const { return mOrientation; }
1194  void moveRange(double diff);
1195  void scaleRange(double factor, double center);
1196  void setScaleRatio(const QCPAxis *otherAxis, double ratio=1.0);
1197  void rescale(bool onlyVisiblePlottables=false);
1198  double pixelToCoord(double value) const;
1199  double coordToPixel(double value) const;
1200  SelectablePart getPartAt(const QPointF &pos) const;
1201  QList<QCPAbstractPlottable*> plottables() const;
1202  QList<QCPGraph*> graphs() const;
1203  QList<QCPAbstractItem*> items() const;
1204 
1205  static AxisType marginSideToAxisType(QCP::MarginSide side);
1206  static Qt::Orientation orientation(AxisType type) { return type==atBottom||type==atTop ? Qt::Horizontal : Qt::Vertical; }
1207  static AxisType opposite(AxisType type);
1208 
1209 signals:
1211  void rangeChanged(const QCPRange &newRange);
1212  void rangeChanged(const QCPRange &newRange, const QCPRange &oldRange);
1214  void selectionChanged(const QCPAxis::SelectableParts &parts);
1215  void selectableChanged(const QCPAxis::SelectableParts &parts);
1216 
1217 protected:
1218  // property members:
1219  // axis base:
1222  //int mOffset; // in QCPAxisPainter
1224  Qt::Orientation mOrientation;
1225  SelectableParts mSelectableParts, mSelectedParts;
1226  QPen mBasePen, mSelectedBasePen;
1227  //QCPLineEnding mLowerEnding, mUpperEnding; // in QCPAxisPainter
1228  // axis label:
1229  //int mLabelPadding; // in QCPAxisPainter
1230  QString mLabel;
1231  QFont mLabelFont, mSelectedLabelFont;
1232  QColor mLabelColor, mSelectedLabelColor;
1233  // tick labels:
1234  //int mTickLabelPadding; // in QCPAxisPainter
1235  bool mTickLabels, mAutoTickLabels;
1236  //double mTickLabelRotation; // in QCPAxisPainter
1238  QFont mTickLabelFont, mSelectedTickLabelFont;
1239  QColor mTickLabelColor, mSelectedTickLabelColor;
1241  Qt::TimeSpec mDateTimeSpec;
1245  //bool mNumberMultiplyCross; // QCPAxisPainter
1246  // ticks and subticks:
1247  bool mTicks;
1248  double mTickStep;
1249  int mSubTickCount, mAutoTickCount;
1250  bool mAutoTicks, mAutoTickStep, mAutoSubTicks;
1251  //int mTickLengthIn, mTickLengthOut, mSubTickLengthIn, mSubTickLengthOut; // QCPAxisPainter
1252  QPen mTickPen, mSelectedTickPen;
1253  QPen mSubTickPen, mSelectedSubTickPen;
1254  // scale and range:
1258  double mScaleLogBase, mScaleLogBaseLogInv;
1259 
1260  // non-property members:
1263  int mLowestVisibleTick, mHighestVisibleTick;
1264  QVector<double> mTickVector;
1265  QVector<QString> mTickVectorLabels;
1266  QVector<double> mSubTickVector;
1269 
1270  // introduced virtual methods:
1271  virtual void setupTickVectors();
1272  virtual void generateAutoTicks();
1273  virtual int calculateAutoSubTickCount(double tickStep) const;
1274  virtual int calculateMargin();
1275 
1276  // reimplemented virtual methods:
1277  virtual void applyDefaultAntialiasingHint(QCPPainter *painter) const;
1278  virtual void draw(QCPPainter *painter);
1279  virtual QCP::Interaction selectionCategory() const;
1280  // events:
1281  virtual void selectEvent(QMouseEvent *event, bool additive, const QVariant &details, bool *selectionStateChanged);
1282  virtual void deselectEvent(bool *selectionStateChanged);
1283 
1284  // non-virtual methods:
1285  void visibleTickBounds(int &lowIndex, int &highIndex) const;
1286  double baseLog(double value) const;
1287  double basePow(double value) const;
1288  QPen getBasePen() const;
1289  QPen getTickPen() const;
1290  QPen getSubTickPen() const;
1291  QFont getTickLabelFont() const;
1292  QFont getLabelFont() const;
1293  QColor getTickLabelColor() const;
1294  QColor getLabelColor() const;
1295 
1296 private:
1297  Q_DISABLE_COPY(QCPAxis)
1298 
1299  friend class QCustomPlot;
1300  friend class QCPGrid;
1301  friend class QCPAxisRect;
1302 };
1303 Q_DECLARE_OPERATORS_FOR_FLAGS(QCPAxis::SelectableParts)
1304 Q_DECLARE_OPERATORS_FOR_FLAGS(QCPAxis::AxisTypes)
1305 Q_DECLARE_METATYPE(QCPAxis::SelectablePart)
1306 
1307 
1309 {
1310 public:
1311  explicit QCPAxisPainterPrivate(QCustomPlot *parentPlot);
1312  virtual ~QCPAxisPainterPrivate();
1313 
1314  virtual void draw(QCPPainter *painter);
1315  virtual int size() const;
1316  void clearCache();
1317 
1318  QRect axisSelectionBox() const { return mAxisSelectionBox; }
1319  QRect tickLabelsSelectionBox() const { return mTickLabelsSelectionBox; }
1320  QRect labelSelectionBox() const { return mLabelSelectionBox; }
1321 
1322  // public property members:
1324  QPen basePen;
1325  QCPLineEnding lowerEnding, upperEnding; // directly accessed by QCPAxis setters/getters
1326  int labelPadding; // directly accessed by QCPAxis setters/getters
1327  QFont labelFont;
1328  QColor labelColor;
1329  QString label;
1330  int tickLabelPadding; // directly accessed by QCPAxis setters/getters
1331  double tickLabelRotation; // directly accessed by QCPAxis setters/getters
1333  bool numberMultiplyCross; // directly accessed by QCPAxis setters/getters
1334  int tickLengthIn, tickLengthOut, subTickLengthIn, subTickLengthOut; // directly accessed by QCPAxis setters/getters
1335  QPen tickPen, subTickPen;
1338  QRect alignmentRect, viewportRect;
1339  double offset; // directly accessed by QCPAxis setters/getters
1342 
1343  QVector<double> subTickPositions;
1344  QVector<double> tickPositions;
1345  QVector<QString> tickLabels;
1346 
1347 protected:
1349  {
1350  QPointF offset;
1351  QPixmap pixmap;
1352  };
1354  {
1355  QString basePart, expPart;
1356  QRect baseBounds, expBounds, totalBounds, rotatedTotalBounds;
1357  QFont baseFont, expFont;
1358  };
1360  QByteArray mLabelParameterHash; // to determine whether mLabelCache needs to be cleared due to changed parameters
1361  QCache<QString, CachedLabel> mLabelCache;
1362  QRect mAxisSelectionBox, mTickLabelsSelectionBox, mLabelSelectionBox;
1363 
1364  virtual QByteArray generateLabelParameterHash() const;
1365 
1366  virtual void placeTickLabel(QCPPainter *painter, double position, int distanceToAxis, const QString &text, QSize *tickLabelsSize);
1367  virtual void drawTickLabel(QCPPainter *painter, double x, double y, const TickLabelData &labelData) const;
1368  virtual TickLabelData getTickLabelData(const QFont &font, const QString &text) const;
1369  virtual QPointF getTickLabelDrawOffset(const TickLabelData &labelData) const;
1370  virtual void getMaxTickLabelSize(const QFont &font, const QString &text, QSize *tickLabelsSize) const;
1371 };
1372 
1373 
1375 {
1376  Q_OBJECT
1378  Q_PROPERTY(QString name READ name WRITE setName)
1379  Q_PROPERTY(bool antialiasedFill READ antialiasedFill WRITE setAntialiasedFill)
1380  Q_PROPERTY(bool antialiasedScatters READ antialiasedScatters WRITE setAntialiasedScatters)
1381  Q_PROPERTY(bool antialiasedErrorBars READ antialiasedErrorBars WRITE setAntialiasedErrorBars)
1382  Q_PROPERTY(QPen pen READ pen WRITE setPen)
1383  Q_PROPERTY(QPen selectedPen READ selectedPen WRITE setSelectedPen)
1384  Q_PROPERTY(QBrush brush READ brush WRITE setBrush)
1385  Q_PROPERTY(QBrush selectedBrush READ selectedBrush WRITE setSelectedBrush)
1386  Q_PROPERTY(QCPAxis* keyAxis READ keyAxis WRITE setKeyAxis)
1387  Q_PROPERTY(QCPAxis* valueAxis READ valueAxis WRITE setValueAxis)
1388  Q_PROPERTY(bool selectable READ selectable WRITE setSelectable NOTIFY selectableChanged)
1389  Q_PROPERTY(bool selected READ selected WRITE setSelected NOTIFY selectionChanged)
1391 public:
1392  QCPAbstractPlottable(QCPAxis *keyAxis, QCPAxis *valueAxis);
1393 
1394  // getters:
1395  QString name() const { return mName; }
1396  bool antialiasedFill() const { return mAntialiasedFill; }
1397  bool antialiasedScatters() const { return mAntialiasedScatters; }
1398  bool antialiasedErrorBars() const { return mAntialiasedErrorBars; }
1399  QPen pen() const { return mPen; }
1400  QPen selectedPen() const { return mSelectedPen; }
1401  QBrush brush() const { return mBrush; }
1402  QBrush selectedBrush() const { return mSelectedBrush; }
1403  QCPAxis *keyAxis() const { return mKeyAxis.data(); }
1404  QCPAxis *valueAxis() const { return mValueAxis.data(); }
1405  bool selectable() const { return mSelectable; }
1406  bool selected() const { return mSelected; }
1407 
1408  // setters:
1409  void setName(const QString &name);
1410  void setAntialiasedFill(bool enabled);
1411  void setAntialiasedScatters(bool enabled);
1412  void setAntialiasedErrorBars(bool enabled);
1413  void setPen(const QPen &pen);
1414  void setSelectedPen(const QPen &pen);
1415  void setBrush(const QBrush &brush);
1416  void setSelectedBrush(const QBrush &brush);
1417  void setKeyAxis(QCPAxis *axis);
1418  void setValueAxis(QCPAxis *axis);
1419  Q_SLOT void setSelectable(bool selectable);
1420  Q_SLOT void setSelected(bool selected);
1421 
1422  // introduced virtual methods:
1423  virtual void clearData() = 0;
1424  virtual double selectTest(const QPointF &pos, bool onlySelectable, QVariant *details=0) const = 0;
1425  virtual bool addToLegend();
1426  virtual bool removeFromLegend() const;
1427 
1428  // non-property methods:
1429  void rescaleAxes(bool onlyEnlarge=false) const;
1430  void rescaleKeyAxis(bool onlyEnlarge=false) const;
1431  void rescaleValueAxis(bool onlyEnlarge=false) const;
1432 
1433 signals:
1434  void selectionChanged(bool selected);
1435  void selectableChanged(bool selectable);
1436 
1437 protected:
1441  enum SignDomain { sdNegative
1442  ,sdBoth
1443  ,sdPositive
1444  };
1445 
1446  // property members:
1447  QString mName;
1448  bool mAntialiasedFill, mAntialiasedScatters, mAntialiasedErrorBars;
1449  QPen mPen, mSelectedPen;
1450  QBrush mBrush, mSelectedBrush;
1451  QPointer<QCPAxis> mKeyAxis, mValueAxis;
1452  bool mSelectable, mSelected;
1453 
1454  // reimplemented virtual methods:
1455  virtual QRect clipRect() const;
1456  virtual void draw(QCPPainter *painter) = 0;
1457  virtual QCP::Interaction selectionCategory() const;
1458  void applyDefaultAntialiasingHint(QCPPainter *painter) const;
1459  // events:
1460  virtual void selectEvent(QMouseEvent *event, bool additive, const QVariant &details, bool *selectionStateChanged);
1461  virtual void deselectEvent(bool *selectionStateChanged);
1462 
1463  // introduced virtual methods:
1464  virtual void drawLegendIcon(QCPPainter *painter, const QRectF &rect) const = 0;
1465  virtual QCPRange getKeyRange(bool &foundRange, SignDomain inSignDomain=sdBoth) const = 0;
1466  virtual QCPRange getValueRange(bool &foundRange, SignDomain inSignDomain=sdBoth) const = 0;
1467 
1468  // non-virtual methods:
1469  void coordsToPixels(double key, double value, double &x, double &y) const;
1470  const QPointF coordsToPixels(double key, double value) const;
1471  void pixelsToCoords(double x, double y, double &key, double &value) const;
1472  void pixelsToCoords(const QPointF &pixelPos, double &key, double &value) const;
1473  QPen mainPen() const;
1474  QBrush mainBrush() const;
1475  void applyFillAntialiasingHint(QCPPainter *painter) const;
1476  void applyScattersAntialiasingHint(QCPPainter *painter) const;
1477  void applyErrorBarsAntialiasingHint(QCPPainter *painter) const;
1478  double distSqrToLine(const QPointF &start, const QPointF &end, const QPointF &point) const;
1479 
1480 private:
1481  Q_DISABLE_COPY(QCPAbstractPlottable)
1482 
1483  friend class QCustomPlot;
1484  friend class QCPAxis;
1486 };
1487 
1488 
1490 {
1491 public:
1492  QCPItemAnchor(QCustomPlot *parentPlot, QCPAbstractItem *parentItem, const QString name, int anchorId=-1);
1493  virtual ~QCPItemAnchor();
1494 
1495  // getters:
1496  QString name() const { return mName; }
1497  virtual QPointF pixelPoint() const;
1498 
1499 protected:
1500  // property members:
1501  QString mName;
1502 
1503  // non-property members:
1507  QSet<QCPItemPosition*> mChildren;
1508 
1509  // introduced virtual methods:
1510  virtual QCPItemPosition *toQCPItemPosition() { return 0; }
1511 
1512  // non-virtual methods:
1513  void addChild(QCPItemPosition* pos); // called from pos when this anchor is set as parent
1514  void removeChild(QCPItemPosition *pos); // called from pos when its parent anchor is reset or pos deleted
1515 
1516 private:
1517  Q_DISABLE_COPY(QCPItemAnchor)
1518 
1519  friend class QCPItemPosition;
1520 };
1521 
1522 
1523 
1525 {
1526 public:
1533  enum PositionType { ptAbsolute
1534  ,ptViewportRatio
1537  ,ptAxisRectRatio
1540  ,ptPlotCoords
1541  };
1542 
1543  QCPItemPosition(QCustomPlot *parentPlot, QCPAbstractItem *parentItem, const QString name);
1544  virtual ~QCPItemPosition();
1545 
1546  // getters:
1547  PositionType type() const { return mPositionType; }
1548  QCPItemAnchor *parentAnchor() const { return mParentAnchor; }
1549  double key() const { return mKey; }
1550  double value() const { return mValue; }
1551  QPointF coords() const { return QPointF(mKey, mValue); }
1552  QCPAxis *keyAxis() const { return mKeyAxis.data(); }
1553  QCPAxis *valueAxis() const { return mValueAxis.data(); }
1554  QCPAxisRect *axisRect() const;
1555  virtual QPointF pixelPoint() const;
1556 
1557  // setters:
1558  void setType(PositionType type);
1559  bool setParentAnchor(QCPItemAnchor *parentAnchor, bool keepPixelPosition=false);
1560  void setCoords(double key, double value);
1561  void setCoords(const QPointF &coords);
1562  void setAxes(QCPAxis* keyAxis, QCPAxis* valueAxis);
1563  void setAxisRect(QCPAxisRect *axisRect);
1564  void setPixelPoint(const QPointF &pixelPoint);
1565 
1566 protected:
1567  // property members:
1569  QPointer<QCPAxis> mKeyAxis, mValueAxis;
1570  QPointer<QCPAxisRect> mAxisRect;
1571  double mKey, mValue;
1573 
1574  // reimplemented virtual methods:
1575  virtual QCPItemPosition *toQCPItemPosition() { return this; }
1576 
1577 private:
1578  Q_DISABLE_COPY(QCPItemPosition)
1579 
1580 };
1581 
1582 
1584 {
1585  Q_OBJECT
1587  Q_PROPERTY(bool clipToAxisRect READ clipToAxisRect WRITE setClipToAxisRect)
1588  Q_PROPERTY(QCPAxisRect* clipAxisRect READ clipAxisRect WRITE setClipAxisRect)
1589  Q_PROPERTY(bool selectable READ selectable WRITE setSelectable NOTIFY selectableChanged)
1590  Q_PROPERTY(bool selected READ selected WRITE setSelected NOTIFY selectionChanged)
1592 public:
1593  QCPAbstractItem(QCustomPlot *parentPlot);
1594  virtual ~QCPAbstractItem();
1595 
1596  // getters:
1597  bool clipToAxisRect() const { return mClipToAxisRect; }
1598  QCPAxisRect *clipAxisRect() const;
1599  bool selectable() const { return mSelectable; }
1600  bool selected() const { return mSelected; }
1601 
1602  // setters:
1603  void setClipToAxisRect(bool clip);
1604  void setClipAxisRect(QCPAxisRect *rect);
1605  Q_SLOT void setSelectable(bool selectable);
1606  Q_SLOT void setSelected(bool selected);
1607 
1608  // reimplemented virtual methods:
1609  virtual double selectTest(const QPointF &pos, bool onlySelectable, QVariant *details=0) const = 0;
1610 
1611  // non-virtual methods:
1612  QList<QCPItemPosition*> positions() const { return mPositions; }
1613  QList<QCPItemAnchor*> anchors() const { return mAnchors; }
1614  QCPItemPosition *position(const QString &name) const;
1615  QCPItemAnchor *anchor(const QString &name) const;
1616  bool hasAnchor(const QString &name) const;
1617 
1618 signals:
1619  void selectionChanged(bool selected);
1620  void selectableChanged(bool selectable);
1621 
1622 protected:
1623  // property members:
1625  QPointer<QCPAxisRect> mClipAxisRect;
1626  QList<QCPItemPosition*> mPositions;
1627  QList<QCPItemAnchor*> mAnchors;
1628  bool mSelectable, mSelected;
1629 
1630  // reimplemented virtual methods:
1631  virtual QCP::Interaction selectionCategory() const;
1632  virtual QRect clipRect() const;
1633  virtual void applyDefaultAntialiasingHint(QCPPainter *painter) const;
1634  virtual void draw(QCPPainter *painter) = 0;
1635  // events:
1636  virtual void selectEvent(QMouseEvent *event, bool additive, const QVariant &details, bool *selectionStateChanged);
1637  virtual void deselectEvent(bool *selectionStateChanged);
1638 
1639  // introduced virtual methods:
1640  virtual QPointF anchorPixelPoint(int anchorId) const;
1641 
1642  // non-virtual methods:
1643  double distSqrToLine(const QPointF &start, const QPointF &end, const QPointF &point) const;
1644  double rectSelectTest(const QRectF &rect, const QPointF &pos, bool filledRect) const;
1645  QCPItemPosition *createPosition(const QString &name);
1646  QCPItemAnchor *createAnchor(const QString &name, int anchorId);
1647 
1648 private:
1649  Q_DISABLE_COPY(QCPAbstractItem)
1650 
1651  friend class QCustomPlot;
1652  friend class QCPItemAnchor;
1653 };
1654 
1655 
1656 class QCP_LIB_DECL QCustomPlot : public QWidget
1657 {
1658  Q_OBJECT
1660  Q_PROPERTY(QRect viewport READ viewport WRITE setViewport)
1661  Q_PROPERTY(QPixmap background READ background WRITE setBackground)
1662  Q_PROPERTY(bool backgroundScaled READ backgroundScaled WRITE setBackgroundScaled)
1663  Q_PROPERTY(Qt::AspectRatioMode backgroundScaledMode READ backgroundScaledMode WRITE setBackgroundScaledMode)
1664  Q_PROPERTY(QCPLayoutGrid* plotLayout READ plotLayout)
1665  Q_PROPERTY(bool autoAddPlottableToLegend READ autoAddPlottableToLegend WRITE setAutoAddPlottableToLegend)
1666  Q_PROPERTY(int selectionTolerance READ selectionTolerance WRITE setSelectionTolerance)
1667  Q_PROPERTY(bool noAntialiasingOnDrag READ noAntialiasingOnDrag WRITE setNoAntialiasingOnDrag)
1668  Q_PROPERTY(Qt::KeyboardModifier multiSelectModifier READ multiSelectModifier WRITE setMultiSelectModifier)
1670 public:
1676  enum LayerInsertMode { limBelow
1677  ,limAbove
1678  };
1679  Q_ENUMS(LayerInsertMode)
1680 
1681 
1686  enum RefreshPriority { rpImmediate
1687  ,rpQueued
1688  ,rpHint
1689  };
1690 
1691  explicit QCustomPlot(QWidget *parent = 0);
1692  virtual ~QCustomPlot();
1693 
1694  // getters:
1695  QRect viewport() const { return mViewport; }
1696  QPixmap background() const { return mBackgroundPixmap; }
1697  bool backgroundScaled() const { return mBackgroundScaled; }
1698  Qt::AspectRatioMode backgroundScaledMode() const { return mBackgroundScaledMode; }
1699  QCPLayoutGrid *plotLayout() const { return mPlotLayout; }
1700  QCP::AntialiasedElements antialiasedElements() const { return mAntialiasedElements; }
1701  QCP::AntialiasedElements notAntialiasedElements() const { return mNotAntialiasedElements; }
1702  bool autoAddPlottableToLegend() const { return mAutoAddPlottableToLegend; }
1703  const QCP::Interactions interactions() const { return mInteractions; }
1704  int selectionTolerance() const { return mSelectionTolerance; }
1705  bool noAntialiasingOnDrag() const { return mNoAntialiasingOnDrag; }
1706  QCP::PlottingHints plottingHints() const { return mPlottingHints; }
1707  Qt::KeyboardModifier multiSelectModifier() const { return mMultiSelectModifier; }
1708 
1709  // setters:
1710  void setViewport(const QRect &rect);
1711  void setBackground(const QPixmap &pm);
1712  void setBackground(const QPixmap &pm, bool scaled, Qt::AspectRatioMode mode=Qt::KeepAspectRatioByExpanding);
1713  void setBackground(const QBrush &brush);
1714  void setBackgroundScaled(bool scaled);
1715  void setBackgroundScaledMode(Qt::AspectRatioMode mode);
1716  void setAntialiasedElements(const QCP::AntialiasedElements &antialiasedElements);
1717  void setAntialiasedElement(QCP::AntialiasedElement antialiasedElement, bool enabled=true);
1718  void setNotAntialiasedElements(const QCP::AntialiasedElements &notAntialiasedElements);
1719  void setNotAntialiasedElement(QCP::AntialiasedElement notAntialiasedElement, bool enabled=true);
1720  void setAutoAddPlottableToLegend(bool on);
1721  void setInteractions(const QCP::Interactions &interactions);
1722  void setInteraction(const QCP::Interaction &interaction, bool enabled=true);
1723  void setSelectionTolerance(int pixels);
1724  void setNoAntialiasingOnDrag(bool enabled);
1725  void setPlottingHints(const QCP::PlottingHints &hints);
1726  void setPlottingHint(QCP::PlottingHint hint, bool enabled=true);
1727  void setMultiSelectModifier(Qt::KeyboardModifier modifier);
1728 
1729  // non-property methods:
1730  // plottable interface:
1731  QCPAbstractPlottable *plottable(int index);
1732  QCPAbstractPlottable *plottable();
1733  bool addPlottable(QCPAbstractPlottable *plottable);
1734  bool removePlottable(QCPAbstractPlottable *plottable);
1735  bool removePlottable(int index);
1736  int clearPlottables();
1737  int plottableCount() const;
1738  QList<QCPAbstractPlottable*> selectedPlottables() const;
1739  QCPAbstractPlottable *plottableAt(const QPointF &pos, bool onlySelectable=false) const;
1740  bool hasPlottable(QCPAbstractPlottable *plottable) const;
1741 
1742  // specialized interface for QCPGraph:
1743  QCPGraph *graph(int index) const;
1744  QCPGraph *graph() const;
1745  QCPGraph *addGraph(QCPAxis *keyAxis=0, QCPAxis *valueAxis=0);
1746  bool removeGraph(QCPGraph *graph);
1747  bool removeGraph(int index);
1748  int clearGraphs();
1749  int graphCount() const;
1750  QList<QCPGraph*> selectedGraphs() const;
1751 
1752  // item interface:
1753  QCPAbstractItem *item(int index) const;
1754  QCPAbstractItem *item() const;
1755  bool addItem(QCPAbstractItem* item);
1756  bool removeItem(QCPAbstractItem *item);
1757  bool removeItem(int index);
1758  int clearItems();
1759  int itemCount() const;
1760  QList<QCPAbstractItem*> selectedItems() const;
1761  QCPAbstractItem *itemAt(const QPointF &pos, bool onlySelectable=false) const;
1762  bool hasItem(QCPAbstractItem *item) const;
1763 
1764  // layer interface:
1765  QCPLayer *layer(const QString &name) const;
1766  QCPLayer *layer(int index) const;
1767  QCPLayer *currentLayer() const;
1768  bool setCurrentLayer(const QString &name);
1769  bool setCurrentLayer(QCPLayer *layer);
1770  int layerCount() const;
1771  bool addLayer(const QString &name, QCPLayer *otherLayer=0, LayerInsertMode insertMode=limAbove);
1772  bool removeLayer(QCPLayer *layer);
1773  bool moveLayer(QCPLayer *layer, QCPLayer *otherLayer, LayerInsertMode insertMode=limAbove);
1774 
1775  // axis rect/layout interface:
1776  int axisRectCount() const;
1777  QCPAxisRect* axisRect(int index=0) const;
1778  QList<QCPAxisRect*> axisRects() const;
1779  QCPLayoutElement* layoutElementAt(const QPointF &pos) const;
1780  Q_SLOT void rescaleAxes(bool onlyVisiblePlottables=false);
1781 
1782  QList<QCPAxis*> selectedAxes() const;
1783  QList<QCPLegend*> selectedLegends() const;
1784  Q_SLOT void deselectAll();
1785 
1786  bool savePdf(const QString &fileName, bool noCosmeticPen=false, int width=0, int height=0, const QString &pdfCreator="", const QString &pdfTitle="");
1787  bool savePng(const QString &fileName, int width=0, int height=0, double scale=1.0, int quality=-1);
1788  bool saveJpg(const QString &fileName, int width=0, int height=0, double scale=1.0, int quality=-1);
1789  bool saveBmp(const QString &fileName, int width=0, int height=0, double scale=1.0);
1790  bool saveRastered(const QString &fileName, int width, int height, double scale, const char *format, int quality=-1);
1791  QPixmap toPixmap(int width=0, int height=0, double scale=1.0);
1792  void toPainter(QCPPainter *painter, int width=0, int height=0);
1793  Q_SLOT void replot(QCustomPlot::RefreshPriority refreshPriority=QCustomPlot::rpHint);
1794 
1795  QCPAxis *xAxis, *yAxis, *xAxis2, *yAxis2;
1797 
1798 signals:
1799  void mouseDoubleClick(QMouseEvent *event);
1800  void mousePress(QMouseEvent *event);
1801  void mouseMove(QMouseEvent *event);
1802  void mouseRelease(QMouseEvent *event);
1803  void mouseWheel(QWheelEvent *event);
1804 
1805  void plottableClick(QCPAbstractPlottable *plottable, QMouseEvent *event);
1806  void plottableDoubleClick(QCPAbstractPlottable *plottable, QMouseEvent *event);
1807  void itemClick(QCPAbstractItem *item, QMouseEvent *event);
1808  void itemDoubleClick(QCPAbstractItem *item, QMouseEvent *event);
1809  void axisClick(QCPAxis *axis, QCPAxis::SelectablePart part, QMouseEvent *event);
1810  void axisDoubleClick(QCPAxis *axis, QCPAxis::SelectablePart part, QMouseEvent *event);
1811  void legendClick(QCPLegend *legend, QCPAbstractLegendItem *item, QMouseEvent *event);
1812  void legendDoubleClick(QCPLegend *legend, QCPAbstractLegendItem *item, QMouseEvent *event);
1813  void titleClick(QMouseEvent *event, QCPPlotTitle *title);
1814  void titleDoubleClick(QMouseEvent *event, QCPPlotTitle *title);
1815 
1818  void afterReplot();
1819 
1820 protected:
1821  // property members:
1822  QRect mViewport;
1825  QList<QCPAbstractPlottable*> mPlottables;
1826  QList<QCPGraph*> mGraphs; // extra list of plottables also in mPlottables that are of type QCPGraph
1827  QList<QCPAbstractItem*> mItems;
1828  QList<QCPLayer*> mLayers;
1829  QCP::AntialiasedElements mAntialiasedElements, mNotAntialiasedElements;
1830  QCP::Interactions mInteractions;
1837  Qt::AspectRatioMode mBackgroundScaledMode;
1839  QCP::PlottingHints mPlottingHints;
1840  Qt::KeyboardModifier mMultiSelectModifier;
1841 
1842  // non-property members:
1843  QPixmap mPaintBuffer;
1845  QPointer<QCPLayoutElement> mMouseEventElement;
1847 
1848  // reimplemented virtual methods:
1849  virtual QSize minimumSizeHint() const;
1850  virtual QSize sizeHint() const;
1851  virtual void paintEvent(QPaintEvent *event);
1852  virtual void resizeEvent(QResizeEvent *event);
1853  virtual void mouseDoubleClickEvent(QMouseEvent *event);
1854  virtual void mousePressEvent(QMouseEvent *event);
1855  virtual void mouseMoveEvent(QMouseEvent *event);
1856  virtual void mouseReleaseEvent(QMouseEvent *event);
1857  virtual void wheelEvent(QWheelEvent *event);
1858 
1859  // introduced virtual methods:
1860  virtual void draw(QCPPainter *painter);
1861  virtual void axisRemoved(QCPAxis *axis);
1862  virtual void legendRemoved(QCPLegend *legend);
1863 
1864  // non-virtual methods:
1865  void updateLayerIndices() const;
1866  QCPLayerable *layerableAt(const QPointF &pos, bool onlySelectable, QVariant *selectionDetails=0) const;
1867  void drawBackground(QCPPainter *painter);
1868 
1869  friend class QCPLegend;
1870  friend class QCPAxis;
1871  friend class QCPLayer;
1872  friend class QCPAxisRect;
1873 };
1874 
1875 
1877 {
1878  Q_GADGET
1879 public:
1885  enum ColorInterpolation { ciRGB
1886  ,ciHSV
1887  };
1888  Q_ENUMS(ColorInterpolation)
1889 
1890 
1894  enum GradientPreset { gpGrayscale
1895  ,gpHot
1896  ,gpCold
1897  ,gpNight
1898  ,gpCandy
1899  ,gpGeography
1900  ,gpIon
1901  ,gpThermal
1902  ,gpPolar
1903  ,gpSpectrum
1904  ,gpJet
1905  ,gpHues
1906  };
1907  Q_ENUMS(GradientPreset)
1908 
1909  QCPColorGradient(GradientPreset preset=gpCold);
1910  bool operator==(const QCPColorGradient &other) const;
1911  bool operator!=(const QCPColorGradient &other) const { return !(*this == other); }
1912 
1913  // getters:
1914  int levelCount() const { return mLevelCount; }
1915  QMap<double, QColor> colorStops() const { return mColorStops; }
1916  ColorInterpolation colorInterpolation() const { return mColorInterpolation; }
1917  bool periodic() const { return mPeriodic; }
1918 
1919  // setters:
1920  void setLevelCount(int n);
1921  void setColorStops(const QMap<double, QColor> &colorStops);
1922  void setColorStopAt(double position, const QColor &color);
1923  void setColorInterpolation(ColorInterpolation interpolation);
1924  void setPeriodic(bool enabled);
1925 
1926  // non-property methods:
1927  void colorize(const double *data, const QCPRange &range, QRgb *scanLine, int n, int dataIndexFactor=1, bool logarithmic=false);
1928  QRgb color(double position, const QCPRange &range, bool logarithmic=false);
1929  void loadPreset(GradientPreset preset);
1930  void clearColorStops();
1931  QCPColorGradient inverted() const;
1932 
1933 protected:
1934  void updateColorBuffer();
1935 
1936  // property members:
1938  QMap<double, QColor> mColorStops;
1941 
1942  // non-property members:
1943  QVector<QRgb> mColorBuffer;
1945 };
1946 
1947 
1949 {
1950  Q_OBJECT
1952  Q_PROPERTY(QPixmap background READ background WRITE setBackground)
1953  Q_PROPERTY(bool backgroundScaled READ backgroundScaled WRITE setBackgroundScaled)
1954  Q_PROPERTY(Qt::AspectRatioMode backgroundScaledMode READ backgroundScaledMode WRITE setBackgroundScaledMode)
1955  Q_PROPERTY(Qt::Orientations rangeDrag READ rangeDrag WRITE setRangeDrag)
1956  Q_PROPERTY(Qt::Orientations rangeZoom READ rangeZoom WRITE setRangeZoom)
1958 public:
1959  explicit QCPAxisRect(QCustomPlot *parentPlot, bool setupDefaultAxes=true);
1960  virtual ~QCPAxisRect();
1961 
1962  // getters:
1963  QPixmap background() const { return mBackgroundPixmap; }
1964  bool backgroundScaled() const { return mBackgroundScaled; }
1965  Qt::AspectRatioMode backgroundScaledMode() const { return mBackgroundScaledMode; }
1966  Qt::Orientations rangeDrag() const { return mRangeDrag; }
1967  Qt::Orientations rangeZoom() const { return mRangeZoom; }
1968  QCPAxis *rangeDragAxis(Qt::Orientation orientation);
1969  QCPAxis *rangeZoomAxis(Qt::Orientation orientation);
1970  double rangeZoomFactor(Qt::Orientation orientation);
1971 
1972  // setters:
1973  void setBackground(const QPixmap &pm);
1974  void setBackground(const QPixmap &pm, bool scaled, Qt::AspectRatioMode mode=Qt::KeepAspectRatioByExpanding);
1975  void setBackground(const QBrush &brush);
1976  void setBackgroundScaled(bool scaled);
1977  void setBackgroundScaledMode(Qt::AspectRatioMode mode);
1978  void setRangeDrag(Qt::Orientations orientations);
1979  void setRangeZoom(Qt::Orientations orientations);
1980  void setRangeDragAxes(QCPAxis *horizontal, QCPAxis *vertical);
1981  void setRangeZoomAxes(QCPAxis *horizontal, QCPAxis *vertical);
1982  void setRangeZoomFactor(double horizontalFactor, double verticalFactor);
1983  void setRangeZoomFactor(double factor);
1984 
1985  // non-property methods:
1986  int axisCount(QCPAxis::AxisType type) const;
1987  QCPAxis *axis(QCPAxis::AxisType type, int index=0) const;
1988  QList<QCPAxis*> axes(QCPAxis::AxisTypes types) const;
1989  QList<QCPAxis*> axes() const;
1990  QCPAxis *addAxis(QCPAxis::AxisType type);
1991  QList<QCPAxis*> addAxes(QCPAxis::AxisTypes types);
1992  bool removeAxis(QCPAxis *axis);
1993  QCPLayoutInset *insetLayout() const { return mInsetLayout; }
1994 
1995  void setupFullAxesBox(bool connectRanges=false);
1996  QList<QCPAbstractPlottable*> plottables() const;
1997  QList<QCPGraph*> graphs() const;
1998  QList<QCPAbstractItem*> items() const;
1999 
2000  // read-only interface imitating a QRect:
2001  int left() const { return mRect.left(); }
2002  int right() const { return mRect.right(); }
2003  int top() const { return mRect.top(); }
2004  int bottom() const { return mRect.bottom(); }
2005  int width() const { return mRect.width(); }
2006  int height() const { return mRect.height(); }
2007  QSize size() const { return mRect.size(); }
2008  QPoint topLeft() const { return mRect.topLeft(); }
2009  QPoint topRight() const { return mRect.topRight(); }
2010  QPoint bottomLeft() const { return mRect.bottomLeft(); }
2011  QPoint bottomRight() const { return mRect.bottomRight(); }
2012  QPoint center() const { return mRect.center(); }
2013 
2014  // reimplemented virtual methods:
2015  virtual void update(UpdatePhase phase);
2016  virtual QList<QCPLayoutElement*> elements(bool recursive) const;
2017 
2018 protected:
2019  // property members:
2024  Qt::AspectRatioMode mBackgroundScaledMode;
2026  Qt::Orientations mRangeDrag, mRangeZoom;
2027  QPointer<QCPAxis> mRangeDragHorzAxis, mRangeDragVertAxis, mRangeZoomHorzAxis, mRangeZoomVertAxis;
2028  double mRangeZoomFactorHorz, mRangeZoomFactorVert;
2029  // non-property members:
2030  QCPRange mDragStartHorzRange, mDragStartVertRange;
2031  QCP::AntialiasedElements mAADragBackup, mNotAADragBackup;
2032  QPoint mDragStart;
2034  QHash<QCPAxis::AxisType, QList<QCPAxis*> > mAxes;
2035 
2036  // reimplemented virtual methods:
2037  virtual void applyDefaultAntialiasingHint(QCPPainter *painter) const;
2038  virtual void draw(QCPPainter *painter);
2039  virtual int calculateAutoMargin(QCP::MarginSide side);
2040  // events:
2041  virtual void mousePressEvent(QMouseEvent *event);
2042  virtual void mouseMoveEvent(QMouseEvent *event);
2043  virtual void mouseReleaseEvent(QMouseEvent *event);
2044  virtual void wheelEvent(QWheelEvent *event);
2045 
2046  // non-property methods:
2047  void drawBackground(QCPPainter *painter);
2048  void updateAxesOffset(QCPAxis::AxisType type);
2049 
2050 private:
2051  Q_DISABLE_COPY(QCPAxisRect)
2052 
2053  friend class QCustomPlot;
2054 };
2055 
2056 
2058 {
2059  Q_OBJECT
2061  Q_PROPERTY(QCPLegend* parentLegend READ parentLegend)
2062  Q_PROPERTY(QFont font READ font WRITE setFont)
2063  Q_PROPERTY(QColor textColor READ textColor WRITE setTextColor)
2064  Q_PROPERTY(QFont selectedFont READ selectedFont WRITE setSelectedFont)
2065  Q_PROPERTY(QColor selectedTextColor READ selectedTextColor WRITE setSelectedTextColor)
2066  Q_PROPERTY(bool selectable READ selectable WRITE setSelectable NOTIFY selectionChanged)
2067  Q_PROPERTY(bool selected READ selected WRITE setSelected NOTIFY selectableChanged)
2069 public:
2070  explicit QCPAbstractLegendItem(QCPLegend *parent);
2071 
2072  // getters:
2073  QCPLegend *parentLegend() const { return mParentLegend; }
2074  QFont font() const { return mFont; }
2075  QColor textColor() const { return mTextColor; }
2076  QFont selectedFont() const { return mSelectedFont; }
2077  QColor selectedTextColor() const { return mSelectedTextColor; }
2078  bool selectable() const { return mSelectable; }
2079  bool selected() const { return mSelected; }
2080 
2081  // setters:
2082  void setFont(const QFont &font);
2083  void setTextColor(const QColor &color);
2084  void setSelectedFont(const QFont &font);
2085  void setSelectedTextColor(const QColor &color);
2086  Q_SLOT void setSelectable(bool selectable);
2087  Q_SLOT void setSelected(bool selected);
2088 
2089  // reimplemented virtual methods:
2090  virtual double selectTest(const QPointF &pos, bool onlySelectable, QVariant *details=0) const;
2091 
2092 signals:
2093  void selectionChanged(bool selected);
2094  void selectableChanged(bool selectable);
2095 
2096 protected:
2097  // property members:
2099  QFont mFont;
2100  QColor mTextColor;
2103  bool mSelectable, mSelected;
2104 
2105  // reimplemented virtual methods:
2106  virtual QCP::Interaction selectionCategory() const;
2107  virtual void applyDefaultAntialiasingHint(QCPPainter *painter) const;
2108  virtual QRect clipRect() const;
2109  virtual void draw(QCPPainter *painter) = 0;
2110  // events:
2111  virtual void selectEvent(QMouseEvent *event, bool additive, const QVariant &details, bool *selectionStateChanged);
2112  virtual void deselectEvent(bool *selectionStateChanged);
2113 
2114 private:
2115  Q_DISABLE_COPY(QCPAbstractLegendItem)
2116 
2117  friend class QCPLegend;
2118 };
2119 
2120 
2122 {
2123  Q_OBJECT
2124 public:
2126 
2127  // getters:
2128  QCPAbstractPlottable *plottable() { return mPlottable; }
2129 
2130 protected:
2131  // property members:
2133 
2134  // reimplemented virtual methods:
2135  virtual void draw(QCPPainter *painter);
2136  virtual QSize minimumSizeHint() const;
2137 
2138  // non-virtual methods:
2139  QPen getIconBorderPen() const;
2140  QColor getTextColor() const;
2141  QFont getFont() const;
2142 };
2143 
2144 
2146 {
2147  Q_OBJECT
2149  Q_PROPERTY(QPen borderPen READ borderPen WRITE setBorderPen)
2150  Q_PROPERTY(QBrush brush READ brush WRITE setBrush)
2151  Q_PROPERTY(QFont font READ font WRITE setFont)
2152  Q_PROPERTY(QColor textColor READ textColor WRITE setTextColor)
2153  Q_PROPERTY(QSize iconSize READ iconSize WRITE setIconSize)
2154  Q_PROPERTY(int iconTextPadding READ iconTextPadding WRITE setIconTextPadding)
2155  Q_PROPERTY(QPen iconBorderPen READ iconBorderPen WRITE setIconBorderPen)
2156  Q_PROPERTY(SelectableParts selectableParts READ selectableParts WRITE setSelectableParts NOTIFY selectionChanged)
2157  Q_PROPERTY(SelectableParts selectedParts READ selectedParts WRITE setSelectedParts NOTIFY selectableChanged)
2158  Q_PROPERTY(QPen selectedBorderPen READ selectedBorderPen WRITE setSelectedBorderPen)
2159  Q_PROPERTY(QPen selectedIconBorderPen READ selectedIconBorderPen WRITE setSelectedIconBorderPen)
2160  Q_PROPERTY(QBrush selectedBrush READ selectedBrush WRITE setSelectedBrush)
2161  Q_PROPERTY(QFont selectedFont READ selectedFont WRITE setSelectedFont)
2162  Q_PROPERTY(QColor selectedTextColor READ selectedTextColor WRITE setSelectedTextColor)
2164 public:
2170  enum SelectablePart { spNone = 0x000
2171  ,spLegendBox = 0x001
2172  ,spItems = 0x002
2173  };
2174  Q_FLAGS(SelectablePart SelectableParts)
2175  Q_DECLARE_FLAGS(SelectableParts, SelectablePart)
2176 
2177  explicit QCPLegend();
2178  virtual ~QCPLegend();
2179 
2180  // getters:
2181  QPen borderPen() const { return mBorderPen; }
2182  QBrush brush() const { return mBrush; }
2183  QFont font() const { return mFont; }
2184  QColor textColor() const { return mTextColor; }
2185  QSize iconSize() const { return mIconSize; }
2186  int iconTextPadding() const { return mIconTextPadding; }
2187  QPen iconBorderPen() const { return mIconBorderPen; }
2188  SelectableParts selectableParts() const { return mSelectableParts; }
2189  SelectableParts selectedParts() const;
2190  QPen selectedBorderPen() const { return mSelectedBorderPen; }
2191  QPen selectedIconBorderPen() const { return mSelectedIconBorderPen; }
2192  QBrush selectedBrush() const { return mSelectedBrush; }
2193  QFont selectedFont() const { return mSelectedFont; }
2194  QColor selectedTextColor() const { return mSelectedTextColor; }
2195 
2196  // setters:
2197  void setBorderPen(const QPen &pen);
2198  void setBrush(const QBrush &brush);
2199  void setFont(const QFont &font);
2200  void setTextColor(const QColor &color);
2201  void setIconSize(const QSize &size);
2202  void setIconSize(int width, int height);
2203  void setIconTextPadding(int padding);
2204  void setIconBorderPen(const QPen &pen);
2205  Q_SLOT void setSelectableParts(const SelectableParts &selectableParts);
2206  Q_SLOT void setSelectedParts(const SelectableParts &selectedParts);
2207  void setSelectedBorderPen(const QPen &pen);
2208  void setSelectedIconBorderPen(const QPen &pen);
2209  void setSelectedBrush(const QBrush &brush);
2210  void setSelectedFont(const QFont &font);
2211  void setSelectedTextColor(const QColor &color);
2212 
2213  // reimplemented virtual methods:
2214  virtual double selectTest(const QPointF &pos, bool onlySelectable, QVariant *details=0) const;
2215 
2216  // non-virtual methods:
2217  QCPAbstractLegendItem *item(int index) const;
2218  QCPPlottableLegendItem *itemWithPlottable(const QCPAbstractPlottable *plottable) const;
2219  int itemCount() const;
2220  bool hasItem(QCPAbstractLegendItem *item) const;
2221  bool hasItemWithPlottable(const QCPAbstractPlottable *plottable) const;
2222  bool addItem(QCPAbstractLegendItem *item);
2223  bool removeItem(int index);
2224  bool removeItem(QCPAbstractLegendItem *item);
2225  void clearItems();
2226  QList<QCPAbstractLegendItem*> selectedItems() const;
2227 
2228 signals:
2229  void selectionChanged(QCPLegend::SelectableParts parts);
2230  void selectableChanged(QCPLegend::SelectableParts parts);
2231 
2232 protected:
2233  // property members:
2234  QPen mBorderPen, mIconBorderPen;
2235  QBrush mBrush;
2236  QFont mFont;
2237  QColor mTextColor;
2238  QSize mIconSize;
2240  SelectableParts mSelectedParts, mSelectableParts;
2241  QPen mSelectedBorderPen, mSelectedIconBorderPen;
2245 
2246  // reimplemented virtual methods:
2247  virtual void parentPlotInitialized(QCustomPlot *parentPlot);
2248  virtual QCP::Interaction selectionCategory() const;
2249  virtual void applyDefaultAntialiasingHint(QCPPainter *painter) const;
2250  virtual void draw(QCPPainter *painter);
2251  // events:
2252  virtual void selectEvent(QMouseEvent *event, bool additive, const QVariant &details, bool *selectionStateChanged);
2253  virtual void deselectEvent(bool *selectionStateChanged);
2254 
2255  // non-virtual methods:
2256  QPen getBorderPen() const;
2257  QBrush getBrush() const;
2258 
2259 private:
2260  Q_DISABLE_COPY(QCPLegend)
2261 
2262  friend class QCustomPlot;
2264 };
2265 Q_DECLARE_OPERATORS_FOR_FLAGS(QCPLegend::SelectableParts)
2266 Q_DECLARE_METATYPE(QCPLegend::SelectablePart)
2267 
2268 
2270 {
2271  Q_OBJECT
2273  Q_PROPERTY(QString text READ text WRITE setText)
2274  Q_PROPERTY(QFont font READ font WRITE setFont)
2275  Q_PROPERTY(QColor textColor READ textColor WRITE setTextColor)
2276  Q_PROPERTY(QFont selectedFont READ selectedFont WRITE setSelectedFont)
2277  Q_PROPERTY(QColor selectedTextColor READ selectedTextColor WRITE setSelectedTextColor)
2278  Q_PROPERTY(bool selectable READ selectable WRITE setSelectable NOTIFY selectableChanged)
2279  Q_PROPERTY(bool selected READ selected WRITE setSelected NOTIFY selectionChanged)
2281 public:
2282  explicit QCPPlotTitle(QCustomPlot *parentPlot);
2283  explicit QCPPlotTitle(QCustomPlot *parentPlot, const QString &text);
2284 
2285  // getters:
2286  QString text() const { return mText; }
2287  QFont font() const { return mFont; }
2288  QColor textColor() const { return mTextColor; }
2289  QFont selectedFont() const { return mSelectedFont; }
2290  QColor selectedTextColor() const { return mSelectedTextColor; }
2291  bool selectable() const { return mSelectable; }
2292  bool selected() const { return mSelected; }
2293 
2294  // setters:
2295  void setText(const QString &text);
2296  void setFont(const QFont &font);
2297  void setTextColor(const QColor &color);
2298  void setSelectedFont(const QFont &font);
2299  void setSelectedTextColor(const QColor &color);
2300  Q_SLOT void setSelectable(bool selectable);
2301  Q_SLOT void setSelected(bool selected);
2302 
2303  // reimplemented virtual methods:
2304  virtual double selectTest(const QPointF &pos, bool onlySelectable, QVariant *details=0) const;
2305 
2306 signals:
2307  void selectionChanged(bool selected);
2308  void selectableChanged(bool selectable);
2309 
2310 protected:
2311  // property members:
2312  QString mText;
2313  QFont mFont;
2314  QColor mTextColor;
2318  bool mSelectable, mSelected;
2319 
2320  // reimplemented virtual methods:
2321  virtual void applyDefaultAntialiasingHint(QCPPainter *painter) const;
2322  virtual void draw(QCPPainter *painter);
2323  virtual QSize minimumSizeHint() const;
2324  virtual QSize maximumSizeHint() const;
2325  // events:
2326  virtual void selectEvent(QMouseEvent *event, bool additive, const QVariant &details, bool *selectionStateChanged);
2327  virtual void deselectEvent(bool *selectionStateChanged);
2328 
2329  // non-virtual methods:
2330  QFont mainFont() const;
2331  QColor mainTextColor() const;
2332 
2333 private:
2334  Q_DISABLE_COPY(QCPPlotTitle)
2335 };
2336 
2337 
2339 {
2340  Q_OBJECT
2341 public:
2342  explicit QCPColorScaleAxisRectPrivate(QCPColorScale *parentColorScale);
2343 protected:
2347  // re-using some methods of QCPAxisRect to make them available to friend class QCPColorScale
2353  using QCPAxisRect::update;
2354  virtual void draw(QCPPainter *painter);
2355  void updateGradientImage();
2356  Q_SLOT void axisSelectionChanged(QCPAxis::SelectableParts selectedParts);
2357  Q_SLOT void axisSelectableChanged(QCPAxis::SelectableParts selectableParts);
2358  friend class QCPColorScale;
2359 };
2360 
2361 
2363 {
2364  Q_OBJECT
2366  Q_PROPERTY(QCPAxis::AxisType type READ type WRITE setType)
2367  Q_PROPERTY(QCPRange dataRange READ dataRange WRITE setDataRange NOTIFY dataRangeChanged)
2368  Q_PROPERTY(QCPAxis::ScaleType dataScaleType READ dataScaleType WRITE setDataScaleType NOTIFY dataScaleTypeChanged)
2369  Q_PROPERTY(QCPColorGradient gradient READ gradient WRITE setGradient NOTIFY gradientChanged)
2370  Q_PROPERTY(QString label READ label WRITE setLabel)
2371  Q_PROPERTY(int barWidth READ barWidth WRITE setBarWidth)
2372  Q_PROPERTY(bool rangeDrag READ rangeDrag WRITE setRangeDrag)
2373  Q_PROPERTY(bool rangeZoom READ rangeZoom WRITE setRangeZoom)
2375 public:
2376  explicit QCPColorScale(QCustomPlot *parentPlot);
2377  virtual ~QCPColorScale();
2378 
2379  // getters:
2380  QCPAxis *axis() const { return mColorAxis.data(); }
2381  QCPAxis::AxisType type() const { return mType; }
2382  QCPRange dataRange() const { return mDataRange; }
2383  QCPAxis::ScaleType dataScaleType() const { return mDataScaleType; }
2384  QCPColorGradient gradient() const { return mGradient; }
2385  QString label() const;
2386  int barWidth () const { return mBarWidth; }
2387  bool rangeDrag() const;
2388  bool rangeZoom() const;
2389 
2390  // setters:
2391  void setType(QCPAxis::AxisType type);
2392  Q_SLOT void setDataRange(const QCPRange &dataRange);
2393  Q_SLOT void setDataScaleType(QCPAxis::ScaleType scaleType);
2394  Q_SLOT void setGradient(const QCPColorGradient &gradient);
2395  void setLabel(const QString &str);
2396  void setBarWidth(int width);
2397  void setRangeDrag(bool enabled);
2398  void setRangeZoom(bool enabled);
2399 
2400  // non-property methods:
2401  QList<QCPColorMap*> colorMaps() const;
2402  void rescaleDataRange(bool onlyVisibleMaps);
2403 
2404  // reimplemented virtual methods:
2405  virtual void update(UpdatePhase phase);
2406 
2407 signals:
2408  void dataRangeChanged(QCPRange newRange);
2411 
2412 protected:
2413  // property members:
2419 
2420  // non-property members:
2421  QPointer<QCPColorScaleAxisRectPrivate> mAxisRect;
2422  QPointer<QCPAxis> mColorAxis;
2423 
2424  // reimplemented virtual methods:
2425  virtual void applyDefaultAntialiasingHint(QCPPainter *painter) const;
2426  // events:
2427  virtual void mousePressEvent(QMouseEvent *event);
2428  virtual void mouseMoveEvent(QMouseEvent *event);
2429  virtual void mouseReleaseEvent(QMouseEvent *event);
2430  virtual void wheelEvent(QWheelEvent *event);
2431 
2432 private:
2433  Q_DISABLE_COPY(QCPColorScale)
2434 
2436 };
2437 
2438 
2444 {
2445 public:
2446  QCPData();
2447  QCPData(double key, double value);
2448  double key, value;
2449  double keyErrorPlus, keyErrorMinus;
2450  double valueErrorPlus, valueErrorMinus;
2451 };
2452 Q_DECLARE_TYPEINFO(QCPData, Q_MOVABLE_TYPE);
2453 
2461 typedef QMap<double, QCPData> QCPDataMap;
2462 typedef QMapIterator<double, QCPData> QCPDataMapIterator;
2463 typedef QMutableMapIterator<double, QCPData> QCPDataMutableMapIterator;
2464 
2465 
2467 {
2468  Q_OBJECT
2470  Q_PROPERTY(LineStyle lineStyle READ lineStyle WRITE setLineStyle)
2471  Q_PROPERTY(QCPScatterStyle scatterStyle READ scatterStyle WRITE setScatterStyle)
2472  Q_PROPERTY(ErrorType errorType READ errorType WRITE setErrorType)
2473  Q_PROPERTY(QPen errorPen READ errorPen WRITE setErrorPen)
2474  Q_PROPERTY(double errorBarSize READ errorBarSize WRITE setErrorBarSize)
2475  Q_PROPERTY(bool errorBarSkipSymbol READ errorBarSkipSymbol WRITE setErrorBarSkipSymbol)
2476  Q_PROPERTY(QCPGraph* channelFillGraph READ channelFillGraph WRITE setChannelFillGraph)
2477  Q_PROPERTY(bool adaptiveSampling READ adaptiveSampling WRITE setAdaptiveSampling)
2479 public:
2485  enum LineStyle { lsNone
2487  ,lsLine
2488  ,lsStepLeft
2489  ,lsStepRight
2490  ,lsStepCenter
2491  ,lsImpulse
2492  };
2493  Q_ENUMS(LineStyle)
2497  enum ErrorType { etNone
2498  ,etKey
2499  ,etValue
2500  ,etBoth
2501  };
2502  Q_ENUMS(ErrorType)
2503 
2504  explicit QCPGraph(QCPAxis *keyAxis, QCPAxis *valueAxis);
2505  virtual ~QCPGraph();
2506 
2507  // getters:
2508  QCPDataMap *data() const { return mData; }
2509  LineStyle lineStyle() const { return mLineStyle; }
2510  QCPScatterStyle scatterStyle() const { return mScatterStyle; }
2511  ErrorType errorType() const { return mErrorType; }
2512  QPen errorPen() const { return mErrorPen; }
2513  double errorBarSize() const { return mErrorBarSize; }
2514  bool errorBarSkipSymbol() const { return mErrorBarSkipSymbol; }
2515  QCPGraph *channelFillGraph() const { return mChannelFillGraph.data(); }
2516  bool adaptiveSampling() const { return mAdaptiveSampling; }
2517 
2518  // setters:
2519  void setData(QCPDataMap *data, bool copy=false);
2520  void setData(const QVector<double> &key, const QVector<double> &value);
2521  void setDataKeyError(const QVector<double> &key, const QVector<double> &value, const QVector<double> &keyError);
2522  void setDataKeyError(const QVector<double> &key, const QVector<double> &value, const QVector<double> &keyErrorMinus, const QVector<double> &keyErrorPlus);
2523  void setDataValueError(const QVector<double> &key, const QVector<double> &value, const QVector<double> &valueError);
2524  void setDataValueError(const QVector<double> &key, const QVector<double> &value, const QVector<double> &valueErrorMinus, const QVector<double> &valueErrorPlus);
2525  void setDataBothError(const QVector<double> &key, const QVector<double> &value, const QVector<double> &keyError, const QVector<double> &valueError);
2526  void setDataBothError(const QVector<double> &key, const QVector<double> &value, const QVector<double> &keyErrorMinus, const QVector<double> &keyErrorPlus, const QVector<double> &valueErrorMinus, const QVector<double> &valueErrorPlus);
2527  void setLineStyle(LineStyle ls);
2528  void setScatterStyle(const QCPScatterStyle &style);
2529  void setErrorType(ErrorType errorType);
2530  void setErrorPen(const QPen &pen);
2531  void setErrorBarSize(double size);
2532  void setErrorBarSkipSymbol(bool enabled);
2533  void setChannelFillGraph(QCPGraph *targetGraph);
2534  void setAdaptiveSampling(bool enabled);
2535 
2536  // non-property methods:
2537  void addData(const QCPDataMap &dataMap);
2538  void addData(const QCPData &data);
2539  void addData(double key, double value);
2540  void addData(const QVector<double> &keys, const QVector<double> &values);
2541  void removeDataBefore(double key);
2542  void removeDataAfter(double key);
2543  void removeData(double fromKey, double toKey);
2544  void removeData(double key);
2545 
2546  // reimplemented virtual methods:
2547  virtual void clearData();
2548  virtual double selectTest(const QPointF &pos, bool onlySelectable, QVariant *details=0) const;
2552  void rescaleAxes(bool onlyEnlarge, bool includeErrorBars) const; // overloads base class interface
2553  void rescaleKeyAxis(bool onlyEnlarge, bool includeErrorBars) const; // overloads base class interface
2554  void rescaleValueAxis(bool onlyEnlarge, bool includeErrorBars) const; // overloads base class interface
2555 
2556 protected:
2557  // property members:
2565  QPointer<QCPGraph> mChannelFillGraph;
2567 
2568  // reimplemented virtual methods:
2569  virtual void draw(QCPPainter *painter);
2570  virtual void drawLegendIcon(QCPPainter *painter, const QRectF &rect) const;
2571  virtual QCPRange getKeyRange(bool &foundRange, SignDomain inSignDomain=sdBoth) const;
2572  virtual QCPRange getValueRange(bool &foundRange, SignDomain inSignDomain=sdBoth) const;
2573  virtual QCPRange getKeyRange(bool &foundRange, SignDomain inSignDomain, bool includeErrors) const; // overloads base class interface
2574  virtual QCPRange getValueRange(bool &foundRange, SignDomain inSignDomain, bool includeErrors) const; // overloads base class interface
2575 
2576  // introduced virtual methods:
2577  virtual void drawFill(QCPPainter *painter, QVector<QPointF> *lineData) const;
2578  virtual void drawScatterPlot(QCPPainter *painter, QVector<QCPData> *scatterData) const;
2579  virtual void drawLinePlot(QCPPainter *painter, QVector<QPointF> *lineData) const;
2580  virtual void drawImpulsePlot(QCPPainter *painter, QVector<QPointF> *lineData) const;
2581 
2582  // non-virtual methods:
2583  void getPreparedData(QVector<QCPData> *lineData, QVector<QCPData> *scatterData) const;
2584  void getPlotData(QVector<QPointF> *lineData, QVector<QCPData> *scatterData) const;
2585  void getScatterPlotData(QVector<QCPData> *scatterData) const;
2586  void getLinePlotData(QVector<QPointF> *linePixelData, QVector<QCPData> *scatterData) const;
2587  void getStepLeftPlotData(QVector<QPointF> *linePixelData, QVector<QCPData> *scatterData) const;
2588  void getStepRightPlotData(QVector<QPointF> *linePixelData, QVector<QCPData> *scatterData) const;
2589  void getStepCenterPlotData(QVector<QPointF> *linePixelData, QVector<QCPData> *scatterData) const;
2590  void getImpulsePlotData(QVector<QPointF> *linePixelData, QVector<QCPData> *scatterData) const;
2591  void drawError(QCPPainter *painter, double x, double y, const QCPData &data) const;
2592  void getVisibleDataBounds(QCPDataMap::const_iterator &lower, QCPDataMap::const_iterator &upper) const;
2593  int countDataInBounds(const QCPDataMap::const_iterator &lower, const QCPDataMap::const_iterator &upper, int maxCount) const;
2594  void addFillBasePoints(QVector<QPointF> *lineData) const;
2595  void removeFillBasePoints(QVector<QPointF> *lineData) const;
2596  QPointF lowerFillBasePoint(double lowerKey) const;
2597  QPointF upperFillBasePoint(double upperKey) const;
2598  const QPolygonF getChannelFillPolygon(const QVector<QPointF> *lineData) const;
2599  int findIndexBelowX(const QVector<QPointF> *data, double x) const;
2600  int findIndexAboveX(const QVector<QPointF> *data, double x) const;
2601  int findIndexBelowY(const QVector<QPointF> *data, double y) const;
2602  int findIndexAboveY(const QVector<QPointF> *data, double y) const;
2603  double pointDistance(const QPointF &pixelPoint) const;
2604 
2605  friend class QCustomPlot;
2606  friend class QCPLegend;
2607 };
2608 
2609 
2615 {
2616 public:
2617  QCPCurveData();
2618  QCPCurveData(double t, double key, double value);
2619  double t, key, value;
2620 };
2622 
2631 typedef QMap<double, QCPCurveData> QCPCurveDataMap;
2632 typedef QMapIterator<double, QCPCurveData> QCPCurveDataMapIterator;
2633 typedef QMutableMapIterator<double, QCPCurveData> QCPCurveDataMutableMapIterator;
2634 
2635 
2637 {
2638  Q_OBJECT
2640  Q_PROPERTY(QCPScatterStyle scatterStyle READ scatterStyle WRITE setScatterStyle)
2641  Q_PROPERTY(LineStyle lineStyle READ lineStyle WRITE setLineStyle)
2643 public:
2649  enum LineStyle { lsNone
2650  ,lsLine
2651  };
2652  explicit QCPCurve(QCPAxis *keyAxis, QCPAxis *valueAxis);
2653  virtual ~QCPCurve();
2654 
2655  // getters:
2656  QCPCurveDataMap *data() const { return mData; }
2657  QCPScatterStyle scatterStyle() const { return mScatterStyle; }
2658  LineStyle lineStyle() const { return mLineStyle; }
2659 
2660  // setters:
2661  void setData(QCPCurveDataMap *data, bool copy=false);
2662  void setData(const QVector<double> &t, const QVector<double> &key, const QVector<double> &value);
2663  void setData(const QVector<double> &key, const QVector<double> &value);
2664  void setScatterStyle(const QCPScatterStyle &style);
2665  void setLineStyle(LineStyle style);
2666 
2667  // non-property methods:
2668  void addData(const QCPCurveDataMap &dataMap);
2669  void addData(const QCPCurveData &data);
2670  void addData(double t, double key, double value);
2671  void addData(double key, double value);
2672  void addData(const QVector<double> &ts, const QVector<double> &keys, const QVector<double> &values);
2673  void removeDataBefore(double t);
2674  void removeDataAfter(double t);
2675  void removeData(double fromt, double tot);
2676  void removeData(double t);
2677 
2678  // reimplemented virtual methods:
2679  virtual void clearData();
2680  virtual double selectTest(const QPointF &pos, bool onlySelectable, QVariant *details=0) const;
2681 
2682 protected:
2683  // property members:
2687 
2688  // reimplemented virtual methods:
2689  virtual void draw(QCPPainter *painter);
2690  virtual void drawLegendIcon(QCPPainter *painter, const QRectF &rect) const;
2691  virtual QCPRange getKeyRange(bool &foundRange, SignDomain inSignDomain=sdBoth) const;
2692  virtual QCPRange getValueRange(bool &foundRange, SignDomain inSignDomain=sdBoth) const;
2693 
2694  // introduced virtual methods:
2695  virtual void drawScatterPlot(QCPPainter *painter, const QVector<QPointF> *pointData) const;
2696 
2697  // non-virtual methods:
2698  void getCurveData(QVector<QPointF> *lineData) const;
2699  double pointDistance(const QPointF &pixelPoint) const;
2700  QPointF outsideCoordsToPixels(double key, double value, int region, QRect axisRect) const;
2701 
2702  friend class QCustomPlot;
2703  friend class QCPLegend;
2704 };
2705 
2706 
2712 {
2713 public:
2714  QCPBarData();
2715  QCPBarData(double key, double value);
2716  double key, value;
2717 };
2719 
2727 typedef QMap<double, QCPBarData> QCPBarDataMap;
2728 typedef QMapIterator<double, QCPBarData> QCPBarDataMapIterator;
2729 typedef QMutableMapIterator<double, QCPBarData> QCPBarDataMutableMapIterator;
2730 
2731 
2733 {
2734  Q_OBJECT
2736  Q_PROPERTY(double width READ width WRITE setWidth)
2737  Q_PROPERTY(QCPBars* barBelow READ barBelow)
2738  Q_PROPERTY(QCPBars* barAbove READ barAbove)
2740 public:
2741  explicit QCPBars(QCPAxis *keyAxis, QCPAxis *valueAxis);
2742  virtual ~QCPBars();
2743 
2744  // getters:
2745  double width() const { return mWidth; }
2746  QCPBars *barBelow() const { return mBarBelow.data(); }
2747  QCPBars *barAbove() const { return mBarAbove.data(); }
2748  QCPBarDataMap *data() const { return mData; }
2749 
2750  // setters:
2751  void setWidth(double width);
2752  void setData(QCPBarDataMap *data, bool copy=false);
2753  void setData(const QVector<double> &key, const QVector<double> &value);
2754 
2755  // non-property methods:
2756  void moveBelow(QCPBars *bars);
2757  void moveAbove(QCPBars *bars);
2758  void addData(const QCPBarDataMap &dataMap);
2759  void addData(const QCPBarData &data);
2760  void addData(double key, double value);
2761  void addData(const QVector<double> &keys, const QVector<double> &values);
2762  void removeDataBefore(double key);
2763  void removeDataAfter(double key);
2764  void removeData(double fromKey, double toKey);
2765  void removeData(double key);
2766 
2767  // reimplemented virtual methods:
2768  virtual void clearData();
2769  virtual double selectTest(const QPointF &pos, bool onlySelectable, QVariant *details=0) const;
2770 
2771 protected:
2772  // property members:
2774  double mWidth;
2775  QPointer<QCPBars> mBarBelow, mBarAbove;
2776 
2777  // reimplemented virtual methods:
2778  virtual void draw(QCPPainter *painter);
2779  virtual void drawLegendIcon(QCPPainter *painter, const QRectF &rect) const;
2780  virtual QCPRange getKeyRange(bool &foundRange, SignDomain inSignDomain=sdBoth) const;
2781  virtual QCPRange getValueRange(bool &foundRange, SignDomain inSignDomain=sdBoth) const;
2782 
2783  // non-virtual methods:
2784  QPolygonF getBarPolygon(double key, double value) const;
2785  double getBaseValue(double key, bool positive) const;
2786  static void connectBars(QCPBars* lower, QCPBars* upper);
2787 
2788  friend class QCustomPlot;
2789  friend class QCPLegend;
2790 };
2791 
2792 
2798 {
2799  Q_OBJECT
2801  Q_PROPERTY(double key READ key WRITE setKey)
2802  Q_PROPERTY(double minimum READ minimum WRITE setMinimum)
2803  Q_PROPERTY(double lowerQuartile READ lowerQuartile WRITE setLowerQuartile)
2804  Q_PROPERTY(double median READ median WRITE setMedian)
2805  Q_PROPERTY(double upperQuartile READ upperQuartile WRITE setUpperQuartile)
2806  Q_PROPERTY(double maximum READ maximum WRITE setMaximum)
2807  Q_PROPERTY(QVector<double> outliers READ outliers WRITE setOutliers)
2808  Q_PROPERTY(double width READ width WRITE setWidth)
2809  Q_PROPERTY(double whiskerWidth READ whiskerWidth WRITE setWhiskerWidth)
2810  Q_PROPERTY(QPen whiskerPen READ whiskerPen WRITE setWhiskerPen)
2811  Q_PROPERTY(QPen whiskerBarPen READ whiskerBarPen WRITE setWhiskerBarPen)
2812  Q_PROPERTY(QPen medianPen READ medianPen WRITE setMedianPen)
2813  Q_PROPERTY(QCPScatterStyle outlierStyle READ outlierStyle WRITE setOutlierStyle)
2815 public:
2816  explicit QCPStatisticalBox(QCPAxis *keyAxis, QCPAxis *valueAxis);
2817 
2818  // getters:
2819  double key() const { return mKey; }
2820  double minimum() const { return mMinimum; }
2821  double lowerQuartile() const { return mLowerQuartile; }
2822  double median() const { return mMedian; }
2823  double upperQuartile() const { return mUpperQuartile; }
2824  double maximum() const { return mMaximum; }
2825  QVector<double> outliers() const { return mOutliers; }
2826  double width() const { return mWidth; }
2827  double whiskerWidth() const { return mWhiskerWidth; }
2828  QPen whiskerPen() const { return mWhiskerPen; }
2829  QPen whiskerBarPen() const { return mWhiskerBarPen; }
2830  QPen medianPen() const { return mMedianPen; }
2831  QCPScatterStyle outlierStyle() const { return mOutlierStyle; }
2832 
2833  // setters:
2834  void setKey(double key);
2835  void setMinimum(double value);
2836  void setLowerQuartile(double value);
2837  void setMedian(double value);
2838  void setUpperQuartile(double value);
2839  void setMaximum(double value);
2840  void setOutliers(const QVector<double> &values);
2841  void setData(double key, double minimum, double lowerQuartile, double median, double upperQuartile, double maximum);
2842  void setWidth(double width);
2843  void setWhiskerWidth(double width);
2844  void setWhiskerPen(const QPen &pen);
2845  void setWhiskerBarPen(const QPen &pen);
2846  void setMedianPen(const QPen &pen);
2847  void setOutlierStyle(const QCPScatterStyle &style);
2848 
2849  // non-property methods:
2850  virtual void clearData();
2851  virtual double selectTest(const QPointF &pos, bool onlySelectable, QVariant *details=0) const;
2852 
2853 protected:
2854  // property members:
2855  QVector<double> mOutliers;
2856  double mKey, mMinimum, mLowerQuartile, mMedian, mUpperQuartile, mMaximum;
2857  double mWidth;
2859  QPen mWhiskerPen, mWhiskerBarPen, mMedianPen;
2861 
2862  // reimplemented virtual methods:
2863  virtual void draw(QCPPainter *painter);
2864  virtual void drawLegendIcon(QCPPainter *painter, const QRectF &rect) const;
2865  virtual QCPRange getKeyRange(bool &foundRange, SignDomain inSignDomain=sdBoth) const;
2866  virtual QCPRange getValueRange(bool &foundRange, SignDomain inSignDomain=sdBoth) const;
2867 
2868  // introduced virtual methods:
2869  virtual void drawQuartileBox(QCPPainter *painter, QRectF *quartileBox=0) const;
2870  virtual void drawMedian(QCPPainter *painter) const;
2871  virtual void drawWhiskers(QCPPainter *painter) const;
2872  virtual void drawOutliers(QCPPainter *painter) const;
2873 
2874  friend class QCustomPlot;
2875  friend class QCPLegend;
2876 };
2877 
2878 
2880 {
2881 public:
2882  QCPColorMapData(int keySize, int valueSize, const QCPRange &keyRange, const QCPRange &valueRange);
2883  ~QCPColorMapData();
2884  QCPColorMapData(const QCPColorMapData &other);
2885  QCPColorMapData &operator=(const QCPColorMapData &other);
2886 
2887  // getters:
2888  int keySize() const { return mKeySize; }
2889  int valueSize() const { return mValueSize; }
2890  QCPRange keyRange() const { return mKeyRange; }
2891  QCPRange valueRange() const { return mValueRange; }
2892  QCPRange dataBounds() const { return mDataBounds; }
2893  double data(double key, double value);
2894  double cell(int keyIndex, int valueIndex);
2895 
2896  // setters:
2897  void setSize(int keySize, int valueSize);
2898  void setKeySize(int keySize);
2899  void setValueSize(int valueSize);
2900  void setRange(const QCPRange &keyRange, const QCPRange &valueRange);
2901  void setKeyRange(const QCPRange &keyRange);
2902  void setValueRange(const QCPRange &valueRange);
2903  void setData(double key, double value, double z);
2904  void setCell(int keyIndex, int valueIndex, double z);
2905 
2906  // non-property methods:
2907  void recalculateDataBounds();
2908  void clear();
2909  void fill(double z);
2910  bool isEmpty() const { return mIsEmpty; }
2911  void coordToCell(double key, double value, int *keyIndex, int *valueIndex) const;
2912  void cellToCoord(int keyIndex, int valueIndex, double *key, double *value) const;
2913 
2914 protected:
2915  // property members:
2916  int mKeySize, mValueSize;
2917  QCPRange mKeyRange, mValueRange;
2918  bool mIsEmpty;
2919  // non-property members:
2920  double *mData;
2923 
2924  friend class QCPColorMap;
2925 };
2926 
2927 
2929 {
2930  Q_OBJECT
2932  Q_PROPERTY(QCPRange dataRange READ dataRange WRITE setDataRange NOTIFY dataRangeChanged)
2933  Q_PROPERTY(QCPAxis::ScaleType dataScaleType READ dataScaleType WRITE setDataScaleType NOTIFY dataScaleTypeChanged)
2934  Q_PROPERTY(QCPColorGradient gradient READ gradient WRITE setGradient NOTIFY gradientChanged)
2935  Q_PROPERTY(bool interpolate READ interpolate WRITE setInterpolate)
2936  Q_PROPERTY(bool tightBoundary READ tightBoundary WRITE setTightBoundary)
2937  Q_PROPERTY(QCPColorScale* colorScale READ colorScale WRITE setColorScale)
2939 public:
2940  explicit QCPColorMap(QCPAxis *keyAxis, QCPAxis *valueAxis);
2941  virtual ~QCPColorMap();
2942 
2943  // getters:
2944  QCPColorMapData *data() const { return mMapData; }
2945  QCPRange dataRange() const { return mDataRange; }
2946  QCPAxis::ScaleType dataScaleType() const { return mDataScaleType; }
2947  bool interpolate() const { return mInterpolate; }
2948  bool tightBoundary() const { return mTightBoundary; }
2949  QCPColorGradient gradient() const { return mGradient; }
2950  QCPColorScale *colorScale() const { return mColorScale.data(); }
2951 
2952  // setters:
2953  void setData(QCPColorMapData *data, bool copy=false);
2954  Q_SLOT void setDataRange(const QCPRange &dataRange);
2955  Q_SLOT void setDataScaleType(QCPAxis::ScaleType scaleType);
2956  Q_SLOT void setGradient(const QCPColorGradient &gradient);
2957  void setInterpolate(bool enabled);
2958  void setTightBoundary(bool enabled);
2959  void setColorScale(QCPColorScale *colorScale);
2960 
2961  // non-property methods:
2962  void rescaleDataRange(bool recalculateDataBounds=false);
2963  Q_SLOT void updateLegendIcon(Qt::TransformationMode transformMode=Qt::SmoothTransformation, const QSize &thumbSize=QSize(32, 18));
2964 
2965  // reimplemented virtual methods:
2966  virtual void clearData();
2967  virtual double selectTest(const QPointF &pos, bool onlySelectable, QVariant *details=0) const;
2968 
2969 signals:
2970  void dataRangeChanged(QCPRange newRange);
2973 
2974 protected:
2975  // property members:
2982  QPointer<QCPColorScale> mColorScale;
2983  // non-property members:
2984  QImage mMapImage;
2985  QPixmap mLegendIcon;
2987 
2988  // introduced virtual methods:
2989  virtual void updateMapImage();
2990 
2991  // reimplemented virtual methods:
2992  virtual void draw(QCPPainter *painter);
2993  virtual void drawLegendIcon(QCPPainter *painter, const QRectF &rect) const;
2994  virtual QCPRange getKeyRange(bool &foundRange, SignDomain inSignDomain=sdBoth) const;
2995  virtual QCPRange getValueRange(bool &foundRange, SignDomain inSignDomain=sdBoth) const;
2996 
2997  friend class QCustomPlot;
2998  friend class QCPLegend;
2999 };
3000 
3001 
3003 {
3004  Q_OBJECT
3006  Q_PROPERTY(QPen pen READ pen WRITE setPen)
3007  Q_PROPERTY(QPen selectedPen READ selectedPen WRITE setSelectedPen)
3009 public:
3010  QCPItemStraightLine(QCustomPlot *parentPlot);
3011  virtual ~QCPItemStraightLine();
3012 
3013  // getters:
3014  QPen pen() const { return mPen; }
3015  QPen selectedPen() const { return mSelectedPen; }
3016 
3017  // setters;
3018  void setPen(const QPen &pen);
3019  void setSelectedPen(const QPen &pen);
3020 
3021  // reimplemented virtual methods:
3022  virtual double selectTest(const QPointF &pos, bool onlySelectable, QVariant *details=0) const;
3023 
3026 
3027 protected:
3028  // property members:
3029  QPen mPen, mSelectedPen;
3030 
3031  // reimplemented virtual methods:
3032  virtual void draw(QCPPainter *painter);
3033 
3034  // non-virtual methods:
3035  double distToStraightLine(const QVector2D &point1, const QVector2D &vec, const QVector2D &point) const;
3036  QLineF getRectClippedStraightLine(const QVector2D &point1, const QVector2D &vec, const QRect &rect) const;
3037  QPen mainPen() const;
3038 };
3039 
3040 
3042 {
3043  Q_OBJECT
3045  Q_PROPERTY(QPen pen READ pen WRITE setPen)
3046  Q_PROPERTY(QPen selectedPen READ selectedPen WRITE setSelectedPen)
3047  Q_PROPERTY(QCPLineEnding head READ head WRITE setHead)
3048  Q_PROPERTY(QCPLineEnding tail READ tail WRITE setTail)
3050 public:
3051  QCPItemLine(QCustomPlot *parentPlot);
3052  virtual ~QCPItemLine();
3053 
3054  // getters:
3055  QPen pen() const { return mPen; }
3056  QPen selectedPen() const { return mSelectedPen; }
3057  QCPLineEnding head() const { return mHead; }
3058  QCPLineEnding tail() const { return mTail; }
3059 
3060  // setters;
3061  void setPen(const QPen &pen);
3062  void setSelectedPen(const QPen &pen);
3063  void setHead(const QCPLineEnding &head);
3064  void setTail(const QCPLineEnding &tail);
3065 
3066  // reimplemented virtual methods:
3067  virtual double selectTest(const QPointF &pos, bool onlySelectable, QVariant *details=0) const;
3068 
3071 
3072 protected:
3073  // property members:
3074  QPen mPen, mSelectedPen;
3076 
3077  // reimplemented virtual methods:
3078  virtual void draw(QCPPainter *painter);
3079 
3080  // non-virtual methods:
3081  QLineF getRectClippedLine(const QVector2D &start, const QVector2D &end, const QRect &rect) const;
3082  QPen mainPen() const;
3083 };
3084 
3085 
3087 {
3088  Q_OBJECT
3090  Q_PROPERTY(QPen pen READ pen WRITE setPen)
3091  Q_PROPERTY(QPen selectedPen READ selectedPen WRITE setSelectedPen)
3092  Q_PROPERTY(QCPLineEnding head READ head WRITE setHead)
3093  Q_PROPERTY(QCPLineEnding tail READ tail WRITE setTail)
3095 public:
3096  QCPItemCurve(QCustomPlot *parentPlot);
3097  virtual ~QCPItemCurve();
3098 
3099  // getters:
3100  QPen pen() const { return mPen; }
3101  QPen selectedPen() const { return mSelectedPen; }
3102  QCPLineEnding head() const { return mHead; }
3103  QCPLineEnding tail() const { return mTail; }
3104 
3105  // setters;
3106  void setPen(const QPen &pen);
3107  void setSelectedPen(const QPen &pen);
3108  void setHead(const QCPLineEnding &head);
3109  void setTail(const QCPLineEnding &tail);
3110 
3111  // reimplemented virtual methods:
3112  virtual double selectTest(const QPointF &pos, bool onlySelectable, QVariant *details=0) const;
3113 
3118 
3119 protected:
3120  // property members:
3121  QPen mPen, mSelectedPen;
3123 
3124  // reimplemented virtual methods:
3125  virtual void draw(QCPPainter *painter);
3126 
3127  // non-virtual methods:
3128  QPen mainPen() const;
3129 };
3130 
3131 
3133 {
3134  Q_OBJECT
3136  Q_PROPERTY(QPen pen READ pen WRITE setPen)
3137  Q_PROPERTY(QPen selectedPen READ selectedPen WRITE setSelectedPen)
3138  Q_PROPERTY(QBrush brush READ brush WRITE setBrush)
3139  Q_PROPERTY(QBrush selectedBrush READ selectedBrush WRITE setSelectedBrush)
3141 public:
3142  QCPItemRect(QCustomPlot *parentPlot);
3143  virtual ~QCPItemRect();
3144 
3145  // getters:
3146  QPen pen() const { return mPen; }
3147  QPen selectedPen() const { return mSelectedPen; }
3148  QBrush brush() const { return mBrush; }
3149  QBrush selectedBrush() const { return mSelectedBrush; }
3150 
3151  // setters;
3152  void setPen(const QPen &pen);
3153  void setSelectedPen(const QPen &pen);
3154  void setBrush(const QBrush &brush);
3155  void setSelectedBrush(const QBrush &brush);
3156 
3157  // reimplemented virtual methods:
3158  virtual double selectTest(const QPointF &pos, bool onlySelectable, QVariant *details=0) const;
3159 
3168 
3169 protected:
3170  enum AnchorIndex {aiTop, aiTopRight, aiRight, aiBottom, aiBottomLeft, aiLeft};
3171 
3172  // property members:
3173  QPen mPen, mSelectedPen;
3174  QBrush mBrush, mSelectedBrush;
3175 
3176  // reimplemented virtual methods:
3177  virtual void draw(QCPPainter *painter);
3178  virtual QPointF anchorPixelPoint(int anchorId) const;
3179 
3180  // non-virtual methods:
3181  QPen mainPen() const;
3182  QBrush mainBrush() const;
3183 };
3184 
3185 
3187 {
3188  Q_OBJECT
3190  Q_PROPERTY(QColor color READ color WRITE setColor)
3191  Q_PROPERTY(QColor selectedColor READ selectedColor WRITE setSelectedColor)
3192  Q_PROPERTY(QPen pen READ pen WRITE setPen)
3193  Q_PROPERTY(QPen selectedPen READ selectedPen WRITE setSelectedPen)
3194  Q_PROPERTY(QBrush brush READ brush WRITE setBrush)
3195  Q_PROPERTY(QBrush selectedBrush READ selectedBrush WRITE setSelectedBrush)
3196  Q_PROPERTY(QFont font READ font WRITE setFont)
3197  Q_PROPERTY(QFont selectedFont READ selectedFont WRITE setSelectedFont)
3198  Q_PROPERTY(QString text READ text WRITE setText)
3199  Q_PROPERTY(Qt::Alignment positionAlignment READ positionAlignment WRITE setPositionAlignment)
3200  Q_PROPERTY(Qt::Alignment textAlignment READ textAlignment WRITE setTextAlignment)
3201  Q_PROPERTY(double rotation READ rotation WRITE setRotation)
3202  Q_PROPERTY(QMargins padding READ padding WRITE setPadding)
3204 public:
3205  QCPItemText(QCustomPlot *parentPlot);
3206  virtual ~QCPItemText();
3207 
3208  // getters:
3209  QColor color() const { return mColor; }
3210  QColor selectedColor() const { return mSelectedColor; }
3211  QPen pen() const { return mPen; }
3212  QPen selectedPen() const { return mSelectedPen; }
3213  QBrush brush() const { return mBrush; }
3214  QBrush selectedBrush() const { return mSelectedBrush; }
3215  QFont font() const { return mFont; }
3216  QFont selectedFont() const { return mSelectedFont; }
3217  QString text() const { return mText; }
3218  Qt::Alignment positionAlignment() const { return mPositionAlignment; }
3219  Qt::Alignment textAlignment() const { return mTextAlignment; }
3220  double rotation() const { return mRotation; }
3221  QMargins padding() const { return mPadding; }
3222 
3223  // setters;
3224  void setColor(const QColor &color);
3225  void setSelectedColor(const QColor &color);
3226  void setPen(const QPen &pen);
3227  void setSelectedPen(const QPen &pen);
3228  void setBrush(const QBrush &brush);
3229  void setSelectedBrush(const QBrush &brush);
3230  void setFont(const QFont &font);
3231  void setSelectedFont(const QFont &font);
3232  void setText(const QString &text);
3233  void setPositionAlignment(Qt::Alignment alignment);
3234  void setTextAlignment(Qt::Alignment alignment);
3235  void setRotation(double degrees);
3236  void setPadding(const QMargins &padding);
3237 
3238  // reimplemented virtual methods:
3239  virtual double selectTest(const QPointF &pos, bool onlySelectable, QVariant *details=0) const;
3240 
3250 
3251 protected:
3252  enum AnchorIndex {aiTopLeft, aiTop, aiTopRight, aiRight, aiBottomRight, aiBottom, aiBottomLeft, aiLeft};
3253 
3254  // property members:
3255  QColor mColor, mSelectedColor;
3256  QPen mPen, mSelectedPen;
3257  QBrush mBrush, mSelectedBrush;
3258  QFont mFont, mSelectedFont;
3259  QString mText;
3260  Qt::Alignment mPositionAlignment;
3261  Qt::Alignment mTextAlignment;
3262  double mRotation;
3263  QMargins mPadding;
3264 
3265  // reimplemented virtual methods:
3266  virtual void draw(QCPPainter *painter);
3267  virtual QPointF anchorPixelPoint(int anchorId) const;
3268 
3269  // non-virtual methods:
3270  QPointF getTextDrawPoint(const QPointF &pos, const QRectF &rect, Qt::Alignment positionAlignment) const;
3271  QFont mainFont() const;
3272  QColor mainColor() const;
3273  QPen mainPen() const;
3274  QBrush mainBrush() const;
3275 };
3276 
3277 
3279 {
3280  Q_OBJECT
3282  Q_PROPERTY(QPen pen READ pen WRITE setPen)
3283  Q_PROPERTY(QPen selectedPen READ selectedPen WRITE setSelectedPen)
3284  Q_PROPERTY(QBrush brush READ brush WRITE setBrush)
3285  Q_PROPERTY(QBrush selectedBrush READ selectedBrush WRITE setSelectedBrush)
3287 public:
3288  QCPItemEllipse(QCustomPlot *parentPlot);
3289  virtual ~QCPItemEllipse();
3290 
3291  // getters:
3292  QPen pen() const { return mPen; }
3293  QPen selectedPen() const { return mSelectedPen; }
3294  QBrush brush() const { return mBrush; }
3295  QBrush selectedBrush() const { return mSelectedBrush; }
3296 
3297  // setters;
3298  void setPen(const QPen &pen);
3299  void setSelectedPen(const QPen &pen);
3300  void setBrush(const QBrush &brush);
3301  void setSelectedBrush(const QBrush &brush);
3302 
3303  // reimplemented virtual methods:
3304  virtual double selectTest(const QPointF &pos, bool onlySelectable, QVariant *details=0) const;
3305 
3317 
3318 protected:
3319  enum AnchorIndex {aiTopLeftRim, aiTop, aiTopRightRim, aiRight, aiBottomRightRim, aiBottom, aiBottomLeftRim, aiLeft, aiCenter};
3320 
3321  // property members:
3322  QPen mPen, mSelectedPen;
3323  QBrush mBrush, mSelectedBrush;
3324 
3325  // reimplemented virtual methods:
3326  virtual void draw(QCPPainter *painter);
3327  virtual QPointF anchorPixelPoint(int anchorId) const;
3328 
3329  // non-virtual methods:
3330  QPen mainPen() const;
3331  QBrush mainBrush() const;
3332 };
3333 
3334 
3336 {
3337  Q_OBJECT
3339  Q_PROPERTY(QPixmap pixmap READ pixmap WRITE setPixmap)
3340  Q_PROPERTY(bool scaled READ scaled WRITE setScaled)
3341  Q_PROPERTY(Qt::AspectRatioMode aspectRatioMode READ aspectRatioMode)
3342  Q_PROPERTY(QPen pen READ pen WRITE setPen)
3343  Q_PROPERTY(QPen selectedPen READ selectedPen WRITE setSelectedPen)
3345 public:
3346  QCPItemPixmap(QCustomPlot *parentPlot);
3347  virtual ~QCPItemPixmap();
3348 
3349  // getters:
3350  QPixmap pixmap() const { return mPixmap; }
3351  bool scaled() const { return mScaled; }
3352  Qt::AspectRatioMode aspectRatioMode() const { return mAspectRatioMode; }
3353  QPen pen() const { return mPen; }
3354  QPen selectedPen() const { return mSelectedPen; }
3355 
3356  // setters;
3357  void setPixmap(const QPixmap &pixmap);
3358  void setScaled(bool scaled, Qt::AspectRatioMode aspectRatioMode=Qt::KeepAspectRatio);
3359  void setPen(const QPen &pen);
3360  void setSelectedPen(const QPen &pen);
3361 
3362  // reimplemented virtual methods:
3363  virtual double selectTest(const QPointF &pos, bool onlySelectable, QVariant *details=0) const;
3364 
3373 
3374 protected:
3375  enum AnchorIndex {aiTop, aiTopRight, aiRight, aiBottom, aiBottomLeft, aiLeft};
3376 
3377  // property members:
3378  QPixmap mPixmap;
3379  QPixmap mScaledPixmap;
3380  bool mScaled;
3381  Qt::AspectRatioMode mAspectRatioMode;
3382  QPen mPen, mSelectedPen;
3383 
3384  // reimplemented virtual methods:
3385  virtual void draw(QCPPainter *painter);
3386  virtual QPointF anchorPixelPoint(int anchorId) const;
3387 
3388  // non-virtual methods:
3389  void updateScaledPixmap(QRect finalRect=QRect(), bool flipHorz=false, bool flipVert=false);
3390  QRect getFinalRect(bool *flippedHorz=0, bool *flippedVert=0) const;
3391  QPen mainPen() const;
3392 };
3393 
3394 
3396 {
3397  Q_OBJECT
3399  Q_PROPERTY(QPen pen READ pen WRITE setPen)
3400  Q_PROPERTY(QPen selectedPen READ selectedPen WRITE setSelectedPen)
3401  Q_PROPERTY(QBrush brush READ brush WRITE setBrush)
3402  Q_PROPERTY(QBrush selectedBrush READ selectedBrush WRITE setSelectedBrush)
3403  Q_PROPERTY(double size READ size WRITE setSize)
3404  Q_PROPERTY(TracerStyle style READ style WRITE setStyle)
3405  Q_PROPERTY(QCPGraph* graph READ graph WRITE setGraph)
3406  Q_PROPERTY(double graphKey READ graphKey WRITE setGraphKey)
3407  Q_PROPERTY(bool interpolating READ interpolating WRITE setInterpolating)
3409 public:
3415  enum TracerStyle { tsNone
3416  ,tsPlus
3417  ,tsCrosshair
3418  ,tsCircle
3419  ,tsSquare
3420  };
3421  Q_ENUMS(TracerStyle)
3422 
3423  QCPItemTracer(QCustomPlot *parentPlot);
3424  virtual ~QCPItemTracer();
3425 
3426  // getters:
3427  QPen pen() const { return mPen; }
3428  QPen selectedPen() const { return mSelectedPen; }
3429  QBrush brush() const { return mBrush; }
3430  QBrush selectedBrush() const { return mSelectedBrush; }
3431  double size() const { return mSize; }
3432  TracerStyle style() const { return mStyle; }
3433  QCPGraph *graph() const { return mGraph; }
3434  double graphKey() const { return mGraphKey; }
3435  bool interpolating() const { return mInterpolating; }
3436 
3437  // setters;
3438  void setPen(const QPen &pen);
3439  void setSelectedPen(const QPen &pen);
3440  void setBrush(const QBrush &brush);
3441  void setSelectedBrush(const QBrush &brush);
3442  void setSize(double size);
3443  void setStyle(TracerStyle style);
3444  void setGraph(QCPGraph *graph);
3445  void setGraphKey(double key);
3446  void setInterpolating(bool enabled);
3447 
3448  // reimplemented virtual methods:
3449  virtual double selectTest(const QPointF &pos, bool onlySelectable, QVariant *details=0) const;
3450 
3451  // non-virtual methods:
3452  void updatePosition();
3453 
3455 
3456 protected:
3457  // property members:
3458  QPen mPen, mSelectedPen;
3459  QBrush mBrush, mSelectedBrush;
3460  double mSize;
3463  double mGraphKey;
3465 
3466  // reimplemented virtual methods:
3467  virtual void draw(QCPPainter *painter);
3468 
3469  // non-virtual methods:
3470  QPen mainPen() const;
3471  QBrush mainBrush() const;
3472 };
3473 
3474 
3476 {
3477  Q_OBJECT
3479  Q_PROPERTY(QPen pen READ pen WRITE setPen)
3480  Q_PROPERTY(QPen selectedPen READ selectedPen WRITE setSelectedPen)
3481  Q_PROPERTY(double length READ length WRITE setLength)
3482  Q_PROPERTY(BracketStyle style READ style WRITE setStyle)
3484 public:
3485  enum BracketStyle { bsSquare
3486  ,bsRound
3487  ,bsCurly
3488  ,bsCalligraphic
3489  };
3490 
3491  QCPItemBracket(QCustomPlot *parentPlot);
3492  virtual ~QCPItemBracket();
3493 
3494  // getters:
3495  QPen pen() const { return mPen; }
3496  QPen selectedPen() const { return mSelectedPen; }
3497  double length() const { return mLength; }
3498  BracketStyle style() const { return mStyle; }
3499 
3500  // setters;
3501  void setPen(const QPen &pen);
3502  void setSelectedPen(const QPen &pen);
3503  void setLength(double length);
3504  void setStyle(BracketStyle style);
3505 
3506  // reimplemented virtual methods:
3507  virtual double selectTest(const QPointF &pos, bool onlySelectable, QVariant *details=0) const;
3508 
3512 
3513 protected:
3514  // property members:
3515  enum AnchorIndex {aiCenter};
3516  QPen mPen, mSelectedPen;
3517  double mLength;
3519 
3520  // reimplemented virtual methods:
3521  virtual void draw(QCPPainter *painter);
3522  virtual QPointF anchorPixelPoint(int anchorId) const;
3523 
3524  // non-virtual methods:
3525  QPen mainPen() const;
3526 };
3527 
3528 #endif // QCUSTOMPLOT_H
3529 
@ data
bool operator==(const BatteryInfo &right, const BatteryInfo &left)
Definition: batteryInfo.cpp:44
The abstract base class for all items in a plot.
Definition: qcustomplot.h:1584
QPointer< QCPAxisRect > mClipAxisRect
Definition: qcustomplot.h:1625
bool clipToAxisRect() const
Definition: qcustomplot.h:1597
void selectableChanged(bool selectable)
QList< QCPItemPosition * > positions() const
Returns all positions of the item in a list.
Definition: qcustomplot.h:1612
QList< QCPItemAnchor * > anchors() const
Returns all anchors of the item in a list.
Definition: qcustomplot.h:1613
QList< QCPItemAnchor * > mAnchors
Definition: qcustomplot.h:1627
virtual double selectTest(const QPointF &pos, bool onlySelectable, QVariant *details=0) const =0
This function is used to decide whether a click hits a layerable object or not.
bool selected() const
Definition: qcustomplot.h:1600
void selectionChanged(bool selected)
This signal is emitted when the selection state of this item has changed, either by user interaction ...
virtual void draw(QCPPainter *painter)=0
bool selectable() const
Definition: qcustomplot.h:1599
QList< QCPItemPosition * > mPositions
Definition: qcustomplot.h:1626
The abstract base class for all entries in a QCPLegend.
Definition: qcustomplot.h:2058
QColor selectedTextColor() const
Definition: qcustomplot.h:2077
QCPLegend * parentLegend() const
Definition: qcustomplot.h:2073
QColor textColor() const
Definition: qcustomplot.h:2075
QFont font() const
Definition: qcustomplot.h:2074
void selectionChanged(bool selected)
This signal is emitted when the selection state of this legend item has changed, either by user inter...
virtual void draw(QCPPainter *painter)=0
QCPLegend * mParentLegend
Definition: qcustomplot.h:2098
void selectableChanged(bool selectable)
QFont selectedFont() const
Definition: qcustomplot.h:2076
bool selected() const
Definition: qcustomplot.h:2079
bool selectable() const
Definition: qcustomplot.h:2078
The abstract base class for all data representing objects in a plot.
Definition: qcustomplot.h:1375
void selectableChanged(bool selectable)
This signal is emitted when the selectability of this plottable has changed.
bool antialiasedFill() const
Definition: qcustomplot.h:1396
bool selected() const
Definition: qcustomplot.h:1406
void rescaleAxes(bool onlyEnlarge=false) const
Rescales the key and value axes associated with this plottable to contain all displayed data,...
QCPAxis * keyAxis() const
Definition: qcustomplot.h:1403
virtual QCPRange getKeyRange(bool &foundRange, SignDomain inSignDomain=sdBoth) const =0
virtual double selectTest(const QPointF &pos, bool onlySelectable, QVariant *details=0) const =0
This function is used to decide whether a click hits a layerable object or not.
void selectionChanged(bool selected)
This signal is emitted when the selection state of this plottable has changed, either by user interac...
QPointer< QCPAxis > mKeyAxis
Definition: qcustomplot.h:1451
QString name() const
Definition: qcustomplot.h:1395
SignDomain
Represents negative and positive sign domain for passing to getKeyRange and getValueRange.
Definition: qcustomplot.h:1441
bool antialiasedScatters() const
Definition: qcustomplot.h:1397
virtual void clearData()=0
Clears all data in the plottable.
QBrush brush() const
Definition: qcustomplot.h:1401
virtual void drawLegendIcon(QCPPainter *painter, const QRectF &rect) const =0
void rescaleValueAxis(bool onlyEnlarge=false) const
Rescales the value axis of the plottable so the whole plottable is visible.
virtual QCPRange getValueRange(bool &foundRange, SignDomain inSignDomain=sdBoth) const =0
QPen selectedPen() const
Definition: qcustomplot.h:1400
virtual void draw(QCPPainter *painter)=0
bool antialiasedErrorBars() const
Definition: qcustomplot.h:1398
bool selectable() const
Definition: qcustomplot.h:1405
void rescaleKeyAxis(bool onlyEnlarge=false) const
Rescales the key axis of the plottable so the whole plottable is visible.
QCPAxis * valueAxis() const
Definition: qcustomplot.h:1404
QBrush selectedBrush() const
Definition: qcustomplot.h:1402
QCPLineEnding lowerEnding
Definition: qcustomplot.h:1325
QCache< QString, CachedLabel > mLabelCache
Definition: qcustomplot.h:1361
QCustomPlot * mParentPlot
Definition: qcustomplot.h:1359
QByteArray mLabelParameterHash
Definition: qcustomplot.h:1360
QRect axisSelectionBox() const
Definition: qcustomplot.h:1318
QRect tickLabelsSelectionBox() const
Definition: qcustomplot.h:1319
QVector< QString > tickLabels
Definition: qcustomplot.h:1345
QCPAxis::AxisType type
Definition: qcustomplot.h:1323
QVector< double > tickPositions
Definition: qcustomplot.h:1344
QRect labelSelectionBox() const
Definition: qcustomplot.h:1320
QVector< double > subTickPositions
Definition: qcustomplot.h:1343
Holds multiple axes and arranges them in a rectangular shape.
Definition: qcustomplot.h:1949
QPoint mDragStart
Definition: qcustomplot.h:2032
bool backgroundScaled() const
Definition: qcustomplot.h:1964
Qt::AspectRatioMode backgroundScaledMode() const
Definition: qcustomplot.h:1965
int width() const
Returns the pixel width of this axis rect.
Definition: qcustomplot.h:2005
virtual void update(UpdatePhase phase)
This method is called automatically upon replot and doesn't need to be called by users of QCPAxisRect...
QCPLayoutInset * mInsetLayout
Definition: qcustomplot.h:2025
QPoint bottomRight() const
Returns the bottom right corner of this axis rect in pixels.
Definition: qcustomplot.h:2011
QPixmap mBackgroundPixmap
Definition: qcustomplot.h:2021
int right() const
Returns the pixel position of the right border of this axis rect.
Definition: qcustomplot.h:2002
QCPRange mDragStartHorzRange
Definition: qcustomplot.h:2030
int top() const
Returns the pixel position of the top border of this axis rect.
Definition: qcustomplot.h:2003
virtual void mouseMoveEvent(QMouseEvent *event)
This event is called, if the mouse is moved inside the outer rect of this layout element.
QPixmap background() const
Definition: qcustomplot.h:1963
QBrush mBackgroundBrush
Definition: qcustomplot.h:2020
QPoint topLeft() const
Returns the top left corner of this axis rect in pixels.
Definition: qcustomplot.h:2008
virtual void wheelEvent(QWheelEvent *event)
This event is called, if the mouse wheel is scrolled while the cursor is inside the rect of this layo...
bool mBackgroundScaled
Definition: qcustomplot.h:2023
virtual void mousePressEvent(QMouseEvent *event)
This event is called, if the mouse was pressed while being inside the outer rect of this layout eleme...
QSize size() const
Returns the pixel size of this axis rect.
Definition: qcustomplot.h:2007
QPoint topRight() const
Returns the top right corner of this axis rect in pixels.
Definition: qcustomplot.h:2009
Qt::AspectRatioMode mBackgroundScaledMode
Definition: qcustomplot.h:2024
QCPLayoutInset * insetLayout() const
Returns the inset layout of this axis rect.
Definition: qcustomplot.h:1993
Qt::Orientations rangeZoom() const
Definition: qcustomplot.h:1967
Qt::Orientations rangeDrag() const
Definition: qcustomplot.h:1966
QCP::AntialiasedElements mAADragBackup
Definition: qcustomplot.h:2031
QPixmap mScaledBackgroundPixmap
Definition: qcustomplot.h:2022
Qt::Orientations mRangeDrag
Definition: qcustomplot.h:2026
QPoint bottomLeft() const
Returns the bottom left corner of this axis rect in pixels.
Definition: qcustomplot.h:2010
int height() const
Returns the pixel height of this axis rect.
Definition: qcustomplot.h:2006
int bottom() const
Returns the pixel position of the bottom border of this axis rect.
Definition: qcustomplot.h:2004
double mRangeZoomFactorHorz
Definition: qcustomplot.h:2028
QPoint center() const
Returns the center of this axis rect in pixels.
Definition: qcustomplot.h:2012
virtual void mouseReleaseEvent(QMouseEvent *event)
This event is called, if the mouse was previously pressed inside the outer rect of this layout elemen...
virtual int calculateAutoMargin(QCP::MarginSide side)
QPointer< QCPAxis > mRangeDragHorzAxis
Definition: qcustomplot.h:2027
int left() const
Returns the pixel position of the left border of this axis rect.
Definition: qcustomplot.h:2001
QHash< QCPAxis::AxisType, QList< QCPAxis * > > mAxes
Definition: qcustomplot.h:2034
Manages a single axis inside a QCustomPlot.
Definition: qcustomplot.h:980
Qt::Orientation mOrientation
Definition: qcustomplot.h:1224
QColor labelColor() const
Definition: qcustomplot.h:1115
int padding() const
Definition: qcustomplot.h:1118
void rangeChanged(const QCPRange &newRange)
This signal is emitted when the range of this axis has changed.
QFont selectedTickLabelFont() const
Definition: qcustomplot.h:1122
QFont tickLabelFont() const
Definition: qcustomplot.h:1096
QString mDateTimeFormat
Definition: qcustomplot.h:1240
LabelType tickLabelType() const
Definition: qcustomplot.h:1095
QPen selectedBasePen() const
Definition: qcustomplot.h:1126
QFont selectedLabelFont() const
Definition: qcustomplot.h:1123
bool autoTickStep() const
Definition: qcustomplot.h:1090
QCPGrid * mGrid
Definition: qcustomplot.h:1261
QVector< QString > tickVectorLabels() const
Definition: qcustomplot.h:1105
SelectableParts selectableParts() const
Definition: qcustomplot.h:1121
QCPRange mRange
Definition: qcustomplot.h:1255
QPen basePen() const
Definition: qcustomplot.h:1111
int numberPrecision() const
Definition: qcustomplot.h:1102
QVector< double > mSubTickVector
Definition: qcustomplot.h:1266
QString dateTimeFormat() const
Definition: qcustomplot.h:1099
bool mCachedMarginValid
Definition: qcustomplot.h:1267
bool autoTicks() const
Definition: qcustomplot.h:1087
QString label() const
Definition: qcustomplot.h:1116
void scaleTypeChanged(QCPAxis::ScaleType scaleType)
This signal is emitted when the scale type changes, by calls to setScaleType.
ScaleType
Defines the scale of an axis.
Definition: qcustomplot.h:1061
QFont mLabelFont
Definition: qcustomplot.h:1231
QColor mSelectedTickLabelColor
Definition: qcustomplot.h:1239
int autoTickCount() const
Definition: qcustomplot.h:1088
QColor mLabelColor
Definition: qcustomplot.h:1232
int mCachedMargin
Definition: qcustomplot.h:1268
int mAutoTickCount
Definition: qcustomplot.h:1249
LabelType
When automatic tick label generation is enabled (setAutoTickLabels), defines how the coordinate of th...
Definition: qcustomplot.h:1053
QFont mSelectedTickLabelFont
Definition: qcustomplot.h:1238
double mTickStep
Definition: qcustomplot.h:1248
int mPadding
Definition: qcustomplot.h:1223
QVector< double > tickVector() const
Definition: qcustomplot.h:1104
bool ticks() const
Definition: qcustomplot.h:1092
bool mRangeReversed
Definition: qcustomplot.h:1256
char mNumberFormatChar
Definition: qcustomplot.h:1243
void selectionChanged(const QCPAxis::SelectableParts &parts)
This signal is emitted when the selection state of this axis has changed, either by user interaction ...
QCPGrid * grid() const
Returns the QCPGrid instance belonging to this axis.
Definition: qcustomplot.h:1131
LabelType mTickLabelType
Definition: qcustomplot.h:1237
QCPAxisRect * mAxisRect
Definition: qcustomplot.h:1221
bool mAutoTickLabels
Definition: qcustomplot.h:1235
QPen selectedSubTickPen() const
Definition: qcustomplot.h:1128
QColor selectedTickLabelColor() const
Definition: qcustomplot.h:1124
QPen selectedTickPen() const
Definition: qcustomplot.h:1127
QPen subTickPen() const
Definition: qcustomplot.h:1113
QColor selectedLabelColor() const
Definition: qcustomplot.h:1125
SelectableParts selectedParts() const
Definition: qcustomplot.h:1120
double scaleLogBase() const
Definition: qcustomplot.h:1084
double tickStep() const
Definition: qcustomplot.h:1103
QPen mSelectedTickPen
Definition: qcustomplot.h:1252
bool autoTickLabels() const
Definition: qcustomplot.h:1089
static Qt::Orientation orientation(AxisType type)
Returns the orientation of the specified axis type.
Definition: qcustomplot.h:1206
QColor tickLabelColor() const
Definition: qcustomplot.h:1097
AxisType axisType() const
Definition: qcustomplot.h:1081
QPen mSelectedSubTickPen
Definition: qcustomplot.h:1253
void selectableChanged(const QCPAxis::SelectableParts &parts)
This signal is emitted when the selectability changes, by calls to setSelectableParts.
QFont labelFont() const
Definition: qcustomplot.h:1114
bool mAutoSubTicks
Definition: qcustomplot.h:1250
void rangeChanged(const QCPRange &newRange, const QCPRange &oldRange)
This is an overloaded member function, provided for convenience. It differs from the above function o...
QVector< double > mTickVector
Definition: qcustomplot.h:1264
bool mTicks
Definition: qcustomplot.h:1247
SelectableParts mSelectableParts
Definition: qcustomplot.h:1225
bool rangeReversed() const
Definition: qcustomplot.h:1086
Qt::Orientation orientation() const
Returns the orientation of this axis.
Definition: qcustomplot.h:1193
int subTickCount() const
Definition: qcustomplot.h:1108
int mHighestVisibleTick
Definition: qcustomplot.h:1263
double mScaleLogBase
Definition: qcustomplot.h:1258
SelectablePart
Defines the selectable parts of an axis.
Definition: qcustomplot.h:1069
const QCPRange range() const
Definition: qcustomplot.h:1085
int mNumberPrecision
Definition: qcustomplot.h:1242
ScaleType scaleType() const
Definition: qcustomplot.h:1083
QPen mBasePen
Definition: qcustomplot.h:1226
ScaleType mScaleType
Definition: qcustomplot.h:1257
AxisType
Defines at which side of the axis rect the axis will appear.
Definition: qcustomplot.h:1040
bool autoSubTicks() const
Definition: qcustomplot.h:1091
bool tickLabels() const
Definition: qcustomplot.h:1093
AxisType mAxisType
Definition: qcustomplot.h:1220
QString mLabel
Definition: qcustomplot.h:1230
Qt::TimeSpec dateTimeSpec() const
Definition: qcustomplot.h:1100
QCPAxisPainterPrivate * mAxisPainter
Definition: qcustomplot.h:1262
QVector< QString > mTickVectorLabels
Definition: qcustomplot.h:1265
bool mNumberBeautifulPowers
Definition: qcustomplot.h:1244
void ticksRequest()
This signal is emitted when setAutoTicks is false and the axis is about to generate tick labels for a...
Qt::TimeSpec mDateTimeSpec
Definition: qcustomplot.h:1241
QCPAxisRect * axisRect() const
Definition: qcustomplot.h:1082
QPen tickPen() const
Definition: qcustomplot.h:1112
Holds the data of one single data point (one bar) for QCPBars.
Definition: qcustomplot.h:2712
double key
Definition: qcustomplot.h:2716
A plottable representing a bar chart in a plot.
Definition: qcustomplot.h:2733
QPointer< QCPBars > mBarAbove
Definition: qcustomplot.h:2775
QCPBarDataMap * data() const
Definition: qcustomplot.h:2748
QCPBars * barBelow() const
Returns the bars plottable that is directly below this bars plottable.
Definition: qcustomplot.h:2746
double mWidth
Definition: qcustomplot.h:2774
QCPBars * barAbove() const
Returns the bars plottable that is directly above this bars plottable.
Definition: qcustomplot.h:2747
double width() const
Definition: qcustomplot.h:2745
QCPBarDataMap * mData
Definition: qcustomplot.h:2773
Defines a color gradient for use with e.g.
Definition: qcustomplot.h:1877
ColorInterpolation mColorInterpolation
Definition: qcustomplot.h:1939
bool periodic() const
Definition: qcustomplot.h:1917
QMap< double, QColor > mColorStops
Definition: qcustomplot.h:1938
QMap< double, QColor > colorStops() const
Definition: qcustomplot.h:1915
bool mColorBufferInvalidated
Definition: qcustomplot.h:1944
ColorInterpolation colorInterpolation() const
Definition: qcustomplot.h:1916
int levelCount() const
Definition: qcustomplot.h:1914
ColorInterpolation
Defines the color spaces in which color interpolation between gradient stops can be performed.
Definition: qcustomplot.h:1885
bool operator!=(const QCPColorGradient &other) const
Definition: qcustomplot.h:1911
GradientPreset
Defines the available presets that can be loaded with loadPreset.
Definition: qcustomplot.h:1894
QVector< QRgb > mColorBuffer
Definition: qcustomplot.h:1943
Holds the two-dimensional data of a QCPColorMap plottable.
Definition: qcustomplot.h:2880
QCPRange mDataBounds
Definition: qcustomplot.h:2921
QCPRange keyRange() const
Definition: qcustomplot.h:2890
QCPRange valueRange() const
Definition: qcustomplot.h:2891
int valueSize() const
Definition: qcustomplot.h:2889
QCPRange mKeyRange
Definition: qcustomplot.h:2917
QCPRange dataBounds() const
Definition: qcustomplot.h:2892
int keySize() const
Definition: qcustomplot.h:2888
bool isEmpty() const
Returns whether this instance carries no data.
Definition: qcustomplot.h:2910
A plottable representing a two-dimensional color map in a plot.
Definition: qcustomplot.h:2929
QCPColorMapData * data() const
Returns a pointer to the internal data storage of type QCPColorMapData.
Definition: qcustomplot.h:2944
bool interpolate() const
Definition: qcustomplot.h:2947
void dataRangeChanged(QCPRange newRange)
This signal is emitted when the data range changes.
bool tightBoundary() const
Definition: qcustomplot.h:2948
QImage mMapImage
Definition: qcustomplot.h:2984
QCPColorMapData * mMapData
Definition: qcustomplot.h:2978
QPointer< QCPColorScale > mColorScale
Definition: qcustomplot.h:2982
void dataScaleTypeChanged(QCPAxis::ScaleType scaleType)
This signal is emitted when the data scale type changes.
QCPColorScale * colorScale() const
Definition: qcustomplot.h:2950
QCPColorGradient mGradient
Definition: qcustomplot.h:2979
QCPAxis::ScaleType mDataScaleType
Definition: qcustomplot.h:2977
QCPAxis::ScaleType dataScaleType() const
Definition: qcustomplot.h:2946
QCPRange mDataRange
Definition: qcustomplot.h:2976
void gradientChanged(QCPColorGradient newGradient)
This signal is emitted when the gradient changes.
bool mTightBoundary
Definition: qcustomplot.h:2981
bool mMapImageInvalidated
Definition: qcustomplot.h:2986
QCPColorGradient gradient() const
Definition: qcustomplot.h:2949
QPixmap mLegendIcon
Definition: qcustomplot.h:2985
QCPRange dataRange() const
Definition: qcustomplot.h:2945
bool mInterpolate
Definition: qcustomplot.h:2980
QCPColorScale * mParentColorScale
Definition: qcustomplot.h:2344
A color scale for use with color coding data such as QCPColorMap.
Definition: qcustomplot.h:2363
QCPAxis::ScaleType mDataScaleType
Definition: qcustomplot.h:2416
void dataRangeChanged(QCPRange newRange)
This signal is emitted when the data range changes.
QPointer< QCPAxis > mColorAxis
Definition: qcustomplot.h:2422
QCPColorGradient gradient() const
Definition: qcustomplot.h:2384
QCPAxis * axis() const
Returns the internal QCPAxis instance of this color scale.
Definition: qcustomplot.h:2380
QCPRange dataRange() const
Definition: qcustomplot.h:2382
QCPRange mDataRange
Definition: qcustomplot.h:2415
void dataScaleTypeChanged(QCPAxis::ScaleType scaleType)
This signal is emitted when the data scale type changes.
void gradientChanged(QCPColorGradient newGradient)
This signal is emitted when the gradient changes.
QPointer< QCPColorScaleAxisRectPrivate > mAxisRect
Definition: qcustomplot.h:2421
QCPAxis::AxisType mType
Definition: qcustomplot.h:2414
QCPAxis::AxisType type() const
Definition: qcustomplot.h:2381
QCPAxis::ScaleType dataScaleType() const
Definition: qcustomplot.h:2383
int barWidth() const
Definition: qcustomplot.h:2386
QCPColorGradient mGradient
Definition: qcustomplot.h:2417
Holds the data of one single data point for QCPCurve.
Definition: qcustomplot.h:2615
A plottable representing a parametric curve in a plot.
Definition: qcustomplot.h:2637
LineStyle lineStyle() const
Definition: qcustomplot.h:2658
QCPScatterStyle mScatterStyle
Definition: qcustomplot.h:2685
LineStyle
Defines how the curve's line is represented visually in the plot.
Definition: qcustomplot.h:2649
QCPCurveDataMap * data() const
Definition: qcustomplot.h:2656
QCPCurveDataMap * mData
Definition: qcustomplot.h:2684
LineStyle mLineStyle
Definition: qcustomplot.h:2686
QCPScatterStyle scatterStyle() const
Definition: qcustomplot.h:2657
Holds the data of one single data point for QCPGraph.
Definition: qcustomplot.h:2444
double key
Definition: qcustomplot.h:2448
double valueErrorMinus
Definition: qcustomplot.h:2450
double keyErrorMinus
Definition: qcustomplot.h:2449
A plottable representing a graph in a plot.
Definition: qcustomplot.h:2467
bool adaptiveSampling() const
Definition: qcustomplot.h:2516
ErrorType errorType() const
Definition: qcustomplot.h:2511
ErrorType mErrorType
Definition: qcustomplot.h:2562
QPointer< QCPGraph > mChannelFillGraph
Definition: qcustomplot.h:2565
QCPScatterStyle scatterStyle() const
Definition: qcustomplot.h:2510
QCPScatterStyle mScatterStyle
Definition: qcustomplot.h:2561
double errorBarSize() const
Definition: qcustomplot.h:2513
double mErrorBarSize
Definition: qcustomplot.h:2563
bool errorBarSkipSymbol() const
Definition: qcustomplot.h:2514
QCPGraph * channelFillGraph() const
Definition: qcustomplot.h:2515
QCPDataMap * mData
Definition: qcustomplot.h:2558
LineStyle mLineStyle
Definition: qcustomplot.h:2560
QPen mErrorPen
Definition: qcustomplot.h:2559
bool mAdaptiveSampling
Definition: qcustomplot.h:2566
QPen errorPen() const
Definition: qcustomplot.h:2512
LineStyle lineStyle() const
Definition: qcustomplot.h:2509
QCPDataMap * data() const
Returns a pointer to the internal data storage of type QCPDataMap.
Definition: qcustomplot.h:2508
bool mErrorBarSkipSymbol
Definition: qcustomplot.h:2564
ErrorType
Defines what kind of error bars are drawn for each data point.
Definition: qcustomplot.h:2497
LineStyle
Defines how the graph's line is represented visually in the plot.
Definition: qcustomplot.h:2485
Responsible for drawing the grid of a QCPAxis.
Definition: qcustomplot.h:930
QPen mPen
Definition: qcustomplot.h:963
QPen pen() const
Definition: qcustomplot.h:947
bool mSubGridVisible
Definition: qcustomplot.h:961
bool antialiasedZeroLine() const
Definition: qcustomplot.h:946
bool mAntialiasedSubGrid
Definition: qcustomplot.h:962
QPen zeroLinePen() const
Definition: qcustomplot.h:949
QCPAxis * mParentAxis
Definition: qcustomplot.h:965
QPen subGridPen() const
Definition: qcustomplot.h:948
bool antialiasedSubGrid() const
Definition: qcustomplot.h:945
bool subGridVisible() const
Definition: qcustomplot.h:944
An anchor of an item to which positions can be attached to.
Definition: qcustomplot.h:1490
QCustomPlot * mParentPlot
Definition: qcustomplot.h:1504
QSet< QCPItemPosition * > mChildren
Definition: qcustomplot.h:1507
QCPAbstractItem * mParentItem
Definition: qcustomplot.h:1505
QString name() const
Definition: qcustomplot.h:1496
virtual QCPItemPosition * toQCPItemPosition()
Returns 0 if this instance is merely a QCPItemAnchor, and a valid pointer of type QCPItemPosition* if...
Definition: qcustomplot.h:1510
A bracket for referencing/highlighting certain parts in the plot.
Definition: qcustomplot.h:3476
QCPItemAnchor *const center
Definition: qcustomplot.h:3511
BracketStyle style() const
Definition: qcustomplot.h:3498
QPen pen() const
Definition: qcustomplot.h:3495
BracketStyle mStyle
Definition: qcustomplot.h:3518
double length() const
Definition: qcustomplot.h:3497
QCPItemPosition *const left
Definition: qcustomplot.h:3509
QCPItemPosition *const right
Definition: qcustomplot.h:3510
QPen selectedPen() const
Definition: qcustomplot.h:3496
A curved line from one point to another.
Definition: qcustomplot.h:3087
QCPItemPosition *const start
Definition: qcustomplot.h:3114
QCPItemPosition *const end
Definition: qcustomplot.h:3117
QCPItemPosition *const endDir
Definition: qcustomplot.h:3116
QPen selectedPen() const
Definition: qcustomplot.h:3101
QCPLineEnding head() const
Definition: qcustomplot.h:3102
QCPItemPosition *const startDir
Definition: qcustomplot.h:3115
QCPLineEnding tail() const
Definition: qcustomplot.h:3103
QPen pen() const
Definition: qcustomplot.h:3100
QCPLineEnding mHead
Definition: qcustomplot.h:3122
An ellipse.
Definition: qcustomplot.h:3279
QCPItemPosition *const topLeft
Definition: qcustomplot.h:3306
QCPItemAnchor *const bottom
Definition: qcustomplot.h:3313
QCPItemAnchor *const bottomLeftRim
Definition: qcustomplot.h:3314
QCPItemAnchor *const topLeftRim
Definition: qcustomplot.h:3308
QCPItemAnchor *const right
Definition: qcustomplot.h:3311
QCPItemAnchor *const bottomRightRim
Definition: qcustomplot.h:3312
QCPItemAnchor *const topRightRim
Definition: qcustomplot.h:3310
QPen pen() const
Definition: qcustomplot.h:3292
QCPItemAnchor *const center
Definition: qcustomplot.h:3316
QPen selectedPen() const
Definition: qcustomplot.h:3293
QCPItemAnchor *const left
Definition: qcustomplot.h:3315
QBrush brush() const
Definition: qcustomplot.h:3294
QCPItemPosition *const bottomRight
Definition: qcustomplot.h:3307
QCPItemAnchor *const top
Definition: qcustomplot.h:3309
QBrush selectedBrush() const
Definition: qcustomplot.h:3295
A line from one point to another.
Definition: qcustomplot.h:3042
QCPItemPosition *const end
Definition: qcustomplot.h:3070
QCPLineEnding mHead
Definition: qcustomplot.h:3075
QCPItemPosition *const start
Definition: qcustomplot.h:3069
QCPLineEnding head() const
Definition: qcustomplot.h:3057
QPen pen() const
Definition: qcustomplot.h:3055
QCPLineEnding tail() const
Definition: qcustomplot.h:3058
QPen selectedPen() const
Definition: qcustomplot.h:3056
An arbitrary pixmap.
Definition: qcustomplot.h:3336
QCPItemAnchor *const bottomLeft
Definition: qcustomplot.h:3371
QPixmap mPixmap
Definition: qcustomplot.h:3378
QPen selectedPen() const
Definition: qcustomplot.h:3354
QPixmap mScaledPixmap
Definition: qcustomplot.h:3379
QCPItemPosition *const topLeft
Definition: qcustomplot.h:3365
Qt::AspectRatioMode aspectRatioMode() const
Definition: qcustomplot.h:3352
QPen pen() const
Definition: qcustomplot.h:3353
QCPItemAnchor *const topRight
Definition: qcustomplot.h:3368
QPixmap pixmap() const
Definition: qcustomplot.h:3350
bool scaled() const
Definition: qcustomplot.h:3351
QCPItemAnchor *const left
Definition: qcustomplot.h:3372
Qt::AspectRatioMode mAspectRatioMode
Definition: qcustomplot.h:3381
QCPItemPosition *const bottomRight
Definition: qcustomplot.h:3366
QCPItemAnchor *const right
Definition: qcustomplot.h:3369
QCPItemAnchor *const bottom
Definition: qcustomplot.h:3370
QCPItemAnchor *const top
Definition: qcustomplot.h:3367
Manages the position of an item.
Definition: qcustomplot.h:1525
QCPItemAnchor * mParentAnchor
Definition: qcustomplot.h:1572
QCPAxis * valueAxis() const
Definition: qcustomplot.h:1553
virtual QCPItemPosition * toQCPItemPosition()
Returns 0 if this instance is merely a QCPItemAnchor, and a valid pointer of type QCPItemPosition* if...
Definition: qcustomplot.h:1575
QPointer< QCPAxis > mKeyAxis
Definition: qcustomplot.h:1569
double key() const
Definition: qcustomplot.h:1549
QCPAxis * keyAxis() const
Definition: qcustomplot.h:1552
QPointF coords() const
Definition: qcustomplot.h:1551
PositionType
Defines the ways an item position can be specified.
Definition: qcustomplot.h:1533
PositionType type() const
Definition: qcustomplot.h:1547
PositionType mPositionType
Definition: qcustomplot.h:1568
double value() const
Definition: qcustomplot.h:1550
QPointer< QCPAxisRect > mAxisRect
Definition: qcustomplot.h:1570
QCPItemAnchor * parentAnchor() const
Definition: qcustomplot.h:1548
A rectangle.
Definition: qcustomplot.h:3133
QBrush selectedBrush() const
Definition: qcustomplot.h:3149
QBrush mBrush
Definition: qcustomplot.h:3174
QPen pen() const
Definition: qcustomplot.h:3146
QCPItemPosition *const bottomRight
Definition: qcustomplot.h:3161
QBrush brush() const
Definition: qcustomplot.h:3148
QCPItemAnchor *const topRight
Definition: qcustomplot.h:3163
QCPItemAnchor *const right
Definition: qcustomplot.h:3164
QCPItemAnchor *const top
Definition: qcustomplot.h:3162
QCPItemAnchor *const bottom
Definition: qcustomplot.h:3165
QCPItemPosition *const topLeft
Definition: qcustomplot.h:3160
QCPItemAnchor *const left
Definition: qcustomplot.h:3167
QCPItemAnchor *const bottomLeft
Definition: qcustomplot.h:3166
QPen selectedPen() const
Definition: qcustomplot.h:3147
A straight line that spans infinitely in both directions.
Definition: qcustomplot.h:3003
QPen pen() const
Definition: qcustomplot.h:3014
QCPItemPosition *const point1
Definition: qcustomplot.h:3024
QCPItemPosition *const point2
Definition: qcustomplot.h:3025
QPen selectedPen() const
Definition: qcustomplot.h:3015
A text label.
Definition: qcustomplot.h:3187
double rotation() const
Definition: qcustomplot.h:3220
QColor color() const
Definition: qcustomplot.h:3209
QCPItemPosition *const position
Definition: qcustomplot.h:3241
Qt::Alignment positionAlignment() const
Definition: qcustomplot.h:3218
QBrush mBrush
Definition: qcustomplot.h:3257
QBrush brush() const
Definition: qcustomplot.h:3213
QString mText
Definition: qcustomplot.h:3259
QBrush selectedBrush() const
Definition: qcustomplot.h:3214
QFont font() const
Definition: qcustomplot.h:3215
QMargins padding() const
Definition: qcustomplot.h:3221
QCPItemAnchor *const top
Definition: qcustomplot.h:3243
QCPItemAnchor *const topLeft
Definition: qcustomplot.h:3242
QCPItemAnchor *const bottomLeft
Definition: qcustomplot.h:3248
Qt::Alignment mPositionAlignment
Definition: qcustomplot.h:3260
QColor selectedColor() const
Definition: qcustomplot.h:3210
QPen pen() const
Definition: qcustomplot.h:3211
QFont selectedFont() const
Definition: qcustomplot.h:3216
QColor mColor
Definition: qcustomplot.h:3255
QPen selectedPen() const
Definition: qcustomplot.h:3212
QCPItemAnchor *const bottomRight
Definition: qcustomplot.h:3246
QCPItemAnchor *const bottom
Definition: qcustomplot.h:3247
Qt::Alignment textAlignment() const
Definition: qcustomplot.h:3219
QCPItemAnchor *const left
Definition: qcustomplot.h:3249
double mRotation
Definition: qcustomplot.h:3262
Qt::Alignment mTextAlignment
Definition: qcustomplot.h:3261
QCPItemAnchor *const topRight
Definition: qcustomplot.h:3244
QString text() const
Definition: qcustomplot.h:3217
QMargins mPadding
Definition: qcustomplot.h:3263
QCPItemAnchor *const right
Definition: qcustomplot.h:3245
Item that sticks to QCPGraph data points.
Definition: qcustomplot.h:3396
QCPGraph * mGraph
Definition: qcustomplot.h:3462
TracerStyle
The different visual appearances a tracer item can have.
Definition: qcustomplot.h:3415
double size() const
Definition: qcustomplot.h:3431
QCPItemPosition *const position
Definition: qcustomplot.h:3454
QBrush brush() const
Definition: qcustomplot.h:3429
QPen pen() const
Definition: qcustomplot.h:3427
double mGraphKey
Definition: qcustomplot.h:3463
double graphKey() const
Definition: qcustomplot.h:3434
QCPGraph * graph() const
Definition: qcustomplot.h:3433
QPen selectedPen() const
Definition: qcustomplot.h:3428
QBrush selectedBrush() const
Definition: qcustomplot.h:3430
bool interpolating() const
Definition: qcustomplot.h:3435
TracerStyle mStyle
Definition: qcustomplot.h:3461
TracerStyle style() const
Definition: qcustomplot.h:3432
A layer that may contain objects, to control the rendering order.
Definition: qcustomplot.h:365
int mIndex
Definition: qcustomplot.h:392
QList< QCPLayerable * > children() const
Returns a list of all layerables on this layer.
Definition: qcustomplot.h:382
bool mVisible
Definition: qcustomplot.h:394
QCustomPlot * mParentPlot
Definition: qcustomplot.h:390
QString name() const
Definition: qcustomplot.h:380
QCustomPlot * parentPlot() const
Definition: qcustomplot.h:379
QList< QCPLayerable * > mChildren
Definition: qcustomplot.h:393
QString mName
Definition: qcustomplot.h:391
bool visible() const
Definition: qcustomplot.h:383
int index() const
Returns the index this layer has in the QCustomPlot.
Definition: qcustomplot.h:381
Base class for all drawable objects.
Definition: qcustomplot.h:408
QPointer< QCPLayerable > mParentLayerable
Definition: qcustomplot.h:447
bool mAntialiased
Definition: qcustomplot.h:449
QCustomPlot * parentPlot() const
Definition: qcustomplot.h:423
QCPLayer * layer() const
Definition: qcustomplot.h:425
bool antialiased() const
Definition: qcustomplot.h:426
QCustomPlot * mParentPlot
Definition: qcustomplot.h:446
QCPLayer * mLayer
Definition: qcustomplot.h:448
QCPLayerable * parentLayerable() const
Returns the parent layerable of this layerable.
Definition: qcustomplot.h:424
void layerChanged(QCPLayer *newLayer)
This signal is emitted when the layer of this layerable changes, i.e.
virtual void draw(QCPPainter *painter)=0
bool visible() const
Definition: qcustomplot.h:422
virtual void applyDefaultAntialiasingHint(QCPPainter *painter) const =0
The abstract base class for all objects that form the layout system.
Definition: qcustomplot.h:629
UpdatePhase
Defines the phases of the update process, that happens just before a replot.
Definition: qcustomplot.h:645
virtual void mouseMoveEvent(QMouseEvent *event)
This event is called, if the mouse is moved inside the outer rect of this layout element.
Definition: qcustomplot.h:699
QRect rect() const
Returns the inner rect of this layout element.
Definition: qcustomplot.h:656
QCP::MarginSides autoMargins() const
Definition: qcustomplot.h:660
QRect outerRect() const
Definition: qcustomplot.h:657
virtual void mousePressEvent(QMouseEvent *event)
This event is called, if the mouse was pressed while being inside the outer rect of this layout eleme...
Definition: qcustomplot.h:698
virtual void wheelEvent(QWheelEvent *event)
This event is called, if the mouse wheel is scrolled while the cursor is inside the rect of this layo...
Definition: qcustomplot.h:702
QCPLayout * layout() const
Returns the parent layout of this layout element.
Definition: qcustomplot.h:655
virtual void draw(QCPPainter *painter)
Definition: qcustomplot.h:706
QMargins minimumMargins() const
Definition: qcustomplot.h:659
QSize minimumSize() const
Definition: qcustomplot.h:661
QCPMarginGroup * marginGroup(QCP::MarginSide side) const
Definition: qcustomplot.h:663
virtual void mouseDoubleClickEvent(QMouseEvent *event)
This event is called, if the mouse is double-clicked inside the outer rect of this layout element.
Definition: qcustomplot.h:701
QMargins mMargins
Definition: qcustomplot.h:691
QHash< QCP::MarginSide, QCPMarginGroup * > marginGroups() const
Definition: qcustomplot.h:664
virtual void mouseReleaseEvent(QMouseEvent *event)
This event is called, if the mouse was previously pressed inside the outer rect of this layout elemen...
Definition: qcustomplot.h:700
QCPLayout * mParentLayout
Definition: qcustomplot.h:688
QHash< QCP::MarginSide, QCPMarginGroup * > mMarginGroups
Definition: qcustomplot.h:693
virtual void applyDefaultAntialiasingHint(QCPPainter *painter) const
Definition: qcustomplot.h:705
QMargins margins() const
Definition: qcustomplot.h:658
QCP::MarginSides mAutoMargins
Definition: qcustomplot.h:692
QSize maximumSize() const
Definition: qcustomplot.h:662
A layout that arranges child elements in a grid.
Definition: qcustomplot.h:757
QList< QList< QCPLayoutElement * > > mElements
Definition: qcustomplot.h:808
QList< double > mRowStretchFactors
Definition: qcustomplot.h:810
int rowSpacing() const
Definition: qcustomplot.h:777
QList< double > columnStretchFactors() const
Definition: qcustomplot.h:774
QList< double > rowStretchFactors() const
Definition: qcustomplot.h:775
QList< double > mColumnStretchFactors
Definition: qcustomplot.h:809
int columnSpacing() const
Definition: qcustomplot.h:776
A layout that places child elements aligned to the border or arbitrarily positioned.
Definition: qcustomplot.h:823
QList< Qt::Alignment > mInsetAlignment
Definition: qcustomplot.h:863
QList< InsetPlacement > mInsetPlacement
Definition: qcustomplot.h:862
InsetPlacement
Defines how the placement and sizing is handled for a certain element in a QCPLayoutInset.
Definition: qcustomplot.h:829
QList< QCPLayoutElement * > mElements
Definition: qcustomplot.h:861
QList< QRectF > mInsetRect
Definition: qcustomplot.h:864
virtual void simplify()
The QCPInsetLayout does not need simplification since it can never have empty cells due to its linear...
Definition: qcustomplot.h:852
The abstract base class for layouts.
Definition: qcustomplot.h:719
virtual int elementCount() const =0
Returns the number of elements/cells in the layout.
virtual QCPLayoutElement * takeAt(int index)=0
Removes the element with the given index from the layout and returns it.
virtual bool take(QCPLayoutElement *element)=0
Removes the specified element from the layout and returns true on success.
virtual QCPLayoutElement * elementAt(int index) const =0
Returns the element in the cell with the given index.
Manages a legend inside a QCustomPlot.
Definition: qcustomplot.h:2146
SelectableParts mSelectableParts
Definition: qcustomplot.h:2240
int iconTextPadding() const
Definition: qcustomplot.h:2186
QSize mIconSize
Definition: qcustomplot.h:2238
QColor mTextColor
Definition: qcustomplot.h:2237
QFont selectedFont() const
Definition: qcustomplot.h:2193
QPen mBorderPen
Definition: qcustomplot.h:2234
SelectablePart
Defines the selectable parts of a legend.
Definition: qcustomplot.h:2170
QFont mFont
Definition: qcustomplot.h:2236
QPen iconBorderPen() const
Definition: qcustomplot.h:2187
QPen mSelectedBorderPen
Definition: qcustomplot.h:2241
QColor mSelectedTextColor
Definition: qcustomplot.h:2244
QBrush selectedBrush() const
Definition: qcustomplot.h:2192
void selectionChanged(QCPLegend::SelectableParts parts)
This signal is emitted when the selection state of this legend has changed.
QPen borderPen() const
Definition: qcustomplot.h:2181
QFont mSelectedFont
Definition: qcustomplot.h:2243
void selectableChanged(QCPLegend::SelectableParts parts)
int mIconTextPadding
Definition: qcustomplot.h:2239
QBrush mBrush
Definition: qcustomplot.h:2235
QColor textColor() const
Definition: qcustomplot.h:2184
QBrush brush() const
Definition: qcustomplot.h:2182
QBrush mSelectedBrush
Definition: qcustomplot.h:2242
QColor selectedTextColor() const
Definition: qcustomplot.h:2194
SelectableParts selectableParts() const
Definition: qcustomplot.h:2188
QPen selectedIconBorderPen() const
Definition: qcustomplot.h:2191
QPen selectedBorderPen() const
Definition: qcustomplot.h:2190
QFont font() const
Definition: qcustomplot.h:2183
QSize iconSize() const
Definition: qcustomplot.h:2185
Handles the different ending decorations for line-like items.
Definition: qcustomplot.h:872
EndingStyle style() const
Definition: qcustomplot.h:903
bool inverted() const
Definition: qcustomplot.h:906
EndingStyle mStyle
Definition: qcustomplot.h:922
EndingStyle
Defines the type of ending decoration for line-like items, e.g.
Definition: qcustomplot.h:887
double width() const
Definition: qcustomplot.h:904
double mLength
Definition: qcustomplot.h:923
double length() const
Definition: qcustomplot.h:905
A margin group allows synchronization of margin sides if working with multiple layout elements.
Definition: qcustomplot.h:600
QCustomPlot * mParentPlot
Definition: qcustomplot.h:613
QHash< QCP::MarginSide, QList< QCPLayoutElement * > > mChildren
Definition: qcustomplot.h:614
QList< QCPLayoutElement * > elements(QCP::MarginSide side) const
Returns a list of all layout elements that have their margin side associated with this margin group.
Definition: qcustomplot.h:607
QPainter subclass used internally.
Definition: qcustomplot.h:312
QStack< bool > mAntialiasingStack
Definition: qcustomplot.h:359
PainterMode
Defines special modes the painter can operate in.
Definition: qcustomplot.h:319
bool antialiasing() const
Definition: qcustomplot.h:332
bool mIsAntialiasing
Definition: qcustomplot.h:356
void drawLine(const QPointF &p1, const QPointF &p2)
Definition: qcustomplot.h:346
PainterModes modes() const
Definition: qcustomplot.h:333
PainterModes mModes
Definition: qcustomplot.h:355
A layout element displaying a plot title text.
Definition: qcustomplot.h:2270
QString mText
Definition: qcustomplot.h:2312
QColor textColor() const
Definition: qcustomplot.h:2288
QFont font() const
Definition: qcustomplot.h:2287
void selectionChanged(bool selected)
This signal is emitted when the selection state has changed to selected, either by user interaction o...
QFont selectedFont() const
Definition: qcustomplot.h:2289
QColor mTextColor
Definition: qcustomplot.h:2314
void selectableChanged(bool selectable)
bool selected() const
Definition: qcustomplot.h:2292
QRect mTextBoundingRect
Definition: qcustomplot.h:2317
QColor mSelectedTextColor
Definition: qcustomplot.h:2316
QFont mSelectedFont
Definition: qcustomplot.h:2315
QString text() const
Definition: qcustomplot.h:2286
bool selectable() const
Definition: qcustomplot.h:2291
QColor selectedTextColor() const
Definition: qcustomplot.h:2290
A legend item representing a plottable with an icon and the plottable name.
Definition: qcustomplot.h:2122
QCPAbstractPlottable * mPlottable
Definition: qcustomplot.h:2132
QCPAbstractPlottable * plottable()
Definition: qcustomplot.h:2128
Represents the range an axis is encompassing.
Definition: qcustomplot.h:476
static const double maxRange
Maximum values (negative and positive) the range will accept in range-changing functions.
Definition: qcustomplot.h:509
QCPRange & operator/=(const double &value)
Divides both boundaries of the range by value.
Definition: qcustomplot.h:489
QCPRange & operator*=(const double &value)
Multiplies both boundaries of the range by value.
Definition: qcustomplot.h:488
QCPRange & operator-=(const double &value)
Subtracts value from both boundaries of the range.
Definition: qcustomplot.h:487
bool operator!=(const QCPRange &other)
Definition: qcustomplot.h:484
bool operator==(const QCPRange &other)
Definition: qcustomplot.h:483
double lower
Definition: qcustomplot.h:478
static const double minRange
Minimum range size (upper - lower) the range changing functions will accept.
Definition: qcustomplot.h:508
double upper
Definition: qcustomplot.h:478
QCPRange & operator+=(const double &value)
Adds value to both boundaries of the range.
Definition: qcustomplot.h:486
Represents the visual appearance of scatter points.
Definition: qcustomplot.h:234
double size() const
Definition: qcustomplot.h:274
bool isPenDefined() const
Returns whether a pen has been defined for this scatter style.
Definition: qcustomplot.h:291
bool isNone() const
Returns whether the scatter shape is ssNone.
Definition: qcustomplot.h:290
QPainterPath mCustomPath
Definition: qcustomplot.h:303
QPixmap pixmap() const
Definition: qcustomplot.h:278
QPen pen() const
Definition: qcustomplot.h:276
ScatterShape
Defines the shape used for scatter points.
Definition: qcustomplot.h:245
QBrush brush() const
Definition: qcustomplot.h:277
QPainterPath customPath() const
Definition: qcustomplot.h:279
ScatterShape shape() const
Definition: qcustomplot.h:275
ScatterShape mShape
Definition: qcustomplot.h:299
A plottable representing a single statistical box in a plot.
Definition: qcustomplot.h:2798
double key() const
Definition: qcustomplot.h:2819
QVector< double > outliers() const
Definition: qcustomplot.h:2825
QVector< double > mOutliers
Definition: qcustomplot.h:2855
QPen whiskerBarPen() const
Definition: qcustomplot.h:2829
double maximum() const
Definition: qcustomplot.h:2824
QPen whiskerPen() const
Definition: qcustomplot.h:2828
double whiskerWidth() const
Definition: qcustomplot.h:2827
double minimum() const
Definition: qcustomplot.h:2820
double median() const
Definition: qcustomplot.h:2822
QCPScatterStyle mOutlierStyle
Definition: qcustomplot.h:2860
double width() const
Definition: qcustomplot.h:2826
QCPScatterStyle outlierStyle() const
Definition: qcustomplot.h:2831
QPen medianPen() const
Definition: qcustomplot.h:2830
double lowerQuartile() const
Definition: qcustomplot.h:2821
double upperQuartile() const
Definition: qcustomplot.h:2823
The central class of the library.
Definition: qcustomplot.h:1657
void legendDoubleClick(QCPLegend *legend, QCPAbstractLegendItem *item, QMouseEvent *event)
This signal is emitted when a legend (item) is double clicked.
QPixmap mScaledBackgroundPixmap
Definition: qcustomplot.h:1835
void beforeReplot()
This signal is emitted immediately before a replot takes place (caused by a call to the slot replot).
Qt::KeyboardModifier mMultiSelectModifier
Definition: qcustomplot.h:1840
QRect viewport() const
Returns the viewport rect of this QCustomPlot instance.
Definition: qcustomplot.h:1695
void titleClick(QMouseEvent *event, QCPPlotTitle *title)
This signal is emitted when a plot title is clicked.
Qt::KeyboardModifier multiSelectModifier() const
Definition: qcustomplot.h:1707
const QCP::Interactions interactions() const
Definition: qcustomplot.h:1703
QPointer< QCPLayoutElement > mMouseEventElement
Definition: qcustomplot.h:1845
QBrush mBackgroundBrush
Definition: qcustomplot.h:1833
RefreshPriority
Defines with what timing the QCustomPlot surface is refreshed after a replot.
Definition: qcustomplot.h:1686
@ rpHint
Whether to use immediate repaint or queued update depends on whether the plotting hint QCP::phForceRe...
Definition: qcustomplot.h:1688
QCPLegend * legend
A pointer to the default legend of the main axis rect.
Definition: qcustomplot.h:1796
void selectionChangedByUser()
This signal is emitted after the user has changed the selection in the QCustomPlot,...
int selectionTolerance() const
Definition: qcustomplot.h:1704
void plottableClick(QCPAbstractPlottable *plottable, QMouseEvent *event)
This signal is emitted when a plottable is clicked.
QPixmap background() const
Definition: qcustomplot.h:1696
QList< QCPAbstractPlottable * > mPlottables
Definition: qcustomplot.h:1825
bool mBackgroundScaled
Definition: qcustomplot.h:1836
QCP::AntialiasedElements antialiasedElements() const
Definition: qcustomplot.h:1700
QList< QCPAbstractItem * > mItems
Definition: qcustomplot.h:1827
void axisDoubleClick(QCPAxis *axis, QCPAxis::SelectablePart part, QMouseEvent *event)
This signal is emitted when an axis is double clicked.
void afterReplot()
This signal is emitted immediately after a replot has taken place (caused by a call to the slot replo...
QList< QCPLayer * > mLayers
Definition: qcustomplot.h:1828
void mouseMove(QMouseEvent *event)
This signal is emitted when the QCustomPlot receives a mouse move event.
QPixmap mPaintBuffer
Definition: qcustomplot.h:1843
QCP::AntialiasedElements notAntialiasedElements() const
Definition: qcustomplot.h:1701
LayerInsertMode
Defines how a layer should be inserted relative to an other layer.
Definition: qcustomplot.h:1676
void legendClick(QCPLegend *legend, QCPAbstractLegendItem *item, QMouseEvent *event)
This signal is emitted when a legend (item) is clicked.
QCPAxis * xAxis
A pointer to the primary x Axis (bottom) of the main axis rect of the plot.
Definition: qcustomplot.h:1795
void mouseDoubleClick(QMouseEvent *event)
This signal is emitted when the QCustomPlot receives a mouse double click event.
QCP::PlottingHints mPlottingHints
Definition: qcustomplot.h:1839
QCPLayer * mCurrentLayer
Definition: qcustomplot.h:1838
QCP::AntialiasedElements mAntialiasedElements
Definition: qcustomplot.h:1829
bool backgroundScaled() const
Definition: qcustomplot.h:1697
bool mAutoAddPlottableToLegend
Definition: qcustomplot.h:1824
bool mReplotting
Definition: qcustomplot.h:1846
Qt::AspectRatioMode mBackgroundScaledMode
Definition: qcustomplot.h:1837
int mSelectionTolerance
Definition: qcustomplot.h:1831
void axisClick(QCPAxis *axis, QCPAxis::SelectablePart part, QMouseEvent *event)
This signal is emitted when an axis is clicked.
QRect mViewport
Definition: qcustomplot.h:1822
bool autoAddPlottableToLegend() const
Definition: qcustomplot.h:1702
QPoint mMousePressPos
Definition: qcustomplot.h:1844
QCP::PlottingHints plottingHints() const
Definition: qcustomplot.h:1706
void mouseWheel(QWheelEvent *event)
This signal is emitted when the QCustomPlot receives a mouse wheel event.
void itemDoubleClick(QCPAbstractItem *item, QMouseEvent *event)
This signal is emitted when an item is double clicked.
bool mNoAntialiasingOnDrag
Definition: qcustomplot.h:1832
void mouseRelease(QMouseEvent *event)
This signal is emitted when the QCustomPlot receives a mouse release event.
QCPLayoutGrid * mPlotLayout
Definition: qcustomplot.h:1823
bool noAntialiasingOnDrag() const
Definition: qcustomplot.h:1705
void mousePress(QMouseEvent *event)
This signal is emitted when the QCustomPlot receives a mouse press event.
void titleDoubleClick(QMouseEvent *event, QCPPlotTitle *title)
This signal is emitted when a plot title is double clicked.
QCP::Interactions mInteractions
Definition: qcustomplot.h:1830
QList< QCPGraph * > mGraphs
Definition: qcustomplot.h:1826
void itemClick(QCPAbstractItem *item, QMouseEvent *event)
This signal is emitted when an item is clicked.
QPixmap mBackgroundPixmap
Definition: qcustomplot.h:1834
QCPLayoutGrid * plotLayout() const
Returns the top level layout of this QCustomPlot instance.
Definition: qcustomplot.h:1699
void plottableDoubleClick(QCPAbstractPlottable *plottable, QMouseEvent *event)
This signal is emitted when a plottable is double clicked.
Qt::AspectRatioMode backgroundScaledMode() const
Definition: qcustomplot.h:1698
int n
The QCP Namespace contains general enums and QFlags used throughout the QCustomPlot library.
Definition: qcustomplot.h:93
bool isInvalidData(double value)
Definition: qcustomplot.h:171
int getMarginValue(const QMargins &margins, QCP::MarginSide side)
Definition: qcustomplot.h:212
Interaction
Defines the mouse interactions possible with QCustomPlot.
Definition: qcustomplot.h:154
@ iSelectLegend
0x020 Legends are selectable (or their child items, see QCPLegend::setSelectableParts)
Definition: qcustomplot.h:159
@ iRangeDrag
0x001 Axis ranges are draggable (see QCPAxisRect::setRangeDrag, QCPAxisRect::setRangeDragAxes)
Definition: qcustomplot.h:154
@ iSelectPlottables
0x008 Plottables are selectable (e.g. graphs, curves, bars,... see QCPAbstractPlottable)
Definition: qcustomplot.h:157
@ iRangeZoom
0x002 Axis ranges are zoomable with the mouse wheel (see QCPAxisRect::setRangeZoom,...
Definition: qcustomplot.h:155
@ iSelectAxes
0x010 Axes are selectable (or parts of them, see QCPAxis::setSelectableParts)
Definition: qcustomplot.h:158
@ iSelectItems
0x040 Items are selectable (Rectangles, Arrows, Textitems, etc. see QCPAbstractItem)
Definition: qcustomplot.h:160
@ iMultiSelect
0x004 The user can select multiple objects by holding the modifier set by QCustomPlot::setMultiSelect...
Definition: qcustomplot.h:156
@ iSelectOther
0x080 All other objects are selectable (e.g. your own derived layerables, the plot title,...
Definition: qcustomplot.h:161
PlottingHint
Defines plotting hints that control various aspects of the quality and speed of plotting.
Definition: qcustomplot.h:138
@ phCacheLabels
0x004 axis (tick) labels will be cached as pixmaps, increasing replot performance.
Definition: qcustomplot.h:143
@ phForceRepaint
0x002 causes an immediate repaint() instead of a soft update() when QCustomPlot::replot() is called w...
Definition: qcustomplot.h:141
@ phFastPolylines
0x001 Graph/Curve lines are drawn with a faster method.
Definition: qcustomplot.h:139
@ phNone
0x000 No hints are set
Definition: qcustomplot.h:138
MarginSide
Defines the sides of a rectangular entity to which margins can be applied.
Definition: qcustomplot.h:99
@ msAll
0xFF all margins
Definition: qcustomplot.h:103
@ msBottom
0x08 bottom margin
Definition: qcustomplot.h:102
@ msTop
0x04 top margin
Definition: qcustomplot.h:101
@ msNone
0x00 no margin
Definition: qcustomplot.h:104
@ msRight
0x02 right margin
Definition: qcustomplot.h:100
@ msLeft
0x01 left margin
Definition: qcustomplot.h:99
AntialiasedElement
Defines what objects of a plot can be forcibly drawn antialiased/not antialiased.
Definition: qcustomplot.h:117
@ aeLegendItems
0x0010 Legend items
Definition: qcustomplot.h:121
@ aeZeroLine
0x0400 Zero-lines, see QCPGrid::setZeroLinePen
Definition: qcustomplot.h:127
@ aePlottables
0x0020 Main lines of plottables (excluding error bars, see element aeErrorBars)
Definition: qcustomplot.h:122
@ aeGrid
0x0002 Grid lines
Definition: qcustomplot.h:118
@ aeFills
0x0200 Borders of fills (e.g. under or between graphs)
Definition: qcustomplot.h:126
@ aeErrorBars
0x0100 Error bars
Definition: qcustomplot.h:125
@ aeLegend
0x0008 Legend box
Definition: qcustomplot.h:120
@ aeAll
0xFFFF All elements
Definition: qcustomplot.h:128
@ aeNone
0x0000 No elements
Definition: qcustomplot.h:129
@ aeSubGrid
0x0004 Sub grid lines
Definition: qcustomplot.h:119
@ aeScatters
0x0080 Scatter symbols of plottables (excluding scatter symbols of type ssPixmap)
Definition: qcustomplot.h:124
@ aeAxes
0x0001 Axis base line and tick marks
Definition: qcustomplot.h:117
@ aeItems
0x0040 Main lines of items
Definition: qcustomplot.h:123
void setMarginValue(QMargins &margins, QCP::MarginSide side, int value)
Definition: qcustomplot.h:192
bool expand(const size_t index, const size_t id, shared_ptr< Data_t > augData)
Definition: clustering.cpp:124
bool lower(Value &a, Value &b)
Definition: main.cpp:337
Q15 opposite(const Q15 v)
Definition: strain.cpp:1183
QMapIterator< double, QCPData > QCPDataMapIterator
Definition: qcustomplot.h:2462
QMap< double, QCPCurveData > QCPCurveDataMap
Container for storing QCPCurveData items in a sorted fashion.
Definition: qcustomplot.h:2631
QMutableMapIterator< double, QCPData > QCPDataMutableMapIterator
Definition: qcustomplot.h:2463
const QCPRange operator/(const QCPRange &range, double value)
Divides both boundaries of the range by value.
Definition: qcustomplot.h:591
const QCPRange operator*(const QCPRange &range, double value)
Multiplies both boundaries of the range by value.
Definition: qcustomplot.h:571
#define QCP_LIB_DECL
Definition: qcustomplot.h:86
QMutableMapIterator< double, QCPBarData > QCPBarDataMutableMapIterator
Definition: qcustomplot.h:2729
const QCPRange operator-(const QCPRange &range, double value)
Subtracts value from both boundaries of the range.
Definition: qcustomplot.h:561
QMap< double, QCPData > QCPDataMap
Container for storing QCPData items in a sorted fashion.
Definition: qcustomplot.h:2461
QMap< double, QCPBarData > QCPBarDataMap
Container for storing QCPBarData items in a sorted fashion.
Definition: qcustomplot.h:2727
QMutableMapIterator< double, QCPCurveData > QCPCurveDataMutableMapIterator
Definition: qcustomplot.h:2633
QMapIterator< double, QCPBarData > QCPBarDataMapIterator
Definition: qcustomplot.h:2728
Q_DECLARE_TYPEINFO(QCPScatterStyle, Q_MOVABLE_TYPE)
QMapIterator< double, QCPCurveData > QCPCurveDataMapIterator
Definition: qcustomplot.h:2632
const QCPRange operator+(const QCPRange &range, double value)
Adds value to both boundaries of the range.
Definition: qcustomplot.h:541
grid on
Definition: show_eyes_axes.m:5
degrees offset
Definition: sine.m:4