29 #include <QtCore/qglobal.h> 32 #ifdef QCUSTOMPLOT_USE_OPENGL 33 # if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) 34 # define QCP_OPENGL_PBUFFER 36 # define QCP_OPENGL_FBO 38 # if QT_VERSION >= QT_VERSION_CHECK(5, 3, 0) 39 # define QCP_OPENGL_OFFSCREENSURFACE 43 #if QT_VERSION >= QT_VERSION_CHECK(5, 4, 0) 44 # define QCP_DEVICEPIXELRATIO_SUPPORTED 45 # if QT_VERSION >= QT_VERSION_CHECK(5, 6, 0) 46 # define QCP_DEVICEPIXELRATIO_FLOAT 50 #include <QtCore/QObject> 51 #include <QtCore/QPointer> 52 #include <QtCore/QSharedPointer> 53 #include <QtCore/QTimer> 54 #include <QtGui/QPainter> 55 #include <QtGui/QPaintEvent> 56 #include <QtGui/QMouseEvent> 57 #include <QtGui/QWheelEvent> 58 #include <QtGui/QPixmap> 59 #include <QtCore/QVector> 60 #include <QtCore/QString> 61 #include <QtCore/QDateTime> 62 #include <QtCore/QMultiMap> 63 #include <QtCore/QFlags> 64 #include <QtCore/QDebug> 65 #include <QtCore/QStack> 66 #include <QtCore/QCache> 67 #include <QtCore/QMargins> 72 # include <QtGui/QOpenGLContext> 73 # include <QtGui/QOpenGLFramebufferObject> 74 # ifdef QCP_OPENGL_OFFSCREENSURFACE 75 # include <QtGui/QOffscreenSurface> 77 # include <QtGui/QWindow> 80 #ifdef QCP_OPENGL_PBUFFER 81 # include <QtOpenGL/QGLPixelBuffer> 83 #if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) 84 # include <qnumeric.h> 85 # include <QtGui/QWidget> 86 # include <QtGui/QPrinter> 87 # include <QtGui/QPrintEngine> 90 # include <QtWidgets/QWidget> 91 # include <QtPrintSupport/QtPrintSupport> 118 #define QCUSTOMPLOT_VERSION_STR "2.0.1" 119 #define QCUSTOMPLOT_VERSION 0x020001 122 #if defined(QT_STATIC_BUILD) 123 # define QCP_LIB_DECL 124 #elif defined(QCUSTOMPLOT_COMPILE_LIBRARY) 125 # define QCP_LIB_DECL Q_DECL_EXPORT 126 #elif defined(QCUSTOMPLOT_USE_LIBRARY) 127 # define QCP_LIB_DECL Q_DECL_IMPORT 129 # define QCP_LIB_DECL 133 #ifndef Q_DECL_OVERRIDE 134 # define Q_DECL_OVERRIDE 154 Q_FLAGS(AntialiasedElements)
156 Q_FLAGS(PlottingHints)
158 Q_FLAGS(Interactions)
309 inline bool isInvalidData(
double value)
311 return qIsNaN(value) || qIsInf(value);
319 inline bool isInvalidData(
double value1,
double value2)
321 return isInvalidData(value1) || isInvalidData(value2);
330 inline void setMarginValue(QMargins &margins,
QCP::MarginSide side,
int value)
336 case QCP::msTop: margins.setTop(value);
break;
338 case QCP::msAll: margins = QMargins(value, value, value, value);
break;
350 inline int getMarginValue(
const QMargins &margins,
QCP::MarginSide side)
364 extern const QMetaObject staticMetaObject;
367 Q_DECLARE_OPERATORS_FOR_FLAGS(QCP::AntialiasedElements)
368 Q_DECLARE_OPERATORS_FOR_FLAGS(QCP::PlottingHints)
369 Q_DECLARE_OPERATORS_FOR_FLAGS(QCP::MarginSides)
370 Q_DECLARE_OPERATORS_FOR_FLAGS(QCP::Interactions)
391 QCPVector2D(
double x,
double y);
392 QCPVector2D(
const QPoint &point);
393 QCPVector2D(
const QPointF &point);
396 double x()
const {
return mX; }
397 double y()
const {
return mY; }
398 double &rx() {
return mX; }
399 double &ry() {
return mY; }
402 void setX(
double x) { mX = x; }
403 void setY(
double y) { mY = y; }
406 double length()
const {
return qSqrt(mX*mX+mY*mY); }
408 QPoint
toPoint()
const {
return QPoint(mX, mY); }
411 bool isNull()
const {
return qIsNull(mX) && qIsNull(mY); }
413 QCPVector2D normalized()
const;
415 double dot(
const QCPVector2D &vec)
const {
return mX*vec.mX+mY*vec.mY; }
416 double distanceSquaredToLine(
const QCPVector2D &start,
const QCPVector2D &end)
const;
417 double distanceSquaredToLine(
const QLineF &line)
const;
418 double distanceToStraightLine(
const QCPVector2D &base,
const QCPVector2D &direction)
const;
420 QCPVector2D &operator*=(
double factor);
421 QCPVector2D &operator/=(
double divisor);
422 QCPVector2D &operator+=(
const QCPVector2D &vector);
423 QCPVector2D &operator-=(
const QCPVector2D &vector);
429 friend inline const QCPVector2D operator*(
double factor,
const QCPVector2D &vec);
430 friend inline const QCPVector2D operator*(
const QCPVector2D &vec,
double factor);
431 friend inline const QCPVector2D operator/(
const QCPVector2D &vec,
double divisor);
432 friend inline const QCPVector2D operator+(
const QCPVector2D &vec1,
const QCPVector2D &vec2);
433 friend inline const QCPVector2D operator-(
const QCPVector2D &vec1,
const QCPVector2D &vec2);
434 friend inline const QCPVector2D operator-(
const QCPVector2D &vec);
451 d.nospace() <<
"QCPVector2D(" << vec.x() <<
", " << vec.y() <<
")";
472 ,pmNonCosmetic = 0x04
475 Q_FLAGS(PainterModes)
482 bool antialiasing()
const {
return testRenderHint(QPainter::Antialiasing); }
483 PainterModes modes()
const {
return mModes; }
486 void setAntialiasing(
bool enabled);
488 void setModes(PainterModes modes);
492 void setPen(
const QPen &pen);
493 void setPen(
const QColor &color);
494 void setPen(Qt::PenStyle penStyle);
495 void drawLine(
const QLineF &line);
501 void makeNonCosmetic();
506 bool mIsAntialiasing;
509 QStack<bool> mAntialiasingStack;
511 Q_DECLARE_OPERATORS_FOR_FLAGS(QCPPainter::PainterModes)
527 QSize size()
const {
return mSize; }
528 bool invalidated()
const {
return mInvalidated; }
529 double devicePixelRatio()
const {
return mDevicePixelRatio; }
532 void setSize(
const QSize &size);
533 void setInvalidated(
bool invalidated=
true);
534 void setDevicePixelRatio(
double ratio);
539 virtual void draw(
QCPPainter *painter)
const = 0;
540 virtual void clear(
const QColor &color) = 0;
545 double mDevicePixelRatio;
551 virtual void reallocateBuffer() = 0;
562 virtual QCPPainter *startPainting() Q_DECL_OVERRIDE;
563 virtual void draw(
QCPPainter *painter)
const Q_DECL_OVERRIDE;
564 void clear(
const QColor &color) Q_DECL_OVERRIDE;
571 virtual void reallocateBuffer() Q_DECL_OVERRIDE;
575 #ifdef QCP_OPENGL_PBUFFER 579 explicit QCPPaintBufferGlPbuffer(
const QSize &size,
double devicePixelRatio,
int multisamples);
580 virtual ~QCPPaintBufferGlPbuffer();
583 virtual QCPPainter *startPainting() Q_DECL_OVERRIDE;
584 virtual void draw(
QCPPainter *painter)
const Q_DECL_OVERRIDE;
585 void clear(
const QColor &color) Q_DECL_OVERRIDE;
593 virtual void reallocateBuffer() Q_DECL_OVERRIDE;
595 #endif // QCP_OPENGL_PBUFFER 598 #ifdef QCP_OPENGL_FBO 602 explicit QCPPaintBufferGlFbo(
const QSize &size,
double devicePixelRatio, QWeakPointer<QOpenGLContext> glContext, QWeakPointer<QOpenGLPaintDevice> glPaintDevice);
603 virtual ~QCPPaintBufferGlFbo();
606 virtual QCPPainter *startPainting() Q_DECL_OVERRIDE;
607 virtual void donePainting() Q_DECL_OVERRIDE;
608 virtual void draw(
QCPPainter *painter)
const Q_DECL_OVERRIDE;
609 void clear(
const QColor &color) Q_DECL_OVERRIDE;
613 QWeakPointer<QOpenGLContext> mGlContext;
614 QWeakPointer<QOpenGLPaintDevice> mGlPaintDevice;
615 QOpenGLFramebufferObject *mGlFrameBuffer;
618 virtual void reallocateBuffer() Q_DECL_OVERRIDE;
620 #endif // QCP_OPENGL_FBO 632 Q_PROPERTY(
QCustomPlot* parentPlot READ parentPlot)
633 Q_PROPERTY(
QString name READ name)
634 Q_PROPERTY(
int index READ index)
636 Q_PROPERTY(
bool visible READ visible WRITE setVisible)
637 Q_PROPERTY(
LayerMode mode READ mode WRITE setMode)
657 QCustomPlot *parentPlot()
const {
return mParentPlot; }
658 QString name()
const {
return mName; }
659 int index()
const {
return mIndex; }
661 bool visible()
const {
return mVisible; }
665 void setVisible(
bool visible);
681 QWeakPointer<QCPAbstractPaintBuffer> mPaintBuffer;
685 void drawToPaintBuffer();
701 Q_PROPERTY(
bool visible READ visible WRITE
setVisible)
702 Q_PROPERTY(
QCustomPlot* parentPlot READ parentPlot)
705 Q_PROPERTY(
bool antialiased READ antialiased WRITE
setAntialiased)
712 bool visible()
const {
return mVisible; }
713 QCustomPlot *parentPlot()
const {
return mParentPlot; }
715 QCPLayer *layer()
const {
return mLayer; }
716 bool antialiased()
const {
return mAntialiased; }
737 QPointer<QCPLayerable> mParentLayerable;
742 virtual void parentPlotInitialized(
QCustomPlot *parentPlot);
744 virtual QRect clipRect()
const;
745 virtual void applyDefaultAntialiasingHint(
QCPPainter *painter)
const = 0;
748 virtual void selectEvent(
QMouseEvent *event,
bool additive,
const QVariant &details,
bool *selectionStateChanged);
749 virtual void deselectEvent(
bool *selectionStateChanged);
758 void initializeParentPlot(
QCustomPlot *parentPlot);
760 bool moveToLayer(
QCPLayer *layer,
bool prepend);
783 QCPRange(
double lower,
double upper);
785 bool operator==(
const QCPRange& other)
const {
return lower == other.lower && upper == other.upper; }
786 bool operator!=(
const QCPRange& other)
const {
return !(*
this == other); }
794 friend inline const QCPRange operator-(
const QCPRange& range,
double value);
795 friend inline const QCPRange operator*(
const QCPRange& range,
double value);
796 friend inline const QCPRange operator*(
double value,
const QCPRange& range);
797 friend inline const QCPRange operator/(
const QCPRange& range,
double value);
799 double size()
const {
return upper-lower; }
800 double center()
const {
return (upper+lower)*0.5; }
801 void normalize() {
if (lower > upper) qSwap(lower, upper); }
802 void expand(
const QCPRange &otherRange);
803 void expand(
double includeCoord);
805 QCPRange expanded(
double includeCoord)
const;
806 QCPRange bounded(
double lowerBound,
double upperBound)
const;
807 QCPRange sanitizedForLogScale()
const;
808 QCPRange sanitizedForLinScale()
const;
809 bool contains(
double value)
const {
return value >= lower && value <= upper; }
811 static bool validRange(
double lower,
double upper);
812 static bool validRange(
const QCPRange &range);
817 Q_DECLARE_TYPEINFO(
QCPRange, Q_MOVABLE_TYPE);
823 inline QDebug operator<< (QDebug d,
const QCPRange &range)
825 d.nospace() <<
"QCPRange(" << range.lower <<
", " << range.upper <<
")";
901 bool operator==(
const QCPDataRange& other)
const {
return mBegin == other.mBegin && mEnd == other.mEnd; }
902 bool operator!=(
const QCPDataRange& other)
const {
return !(*
this == other); }
905 int begin()
const {
return mBegin; }
906 int end()
const {
return mEnd; }
907 int size()
const {
return mEnd-mBegin; }
915 bool isValid()
const {
return (mEnd >= mBegin) && (mBegin >= 0); }
916 bool isEmpty()
const {
return length() == 0; }
939 bool operator!=(
const QCPDataSelection& other)
const {
return !(*
this == other); }
955 int dataPointCount()
const;
961 void addDataRange(
const QCPDataRange &dataRange,
bool simplify=
true);
963 bool isEmpty()
const {
return mDataRanges.isEmpty(); }
975 inline static bool lessThanDataRangeBegin(
const QCPDataRange &a,
const QCPDataRange &b) {
return a.begin() < b.begin(); }
1070 d.nospace() <<
"QCPDataRange(" << dataRange.begin() <<
", " << dataRange.end() <<
")";
1080 d.nospace() <<
"QCPDataSelection(";
1107 QRect rect()
const {
return mRect; }
1109 QPen pen()
const {
return mPen; }
1110 QBrush brush()
const {
return mBrush; }
1114 void setPen(
const QPen &pen);
1115 void setBrush(
const QBrush &brush);
1118 Q_SLOT
void cancel();
1122 void changed(
const QRect &rect,
QMouseEvent *event);
1123 void canceled(
const QRect &rect,
QInputEvent *event);
1124 void accepted(
const QRect &rect,
QMouseEvent *event);
1138 virtual void keyPressEvent(
QKeyEvent *event);
1141 virtual void applyDefaultAntialiasingHint(
QCPPainter *painter)
const Q_DECL_OVERRIDE;
1142 virtual void draw(
QCPPainter *painter) Q_DECL_OVERRIDE;
1162 bool isEmpty()
const;
1188 Q_PROPERTY(
QCPLayout* layout READ layout)
1189 Q_PROPERTY(QRect rect READ rect)
1190 Q_PROPERTY(QRect outerRect READ outerRect WRITE setOuterRect)
1191 Q_PROPERTY(QMargins margins READ margins WRITE setMargins)
1192 Q_PROPERTY(QMargins minimumMargins READ minimumMargins WRITE setMinimumMargins)
1193 Q_PROPERTY(QSize minimumSize READ minimumSize WRITE setMinimumSize)
1194 Q_PROPERTY(QSize maximumSize READ maximumSize WRITE setMaximumSize)
1195 Q_PROPERTY(
SizeConstraintRect sizeConstraintRect READ sizeConstraintRect WRITE setSizeConstraintRect)
1226 QRect
rect()
const {
return mRect; }
1228 QMargins margins()
const {
return mMargins; }
1229 QMargins minimumMargins()
const {
return mMinimumMargins; }
1230 QCP::MarginSides autoMargins()
const {
return mAutoMargins; }
1231 QSize minimumSize()
const {
return mMinimumSize; }
1232 QSize maximumSize()
const {
return mMaximumSize; }
1238 void setOuterRect(
const QRect &rect);
1239 void setMargins(
const QMargins &margins);
1240 void setMinimumMargins(
const QMargins &margins);
1241 void setAutoMargins(QCP::MarginSides sides);
1242 void setMinimumSize(
const QSize &size);
1243 void setMinimumSize(
int width,
int height);
1244 void setMaximumSize(
const QSize &size);
1245 void setMaximumSize(
int width,
int height);
1247 void setMarginGroup(QCP::MarginSides sides,
QCPMarginGroup *group);
1251 virtual QSize minimumOuterSizeHint()
const;
1252 virtual QSize maximumOuterSizeHint()
const;
1256 virtual double selectTest(
const QPointF &pos,
bool onlySelectable,
QVariant *details=0)
const Q_DECL_OVERRIDE;
1261 QSize mMinimumSize, mMaximumSize;
1263 QRect mRect, mOuterRect;
1264 QMargins mMargins, mMinimumMargins;
1265 QCP::MarginSides mAutoMargins;
1270 virtual void layoutChanged();
1273 virtual void applyDefaultAntialiasingHint(
QCPPainter *painter)
const Q_DECL_OVERRIDE { Q_UNUSED(painter) }
1274 virtual void draw(
QCPPainter *painter) Q_DECL_OVERRIDE { Q_UNUSED(painter) }
1275 virtual void parentPlotInitialized(
QCustomPlot *parentPlot) Q_DECL_OVERRIDE;
1294 virtual void update(
UpdatePhase phase) Q_DECL_OVERRIDE;
1298 virtual int elementCount()
const = 0;
1302 virtual void simplify();
1305 bool removeAt(
int index);
1311 virtual void updateLayout();
1314 void sizeConstraintsChanged()
const;
1331 Q_PROPERTY(
int rowCount READ rowCount)
1332 Q_PROPERTY(
int columnCount READ columnCount)
1333 Q_PROPERTY(
QList<double> columnStretchFactors READ columnStretchFactors WRITE setColumnStretchFactors)
1334 Q_PROPERTY(
QList<double> rowStretchFactors READ rowStretchFactors WRITE setRowStretchFactors)
1335 Q_PROPERTY(
int columnSpacing READ columnSpacing WRITE setColumnSpacing)
1336 Q_PROPERTY(
int rowSpacing READ rowSpacing WRITE setRowSpacing)
1337 Q_PROPERTY(
FillOrder fillOrder READ fillOrder WRITE setFillOrder)
1338 Q_PROPERTY(
int wrap READ wrap WRITE setWrap)
1355 virtual ~QCPLayoutGrid();
1358 int rowCount()
const {
return mElements.size(); }
1359 int columnCount()
const {
return mElements.size() > 0 ? mElements.first().size() : 0; }
1360 QList<double> columnStretchFactors()
const {
return mColumnStretchFactors; }
1361 QList<double> rowStretchFactors()
const {
return mRowStretchFactors; }
1362 int columnSpacing()
const {
return mColumnSpacing; }
1363 int rowSpacing()
const {
return mRowSpacing; }
1364 int wrap()
const {
return mWrap; }
1365 FillOrder fillOrder()
const {
return mFillOrder; }
1368 void setColumnStretchFactor(
int column,
double factor);
1370 void setRowStretchFactor(
int row,
double factor);
1372 void setColumnSpacing(
int pixels);
1373 void setRowSpacing(
int pixels);
1374 void setWrap(
int count);
1375 void setFillOrder(
FillOrder order,
bool rearrange=
true);
1378 virtual void updateLayout() Q_DECL_OVERRIDE;
1379 virtual int elementCount() const Q_DECL_OVERRIDE {
return rowCount()*columnCount(); }
1384 virtual void simplify() Q_DECL_OVERRIDE;
1385 virtual QSize minimumOuterSizeHint()
const Q_DECL_OVERRIDE;
1386 virtual QSize maximumOuterSizeHint()
const Q_DECL_OVERRIDE;
1392 bool hasElement(
int row,
int column);
1393 void expandTo(
int newRowCount,
int newColumnCount);
1394 void insertRow(
int newIndex);
1395 void insertColumn(
int newIndex);
1396 int rowColToIndex(
int row,
int column)
const;
1397 void indexToRowCol(
int index,
int &row,
int &column)
const;
1404 int mColumnSpacing, mRowSpacing;
1431 virtual ~QCPLayoutInset();
1435 Qt::Alignment insetAlignment(
int index) const;
1436 QRectF insetRect(
int index) const;
1440 void setInsetAlignment(
int index,
Qt::Alignment alignment);
1441 void setInsetRect(
int index, const
QRectF &rect);
1444 virtual
void updateLayout() Q_DECL_OVERRIDE;
1445 virtual
int elementCount() const Q_DECL_OVERRIDE;
1449 virtual
void simplify() Q_DECL_OVERRIDE {}
1450 virtual double selectTest(
const QPointF &pos,
bool onlySelectable,
QVariant *details=0)
const Q_DECL_OVERRIDE;
1503 QCPLineEnding(
EndingStyle style,
double width=8,
double length=10,
bool inverted=false);
1507 double width()
const {
return mWidth; }
1508 double length()
const {
return mLength; }
1509 bool inverted()
const {
return mInverted; }
1513 void setWidth(
double width);
1514 void setLength(
double length);
1515 void setInverted(
bool inverted);
1518 double boundingDistance()
const;
1519 double realLength()
const;
1526 double mWidth, mLength;
1555 virtual ~QCPAxisTicker();
1559 int tickCount()
const {
return mTickCount; }
1560 double tickOrigin()
const {
return mTickOrigin; }
1564 void setTickCount(
int count);
1565 void setTickOrigin(
double origin);
1577 virtual double getTickStep(
const QCPRange &range);
1578 virtual int getSubTickCount(
double tickStep);
1579 virtual QString getTickLabel(
double tick,
const QLocale &locale,
QChar formatChar,
int precision);
1586 double pickClosest(
double target,
const QVector<double> &candidates)
const;
1587 double getMantissa(
double input,
double *magnitude=0)
const;
1588 double cleanMantissa(
double input)
const;
1595 Q_DECLARE_METATYPE(QSharedPointer<QCPAxisTicker>)
1609 QString dateTimeFormat()
const {
return mDateTimeFormat; }
1610 Qt::TimeSpec dateTimeSpec()
const {
return mDateTimeSpec; }
1613 void setDateTimeFormat(
const QString &format);
1614 void setDateTimeSpec(Qt::TimeSpec spec);
1615 void setTickOrigin(
double origin);
1616 void setTickOrigin(
const QDateTime &origin);
1619 static QDateTime keyToDateTime(
double key);
1620 static double dateTimeToKey(
const QDateTime dateTime);
1621 static double dateTimeToKey(
const QDate date);
1626 Qt::TimeSpec mDateTimeSpec;
1629 enum DateStrategy {dsNone, dsUniformTimeInDay, dsUniformDayInMonth} mDateStrategy;
1632 virtual double getTickStep(
const QCPRange &range) Q_DECL_OVERRIDE;
1633 virtual int getSubTickCount(
double tickStep) Q_DECL_OVERRIDE;
1634 virtual QString getTickLabel(
double tick,
const QLocale &locale,
QChar formatChar,
int precision) Q_DECL_OVERRIDE;
1664 QString timeFormat()
const {
return mTimeFormat; }
1665 int fieldWidth(
TimeUnit unit)
const {
return mFieldWidth.value(unit); }
1668 void setTimeFormat(
const QString &format);
1669 void setFieldWidth(
TimeUnit unit,
int width);
1677 TimeUnit mSmallestUnit, mBiggestUnit;
1681 virtual double getTickStep(
const QCPRange &range) Q_DECL_OVERRIDE;
1682 virtual int getSubTickCount(
double tickStep) Q_DECL_OVERRIDE;
1683 virtual QString getTickLabel(
double tick,
const QLocale &locale,
QChar formatChar,
int precision) Q_DECL_OVERRIDE;
1715 double tickStep()
const {
return mTickStep; }
1716 ScaleStrategy scaleStrategy()
const {
return mScaleStrategy; }
1719 void setTickStep(
double step);
1728 virtual double getTickStep(
const QCPRange &range) Q_DECL_OVERRIDE;
1745 int subTickCount()
const {
return mSubTickCount; }
1750 void setSubTickCount(
int subTicks);
1754 void addTick(
double position,
const QString &label);
1764 virtual double getTickStep(
const QCPRange &range) Q_DECL_OVERRIDE;
1765 virtual int getSubTickCount(
double tickStep) Q_DECL_OVERRIDE;
1766 virtual QString getTickLabel(
double tick,
const QLocale &locale,
QChar formatChar,
int precision) Q_DECL_OVERRIDE;
1794 QString piSymbol()
const {
return mPiSymbol; }
1795 double piValue()
const {
return mPiValue; }
1796 bool periodicity()
const {
return mPeriodicity; }
1797 FractionStyle fractionStyle()
const {
return mFractionStyle; }
1800 void setPiSymbol(
QString symbol);
1801 void setPiValue(
double pi);
1802 void setPeriodicity(
int multiplesOfPi);
1816 virtual double getTickStep(
const QCPRange &range) Q_DECL_OVERRIDE;
1817 virtual int getSubTickCount(
double tickStep) Q_DECL_OVERRIDE;
1818 virtual QString getTickLabel(
double tick,
const QLocale &locale,
QChar formatChar,
int precision) Q_DECL_OVERRIDE;
1821 void simplifyFraction(
int &numerator,
int &denominator)
const;
1822 QString fractionToString(
int numerator,
int denominator)
const;
1823 QString unicodeFraction(
int numerator,
int denominator)
const;
1824 QString unicodeSuperscript(
int number)
const;
1825 QString unicodeSubscript(
int number)
const;
1841 double logBase()
const {
return mLogBase; }
1842 int subTickCount()
const {
return mSubTickCount; }
1845 void setLogBase(
double base);
1846 void setSubTickCount(
int subTicks);
1854 double mLogBaseLnInv;
1857 virtual double getTickStep(
const QCPRange &range) Q_DECL_OVERRIDE;
1858 virtual int getSubTickCount(
double tickStep) Q_DECL_OVERRIDE;
1872 Q_PROPERTY(
bool subGridVisible READ subGridVisible WRITE setSubGridVisible)
1873 Q_PROPERTY(
bool antialiasedSubGrid READ antialiasedSubGrid WRITE setAntialiasedSubGrid)
1874 Q_PROPERTY(
bool antialiasedZeroLine READ antialiasedZeroLine WRITE setAntialiasedZeroLine)
1875 Q_PROPERTY(
QPen pen READ pen WRITE setPen)
1876 Q_PROPERTY(
QPen subGridPen READ subGridPen WRITE setSubGridPen)
1877 Q_PROPERTY(
QPen zeroLinePen READ zeroLinePen WRITE setZeroLinePen)
1883 bool subGridVisible()
const {
return mSubGridVisible; }
1884 bool antialiasedSubGrid()
const {
return mAntialiasedSubGrid; }
1885 bool antialiasedZeroLine()
const {
return mAntialiasedZeroLine; }
1886 QPen pen()
const {
return mPen; }
1887 QPen subGridPen()
const {
return mSubGridPen; }
1888 QPen zeroLinePen()
const {
return mZeroLinePen; }
1891 void setSubGridVisible(
bool visible);
1892 void setAntialiasedSubGrid(
bool enabled);
1893 void setAntialiasedZeroLine(
bool enabled);
1894 void setPen(
const QPen &pen);
1895 void setSubGridPen(
const QPen &pen);
1896 void setZeroLinePen(
const QPen &pen);
1900 bool mSubGridVisible;
1901 bool mAntialiasedSubGrid, mAntialiasedZeroLine;
1902 QPen mPen, mSubGridPen, mZeroLinePen;
1908 virtual void applyDefaultAntialiasingHint(
QCPPainter *painter)
const Q_DECL_OVERRIDE;
1909 virtual void draw(
QCPPainter *painter) Q_DECL_OVERRIDE;
1912 void drawGridLines(
QCPPainter *painter)
const;
1913 void drawSubGridLines(
QCPPainter *painter)
const;
1923 Q_PROPERTY(
AxisType axisType READ axisType)
1925 Q_PROPERTY(
ScaleType scaleType READ scaleType WRITE setScaleType NOTIFY scaleTypeChanged)
1926 Q_PROPERTY(
QCPRange range READ range WRITE setRange NOTIFY rangeChanged)
1927 Q_PROPERTY(
bool rangeReversed READ rangeReversed WRITE setRangeReversed)
1928 Q_PROPERTY(QSharedPointer<QCPAxisTicker> ticker READ ticker WRITE setTicker)
1929 Q_PROPERTY(
bool ticks READ ticks WRITE setTicks)
1930 Q_PROPERTY(
bool tickLabels READ tickLabels WRITE setTickLabels)
1931 Q_PROPERTY(
int tickLabelPadding READ tickLabelPadding WRITE setTickLabelPadding)
1932 Q_PROPERTY(
QFont tickLabelFont READ tickLabelFont WRITE setTickLabelFont)
1933 Q_PROPERTY(
QColor tickLabelColor READ tickLabelColor WRITE setTickLabelColor)
1934 Q_PROPERTY(
double tickLabelRotation READ tickLabelRotation WRITE setTickLabelRotation)
1935 Q_PROPERTY(
LabelSide tickLabelSide READ tickLabelSide WRITE setTickLabelSide)
1936 Q_PROPERTY(
QString numberFormat READ numberFormat WRITE setNumberFormat)
1937 Q_PROPERTY(
int numberPrecision READ numberPrecision WRITE setNumberPrecision)
1940 Q_PROPERTY(
int tickLengthIn READ tickLengthIn WRITE setTickLengthIn)
1941 Q_PROPERTY(
int tickLengthOut READ tickLengthOut WRITE setTickLengthOut)
1942 Q_PROPERTY(
bool subTicks READ subTicks WRITE setSubTicks)
1943 Q_PROPERTY(
int subTickLengthIn READ subTickLengthIn WRITE setSubTickLengthIn)
1944 Q_PROPERTY(
int subTickLengthOut READ subTickLengthOut WRITE setSubTickLengthOut)
1945 Q_PROPERTY(
QPen basePen READ basePen WRITE setBasePen)
1946 Q_PROPERTY(
QPen tickPen READ tickPen WRITE setTickPen)
1947 Q_PROPERTY(
QPen subTickPen READ subTickPen WRITE setSubTickPen)
1948 Q_PROPERTY(
QFont labelFont READ labelFont WRITE setLabelFont)
1949 Q_PROPERTY(
QColor labelColor READ labelColor WRITE setLabelColor)
1950 Q_PROPERTY(
QString label READ label WRITE setLabel)
1951 Q_PROPERTY(
int labelPadding READ labelPadding WRITE setLabelPadding)
1952 Q_PROPERTY(
int padding READ padding WRITE setPadding)
1953 Q_PROPERTY(
int offset READ offset WRITE setOffset)
1954 Q_PROPERTY(SelectableParts selectedParts READ selectedParts WRITE setSelectedParts NOTIFY selectionChanged)
1955 Q_PROPERTY(SelectableParts selectableParts READ selectableParts WRITE setSelectableParts NOTIFY selectableChanged)
1956 Q_PROPERTY(
QFont selectedTickLabelFont READ selectedTickLabelFont WRITE setSelectedTickLabelFont)
1957 Q_PROPERTY(
QFont selectedLabelFont READ selectedLabelFont WRITE setSelectedLabelFont)
1958 Q_PROPERTY(
QColor selectedTickLabelColor READ selectedTickLabelColor WRITE setSelectedTickLabelColor)
1959 Q_PROPERTY(
QColor selectedLabelColor READ selectedLabelColor WRITE setSelectedLabelColor)
1960 Q_PROPERTY(
QPen selectedBasePen READ selectedBasePen WRITE setSelectedBasePen)
1961 Q_PROPERTY(
QPen selectedTickPen READ selectedTickPen WRITE setSelectedTickPen)
1962 Q_PROPERTY(
QPen selectedSubTickPen READ selectedSubTickPen WRITE setSelectedSubTickPen)
1963 Q_PROPERTY(
QCPLineEnding lowerEnding READ lowerEnding WRITE setLowerEnding)
1964 Q_PROPERTY(
QCPLineEnding upperEnding READ upperEnding WRITE setUpperEnding)
1965 Q_PROPERTY(
QCPGrid* grid READ grid)
1979 Q_DECLARE_FLAGS(AxisTypes,
AxisType)
2003 ,spTickLabels = 0x002
2004 ,spAxisLabel = 0x004
2007 Q_FLAGS(SelectableParts)
2014 AxisType axisType()
const {
return mAxisType; }
2015 QCPAxisRect *axisRect()
const {
return mAxisRect; }
2016 ScaleType scaleType()
const {
return mScaleType; }
2017 const QCPRange range()
const {
return mRange; }
2018 bool rangeReversed()
const {
return mRangeReversed; }
2019 QSharedPointer<QCPAxisTicker>
ticker()
const {
return mTicker; }
2020 bool ticks()
const {
return mTicks; }
2021 bool tickLabels()
const {
return mTickLabels; }
2022 int tickLabelPadding()
const;
2023 QFont tickLabelFont()
const {
return mTickLabelFont; }
2024 QColor tickLabelColor()
const {
return mTickLabelColor; }
2025 double tickLabelRotation()
const;
2028 int numberPrecision()
const {
return mNumberPrecision; }
2031 int tickLengthIn()
const;
2032 int tickLengthOut()
const;
2033 bool subTicks()
const {
return mSubTicks; }
2034 int subTickLengthIn()
const;
2035 int subTickLengthOut()
const;
2036 QPen basePen()
const {
return mBasePen; }
2037 QPen tickPen()
const {
return mTickPen; }
2038 QPen subTickPen()
const {
return mSubTickPen; }
2039 QFont labelFont()
const {
return mLabelFont; }
2040 QColor labelColor()
const {
return mLabelColor; }
2041 QString label()
const {
return mLabel; }
2042 int labelPadding()
const;
2043 int padding()
const {
return mPadding; }
2045 SelectableParts selectedParts()
const {
return mSelectedParts; }
2046 SelectableParts selectableParts()
const {
return mSelectableParts; }
2047 QFont selectedTickLabelFont()
const {
return mSelectedTickLabelFont; }
2048 QFont selectedLabelFont()
const {
return mSelectedLabelFont; }
2049 QColor selectedTickLabelColor()
const {
return mSelectedTickLabelColor; }
2050 QColor selectedLabelColor()
const {
return mSelectedLabelColor; }
2051 QPen selectedBasePen()
const {
return mSelectedBasePen; }
2052 QPen selectedTickPen()
const {
return mSelectedTickPen; }
2053 QPen selectedSubTickPen()
const {
return mSelectedSubTickPen; }
2060 Q_SLOT
void setRange(
const QCPRange &range);
2061 void setRange(
double lower,
double upper);
2062 void setRange(
double position,
double size, Qt::AlignmentFlag alignment);
2063 void setRangeLower(
double lower);
2064 void setRangeUpper(
double upper);
2065 void setRangeReversed(
bool reversed);
2066 void setTicker(QSharedPointer<QCPAxisTicker> ticker);
2067 void setTicks(
bool show);
2068 void setTickLabels(
bool show);
2069 void setTickLabelPadding(
int padding);
2070 void setTickLabelFont(
const QFont &font);
2071 void setTickLabelColor(
const QColor &color);
2072 void setTickLabelRotation(
double degrees);
2074 void setNumberFormat(
const QString &formatCode);
2075 void setNumberPrecision(
int precision);
2076 void setTickLength(
int inside,
int outside=0);
2077 void setTickLengthIn(
int inside);
2078 void setTickLengthOut(
int outside);
2079 void setSubTicks(
bool show);
2080 void setSubTickLength(
int inside,
int outside=0);
2081 void setSubTickLengthIn(
int inside);
2082 void setSubTickLengthOut(
int outside);
2083 void setBasePen(
const QPen &pen);
2084 void setTickPen(
const QPen &pen);
2085 void setSubTickPen(
const QPen &pen);
2086 void setLabelFont(
const QFont &font);
2087 void setLabelColor(
const QColor &color);
2088 void setLabel(
const QString &str);
2089 void setLabelPadding(
int padding);
2090 void setPadding(
int padding);
2091 void setOffset(
int offset);
2092 void setSelectedTickLabelFont(
const QFont &font);
2093 void setSelectedLabelFont(
const QFont &font);
2094 void setSelectedTickLabelColor(
const QColor &color);
2095 void setSelectedLabelColor(
const QColor &color);
2096 void setSelectedBasePen(
const QPen &pen);
2097 void setSelectedTickPen(
const QPen &pen);
2098 void setSelectedSubTickPen(
const QPen &pen);
2099 Q_SLOT
void setSelectableParts(
const QCPAxis::SelectableParts &selectableParts);
2100 Q_SLOT
void setSelectedParts(
const QCPAxis::SelectableParts &selectedParts);
2105 virtual double selectTest(
const QPointF &pos,
bool onlySelectable,
QVariant *details=0)
const Q_DECL_OVERRIDE;
2109 int pixelOrientation()
const {
return rangeReversed() != (orientation()==Qt::Vertical) ? -1 : 1; }
2110 void moveRange(
double diff);
2111 void scaleRange(
double factor);
2112 void scaleRange(
double factor,
double center);
2113 void setScaleRatio(
const QCPAxis *otherAxis,
double ratio=1.0);
2114 void rescale(
bool onlyVisiblePlottables=
false);
2115 double pixelToCoord(
double value)
const;
2116 double coordToPixel(
double value)
const;
2123 static Qt::Orientation
orientation(
AxisType type) {
return type==atBottom||type==atTop ? Qt::Horizontal : Qt::Vertical; }
2127 void rangeChanged(
const QCPRange &newRange);
2130 void selectionChanged(
const QCPAxis::SelectableParts &parts);
2131 void selectableChanged(
const QCPAxis::SelectableParts &parts);
2140 Qt::Orientation mOrientation;
2141 SelectableParts mSelectableParts, mSelectedParts;
2142 QPen mBasePen, mSelectedBasePen;
2147 QFont mLabelFont, mSelectedLabelFont;
2148 QColor mLabelColor, mSelectedLabelColor;
2153 QFont mTickLabelFont, mSelectedTickLabelFont;
2154 QColor mTickLabelColor, mSelectedTickLabelColor;
2155 int mNumberPrecision;
2156 QLatin1Char mNumberFormatChar;
2157 bool mNumberBeautifulPowers;
2163 QPen mTickPen, mSelectedTickPen;
2164 QPen mSubTickPen, mSelectedSubTickPen;
2167 bool mRangeReversed;
2173 QSharedPointer<QCPAxisTicker> mTicker;
2177 bool mCachedMarginValid;
2181 QCP::AntialiasedElements mAADragBackup, mNotAADragBackup;
2184 virtual int calculateMargin();
2187 virtual void applyDefaultAntialiasingHint(
QCPPainter *painter)
const Q_DECL_OVERRIDE;
2188 virtual void draw(
QCPPainter *painter) Q_DECL_OVERRIDE;
2191 virtual void selectEvent(
QMouseEvent *event,
bool additive,
const QVariant &details,
bool *selectionStateChanged) Q_DECL_OVERRIDE;
2192 virtual void deselectEvent(
bool *selectionStateChanged) Q_DECL_OVERRIDE;
2194 virtual void mousePressEvent(
QMouseEvent *event,
const QVariant &details) Q_DECL_OVERRIDE;
2195 virtual void mouseMoveEvent(
QMouseEvent *event,
const QPointF &startPos) Q_DECL_OVERRIDE;
2196 virtual void mouseReleaseEvent(
QMouseEvent *event,
const QPointF &startPos) Q_DECL_OVERRIDE;
2197 virtual void wheelEvent(
QWheelEvent *event) Q_DECL_OVERRIDE;
2200 void setupTickVectors();
2201 QPen getBasePen()
const;
2202 QPen getTickPen()
const;
2203 QPen getSubTickPen()
const;
2204 QFont getTickLabelFont()
const;
2205 QFont getLabelFont()
const;
2206 QColor getTickLabelColor()
const;
2207 QColor getLabelColor()
const;
2216 Q_DECLARE_OPERATORS_FOR_FLAGS(QCPAxis::SelectableParts)
2217 Q_DECLARE_OPERATORS_FOR_FLAGS(QCPAxis::AxisTypes)
2231 virtual int size()
const;
2234 QRect axisSelectionBox()
const {
return mAxisSelectionBox; }
2235 QRect tickLabelsSelectionBox()
const {
return mTickLabelsSelectionBox; }
2236 QRect labelSelectionBox()
const {
return mLabelSelectionBox; }
2246 int tickLabelPadding;
2247 double tickLabelRotation;
2249 bool substituteExponent;
2250 bool numberMultiplyCross;
2251 int tickLengthIn, tickLengthOut, subTickLengthIn, subTickLengthOut;
2252 QPen tickPen, subTickPen;
2253 QFont tickLabelFont;
2255 QRect axisRect, viewportRect;
2257 bool abbreviateDecimalPowers;
2258 bool reversedEndings;
2272 QString basePart, expPart, suffixPart;
2273 QRect baseBounds, expBounds, suffixBounds, totalBounds, rotatedTotalBounds;
2274 QFont baseFont, expFont;
2279 QRect mAxisSelectionBox, mTickLabelsSelectionBox, mLabelSelectionBox;
2281 virtual QByteArray generateLabelParameterHash()
const;
2283 virtual void placeTickLabel(
QCPPainter *painter,
double position,
int distanceToAxis,
const QString &text, QSize *tickLabelsSize);
2287 virtual void getMaxTickLabelSize(
const QFont &font,
const QString &text, QSize *tickLabelsSize)
const;
2316 Q_FLAGS(ScatterProperties)
2352 QCPScatterStyle(const
QPixmap &pixmap);
2356 double size()
const {
return mSize; }
2358 QPen pen()
const {
return mPen; }
2359 QBrush brush()
const {
return mBrush; }
2360 QPixmap pixmap()
const {
return mPixmap; }
2361 QPainterPath customPath()
const {
return mCustomPath; }
2364 void setFromOther(
const QCPScatterStyle &other, ScatterProperties properties);
2365 void setSize(
double size);
2367 void setPen(
const QPen &pen);
2368 void setBrush(
const QBrush &brush);
2369 void setPixmap(
const QPixmap &pixmap);
2373 bool isNone()
const {
return mShape == ssNone; }
2378 void drawShape(
QCPPainter *painter,
double x,
double y)
const;
2393 Q_DECLARE_OPERATORS_FOR_FLAGS(QCPScatterStyle::ScatterProperties)
2408 template <
class DataType>
2409 inline bool qcpLessThanSortKey(
const DataType &a,
const DataType &b) {
return a.sortKey() < b.sortKey(); }
2411 template <
class DataType>
2421 int size()
const {
return mData.size()-mPreallocSize; }
2423 bool autoSqueeze()
const {
return mAutoSqueeze; }
2426 void setAutoSqueeze(
bool enabled);
2433 void add(
const DataType &data);
2434 void removeBefore(
double sortKey);
2435 void removeAfter(
double sortKey);
2436 void remove(
double sortKeyFrom,
double sortKeyTo);
2437 void remove(
double sortKey);
2440 void squeeze(
bool preAllocation=
true,
bool postAllocation=
true);
2442 const_iterator
constBegin()
const {
return mData.constBegin()+mPreallocSize; }
2443 const_iterator
constEnd()
const {
return mData.constEnd(); }
2444 iterator
begin() {
return mData.begin()+mPreallocSize; }
2445 iterator
end() {
return mData.end(); }
2446 const_iterator findBegin(
double sortKey,
bool expandedRange=
true)
const;
2447 const_iterator findEnd(
double sortKey,
bool expandedRange=
true)
const;
2448 const_iterator
at(
int index)
const {
return constBegin()+qBound(0, index, size()); }
2452 void limitIteratorsToDataRange(const_iterator &begin, const_iterator &end,
const QCPDataRange &dataRange)
const;
2461 int mPreallocIteration;
2464 void preallocateGrow(
int minimumPreallocSize);
2465 void performAutoSqueeze();
2606 template <
class DataType>
2610 mPreallocIteration(0)
2622 template <
class DataType>
2625 if (mAutoSqueeze != enabled)
2627 mAutoSqueeze = enabled;
2629 performAutoSqueeze();
2639 template <
class DataType>
2655 template <
class DataType>
2660 mPreallocIteration = 0;
2671 template <
class DataType>
2677 const int n = data.
size();
2678 const int oldSize =
size();
2680 if (oldSize > 0 && !qcpLessThanSortKey<DataType>(*
constBegin(), *(data.
constEnd()-1)))
2682 if (mPreallocSize < n)
2688 mData.resize(mData.size()+n);
2690 if (oldSize > 0 && !qcpLessThanSortKey<DataType>(*(
constEnd()-n-1), *(
constEnd()-n)))
2691 std::inplace_merge(
begin(),
end()-n,
end(), qcpLessThanSortKey<DataType>);
2703 template <
class DataType>
2710 set(data, alreadySorted);
2714 const int n = data.size();
2715 const int oldSize =
size();
2717 if (alreadySorted && oldSize > 0 && !qcpLessThanSortKey<DataType>(*
constBegin(), *(data.constEnd()-1)))
2719 if (mPreallocSize < n)
2722 std::copy(data.constBegin(), data.constEnd(),
begin());
2725 mData.resize(mData.size()+n);
2726 std::copy(data.constBegin(), data.constEnd(),
end()-n);
2728 std::sort(
end()-n,
end(), qcpLessThanSortKey<DataType>);
2729 if (oldSize > 0 && !qcpLessThanSortKey<DataType>(*(
constEnd()-n-1), *(
constEnd()-n)))
2730 std::inplace_merge(
begin(),
end()-n,
end(), qcpLessThanSortKey<DataType>);
2740 template <
class DataType>
2743 if (
isEmpty() || !qcpLessThanSortKey<DataType>(data, *(
constEnd()-1)))
2746 }
else if (qcpLessThanSortKey<DataType>(data, *
constBegin()))
2748 if (mPreallocSize < 1)
2754 QCPDataContainer<DataType>::iterator insertionPoint = std::lower_bound(
begin(),
end(), data, qcpLessThanSortKey<DataType>);
2755 mData.insert(insertionPoint, data);
2764 template <
class DataType>
2767 QCPDataContainer<DataType>::iterator it =
begin();
2768 QCPDataContainer<DataType>::iterator itEnd = std::lower_bound(
begin(),
end(), DataType::fromSortKey(sortKey), qcpLessThanSortKey<DataType>);
2769 mPreallocSize += itEnd-it;
2771 performAutoSqueeze();
2779 template <
class DataType>
2782 QCPDataContainer<DataType>::iterator it = std::upper_bound(
begin(),
end(), DataType::fromSortKey(sortKey), qcpLessThanSortKey<DataType>);
2783 QCPDataContainer<DataType>::iterator itEnd =
end();
2784 mData.erase(it, itEnd);
2786 performAutoSqueeze();
2796 template <
class DataType>
2799 if (sortKeyFrom >= sortKeyTo ||
isEmpty())
2802 QCPDataContainer<DataType>::iterator it = std::lower_bound(
begin(),
end(), DataType::fromSortKey(sortKeyFrom), qcpLessThanSortKey<DataType>);
2803 QCPDataContainer<DataType>::iterator itEnd = std::upper_bound(it,
end(), DataType::fromSortKey(sortKeyTo), qcpLessThanSortKey<DataType>);
2804 mData.erase(it, itEnd);
2806 performAutoSqueeze();
2818 template <
class DataType>
2821 QCPDataContainer::iterator it = std::lower_bound(
begin(),
end(), DataType::fromSortKey(sortKey), qcpLessThanSortKey<DataType>);
2822 if (it !=
end() && it->sortKey() == sortKey)
2830 performAutoSqueeze();
2838 template <
class DataType>
2842 mPreallocIteration = 0;
2857 template <
class DataType>
2860 std::sort(
begin(),
end(), qcpLessThanSortKey<DataType>);
2873 template <
class DataType>
2878 if (mPreallocSize > 0)
2880 std::copy(
begin(),
end(), mData.begin());
2881 mData.resize(
size());
2884 mPreallocIteration = 0;
2905 template <
class DataType>
2911 QCPDataContainer<DataType>::const_iterator it = std::lower_bound(
constBegin(),
constEnd(), DataType::fromSortKey(sortKey), qcpLessThanSortKey<DataType>);
2932 template <
class DataType>
2938 QCPDataContainer<DataType>::const_iterator it = std::upper_bound(
constBegin(),
constEnd(), DataType::fromSortKey(sortKey), qcpLessThanSortKey<DataType>);
2939 if (expandedRange && it !=
constEnd())
2959 template <
class DataType>
2968 bool haveLower =
false;
2969 bool haveUpper =
false;
2972 QCPDataContainer<DataType>::const_iterator it =
constBegin();
2973 QCPDataContainer<DataType>::const_iterator itEnd =
constEnd();
2976 if (DataType::sortKeyIsMainKey())
2980 if (!qIsNaN(it->mainValue()))
2982 range.lower = it->mainKey();
2992 if (!qIsNaN(it->mainValue()))
2994 range.upper = it->mainKey();
3003 if (!qIsNaN(it->mainValue()))
3005 current = it->mainKey();
3006 if (current < range.lower || !haveLower)
3008 range.lower = current;
3011 if (current > range.upper || !haveUpper)
3013 range.upper = current;
3024 if (!qIsNaN(it->mainValue()))
3026 current = it->mainKey();
3027 if ((current < range.lower || !haveLower) && current < 0)
3029 range.lower = current;
3032 if ((current > range.upper || !haveUpper) && current < 0)
3034 range.upper = current;
3044 if (!qIsNaN(it->mainValue()))
3046 current = it->mainKey();
3047 if ((current < range.lower || !haveLower) && current > 0)
3049 range.lower = current;
3052 if ((current > range.upper || !haveUpper) && current > 0)
3054 range.upper = current;
3062 foundRange = haveLower && haveUpper;
3082 template <
class DataType>
3091 const bool restrictKeyRange = inKeyRange !=
QCPRange();
3092 bool haveLower =
false;
3093 bool haveUpper =
false;
3095 QCPDataContainer<DataType>::const_iterator itBegin =
constBegin();
3096 QCPDataContainer<DataType>::const_iterator itEnd =
constEnd();
3097 if (DataType::sortKeyIsMainKey() && restrictKeyRange)
3100 itEnd =
findEnd(inKeyRange.upper);
3104 for (QCPDataContainer<DataType>::const_iterator it = itBegin; it != itEnd; ++it)
3106 if (restrictKeyRange && (it->mainKey() < inKeyRange.lower || it->mainKey() > inKeyRange.upper))
3108 current = it->valueRange();
3109 if ((current.lower < range.lower || !haveLower) && !qIsNaN(current.lower))
3111 range.lower = current.lower;
3114 if ((current.upper > range.upper || !haveUpper) && !qIsNaN(current.upper))
3116 range.upper = current.upper;
3122 for (QCPDataContainer<DataType>::const_iterator it = itBegin; it != itEnd; ++it)
3124 if (restrictKeyRange && (it->mainKey() < inKeyRange.lower || it->mainKey() > inKeyRange.upper))
3126 current = it->valueRange();
3127 if ((current.lower < range.lower || !haveLower) && current.lower < 0 && !qIsNaN(current.lower))
3129 range.lower = current.lower;
3132 if ((current.upper > range.upper || !haveUpper) && current.upper < 0 && !qIsNaN(current.upper))
3134 range.upper = current.upper;
3140 for (QCPDataContainer<DataType>::const_iterator it = itBegin; it != itEnd; ++it)
3142 if (restrictKeyRange && (it->mainKey() < inKeyRange.lower || it->mainKey() > inKeyRange.upper))
3144 current = it->valueRange();
3145 if ((current.lower < range.lower || !haveLower) && current.lower > 0 && !qIsNaN(current.lower))
3147 range.lower = current.lower;
3150 if ((current.upper > range.upper || !haveUpper) && current.upper > 0 && !qIsNaN(current.upper))
3152 range.upper = current.upper;
3158 foundRange = haveLower && haveUpper;
3170 template <
class DataType>
3174 iteratorRange = iteratorRange.
bounded(dataRange.
bounded(this->dataRange()));
3188 template <
class DataType>
3191 if (minimumPreallocSize <= mPreallocSize)
3194 int newPreallocSize = minimumPreallocSize;
3195 newPreallocSize += (1u<<qBound(4, mPreallocIteration+4, 15)) - 12;
3196 ++mPreallocIteration;
3198 int sizeDifference = newPreallocSize-mPreallocSize;
3199 mData.resize(mData.size()+sizeDifference);
3200 std::copy_backward(mData.begin()+mPreallocSize, mData.end()-sizeDifference, mData.end());
3201 mPreallocSize = newPreallocSize;
3218 template <
class DataType>
3221 const int totalAlloc = mData.capacity();
3222 const int postAllocSize = totalAlloc-mData.size();
3223 const int usedSize =
size();
3224 bool shrinkPostAllocation =
false;
3225 bool shrinkPreAllocation =
false;
3226 if (totalAlloc > 650000)
3228 shrinkPostAllocation = postAllocSize > usedSize*1.5;
3229 shrinkPreAllocation = mPreallocSize*10 > usedSize;
3230 }
else if (totalAlloc > 1000)
3232 shrinkPostAllocation = postAllocSize > usedSize*5;
3233 shrinkPreAllocation = mPreallocSize > usedSize*1.5;
3236 if (shrinkPreAllocation || shrinkPostAllocation)
3237 squeeze(shrinkPreAllocation, shrinkPostAllocation);
3256 QPen pen()
const {
return mPen; }
3257 QBrush brush()
const {
return mBrush; }
3259 QCPScatterStyle::ScatterProperties usedScatterProperties()
const {
return mUsedScatterProperties; }
3262 void setPen(
const QPen &pen);
3263 void setBrush(
const QBrush &brush);
3265 void setUsedScatterProperties(
const QCPScatterStyle::ScatterProperties &properties);
3281 QCPScatterStyle::ScatterProperties mUsedScatterProperties;
3315 QString name()
const {
return mName; }
3316 bool antialiasedFill()
const {
return mAntialiasedFill; }
3317 bool antialiasedScatters()
const {
return mAntialiasedScatters; }
3318 QPen pen()
const {
return mPen; }
3319 QBrush brush()
const {
return mBrush; }
3320 QCPAxis *keyAxis()
const {
return mKeyAxis.data(); }
3321 QCPAxis *valueAxis()
const {
return mValueAxis.data(); }
3323 bool selected()
const {
return !mSelection.isEmpty(); }
3346 void coordsToPixels(
double key,
double value,
double &x,
double &y)
const;
3348 void pixelsToCoords(
double x,
double y,
double &key,
double &value)
const;
3352 void rescaleValueAxis(
bool onlyEnlarge=
false,
bool inKeyRange=
false)
const;
3366 bool mAntialiasedFill, mAntialiasedScatters;
3369 QPointer<QCPAxis> mKeyAxis, mValueAxis;
3375 virtual QRect clipRect()
const Q_DECL_OVERRIDE;
3376 virtual void draw(
QCPPainter *painter) Q_DECL_OVERRIDE = 0;
3378 void applyDefaultAntialiasingHint(
QCPPainter *painter)
const Q_DECL_OVERRIDE;
3380 virtual void selectEvent(
QMouseEvent *event,
bool additive,
const QVariant &details,
bool *selectionStateChanged) Q_DECL_OVERRIDE;
3381 virtual void deselectEvent(
bool *selectionStateChanged) Q_DECL_OVERRIDE;
3384 virtual void drawLegendIcon(
QCPPainter *painter,
const QRectF &rect)
const = 0;
3387 void applyFillAntialiasingHint(
QCPPainter *painter)
const;
3388 void applyScattersAntialiasingHint(
QCPPainter *painter)
const;
3413 QString name()
const {
return mName; }
3414 virtual QPointF pixelPosition()
const;
3424 QSet<QCPItemPosition*> mChildrenX, mChildrenY;
3472 QCPItemAnchor *parentAnchorX()
const {
return mParentAnchorX; }
3473 QCPItemAnchor *parentAnchorY()
const {
return mParentAnchorY; }
3474 double key()
const {
return mKey; }
3475 double value()
const {
return mValue; }
3477 QCPAxis *keyAxis()
const {
return mKeyAxis.data(); }
3478 QCPAxis *valueAxis()
const {
return mValueAxis.data(); }
3480 virtual QPointF pixelPosition()
const Q_DECL_OVERRIDE;
3486 bool setParentAnchor(
QCPItemAnchor *parentAnchor,
bool keepPixelPosition=
false);
3487 bool setParentAnchorX(
QCPItemAnchor *parentAnchor,
bool keepPixelPosition=
false);
3488 bool setParentAnchorY(
QCPItemAnchor *parentAnchor,
bool keepPixelPosition=
false);
3489 void setCoords(
double key,
double value);
3490 void setCoords(
const QPointF &coords);
3493 void setPixelPosition(
const QPointF &pixelPosition);
3498 QPointer<QCPAxis> mKeyAxis, mValueAxis;
3499 QPointer<QCPAxisRect> mAxisRect;
3500 double mKey, mValue;
3517 Q_PROPERTY(
bool clipToAxisRect READ clipToAxisRect WRITE setClipToAxisRect)
3518 Q_PROPERTY(
QCPAxisRect* clipAxisRect READ clipAxisRect WRITE setClipAxisRect)
3519 Q_PROPERTY(
bool selectable READ selectable WRITE setSelectable NOTIFY selectableChanged)
3520 Q_PROPERTY(
bool selected READ selected WRITE setSelected NOTIFY selectionChanged)
3527 bool clipToAxisRect()
const {
return mClipToAxisRect; }
3529 bool selectable()
const {
return mSelectable; }
3530 bool selected()
const {
return mSelected; }
3533 void setClipToAxisRect(
bool clip);
3535 Q_SLOT
void setSelectable(
bool selectable);
3536 Q_SLOT
void setSelected(
bool selected);
3539 virtual double selectTest(
const QPointF &pos,
bool onlySelectable,
QVariant *details=0)
const Q_DECL_OVERRIDE = 0;
3546 bool hasAnchor(
const QString &name)
const;
3549 void selectionChanged(
bool selected);
3550 void selectableChanged(
bool selectable);
3554 bool mClipToAxisRect;
3555 QPointer<QCPAxisRect> mClipAxisRect;
3558 bool mSelectable, mSelected;
3562 virtual QRect clipRect()
const Q_DECL_OVERRIDE;
3563 virtual void applyDefaultAntialiasingHint(
QCPPainter *painter)
const Q_DECL_OVERRIDE;
3564 virtual void draw(
QCPPainter *painter) Q_DECL_OVERRIDE = 0;
3566 virtual void selectEvent(
QMouseEvent *event,
bool additive,
const QVariant &details,
bool *selectionStateChanged) Q_DECL_OVERRIDE;
3567 virtual void deselectEvent(
bool *selectionStateChanged) Q_DECL_OVERRIDE;
3570 virtual QPointF anchorPixelPosition(
int anchorId)
const;
3573 double rectDistance(
const QRectF &rect,
const QPointF &pos,
bool filledRect)
const;
3594 Q_PROPERTY(QRect viewport READ viewport WRITE setViewport)
3595 Q_PROPERTY(
QPixmap background READ background WRITE setBackground)
3596 Q_PROPERTY(
bool backgroundScaled READ backgroundScaled WRITE setBackgroundScaled)
3597 Q_PROPERTY(Qt::AspectRatioMode backgroundScaledMode READ backgroundScaledMode WRITE setBackgroundScaledMode)
3599 Q_PROPERTY(
bool autoAddPlottableToLegend READ autoAddPlottableToLegend WRITE setAutoAddPlottableToLegend)
3600 Q_PROPERTY(
int selectionTolerance READ selectionTolerance WRITE setSelectionTolerance)
3601 Q_PROPERTY(
bool noAntialiasingOnDrag READ noAntialiasingOnDrag WRITE setNoAntialiasingOnDrag)
3602 Q_PROPERTY(Qt::KeyboardModifier multiSelectModifier READ multiSelectModifier WRITE setMultiSelectModifier)
3603 Q_PROPERTY(
bool openGl READ openGl WRITE setOpenGl)
3632 QRect viewport()
const {
return mViewport; }
3633 double bufferDevicePixelRatio()
const {
return mBufferDevicePixelRatio; }
3634 QPixmap background()
const {
return mBackgroundPixmap; }
3635 bool backgroundScaled()
const {
return mBackgroundScaled; }
3636 Qt::AspectRatioMode backgroundScaledMode()
const {
return mBackgroundScaledMode; }
3638 QCP::AntialiasedElements antialiasedElements()
const {
return mAntialiasedElements; }
3639 QCP::AntialiasedElements notAntialiasedElements()
const {
return mNotAntialiasedElements; }
3640 bool autoAddPlottableToLegend()
const {
return mAutoAddPlottableToLegend; }
3641 const QCP::Interactions interactions()
const {
return mInteractions; }
3642 int selectionTolerance()
const {
return mSelectionTolerance; }
3643 bool noAntialiasingOnDrag()
const {
return mNoAntialiasingOnDrag; }
3644 QCP::PlottingHints plottingHints()
const {
return mPlottingHints; }
3645 Qt::KeyboardModifier multiSelectModifier()
const {
return mMultiSelectModifier; }
3648 bool openGl()
const {
return mOpenGl; }
3651 void setViewport(
const QRect &rect);
3652 void setBufferDevicePixelRatio(
double ratio);
3653 void setBackground(
const QPixmap &pm);
3654 void setBackground(
const QPixmap &pm,
bool scaled, Qt::AspectRatioMode mode=Qt::KeepAspectRatioByExpanding);
3655 void setBackground(
const QBrush &brush);
3656 void setBackgroundScaled(
bool scaled);
3657 void setBackgroundScaledMode(Qt::AspectRatioMode mode);
3658 void setAntialiasedElements(
const QCP::AntialiasedElements &antialiasedElements);
3660 void setNotAntialiasedElements(
const QCP::AntialiasedElements ¬AntialiasedElements);
3662 void setAutoAddPlottableToLegend(
bool on);
3663 void setInteractions(
const QCP::Interactions &interactions);
3664 void setInteraction(
const QCP::Interaction &interaction,
bool enabled=
true);
3665 void setSelectionTolerance(
int pixels);
3666 void setNoAntialiasingOnDrag(
bool enabled);
3667 void setPlottingHints(
const QCP::PlottingHints &hints);
3669 void setMultiSelectModifier(Qt::KeyboardModifier modifier);
3672 void setOpenGl(
bool enabled,
int multisampling=16);
3679 bool removePlottable(
int index);
3680 int clearPlottables();
3681 int plottableCount()
const;
3691 bool removeGraph(
int index);
3693 int graphCount()
const;
3700 bool removeItem(
int index);
3702 int itemCount()
const;
3711 bool setCurrentLayer(
const QString &name);
3712 bool setCurrentLayer(
QCPLayer *layer);
3713 int layerCount()
const;
3719 int axisRectCount()
const;
3724 Q_SLOT
void rescaleAxes(
bool onlyVisiblePlottables=
false);
3728 Q_SLOT
void deselectAll();
3735 QPixmap toPixmap(
int width=0,
int height=0,
double scale=1.0);
3736 void toPainter(
QCPPainter *painter,
int width=0,
int height=0);
3758 void selectionChangedByUser();
3759 void beforeReplot();
3765 double mBufferDevicePixelRatio;
3767 bool mAutoAddPlottableToLegend;
3772 QCP::AntialiasedElements mAntialiasedElements, mNotAntialiasedElements;
3773 QCP::Interactions mInteractions;
3774 int mSelectionTolerance;
3775 bool mNoAntialiasingOnDrag;
3778 QPixmap mScaledBackgroundPixmap;
3779 bool mBackgroundScaled;
3780 Qt::AspectRatioMode mBackgroundScaledMode;
3782 QCP::PlottingHints mPlottingHints;
3783 Qt::KeyboardModifier mMultiSelectModifier;
3790 QPoint mMousePressPos;
3791 bool mMouseHasMoved;
3792 QPointer<QCPLayerable> mMouseEventLayerable;
3793 QPointer<QCPLayerable> mMouseSignalLayerable;
3794 QVariant mMouseEventLayerableDetails;
3795 QVariant mMouseSignalLayerableDetails;
3798 int mOpenGlMultisamples;
3799 QCP::AntialiasedElements mOpenGlAntialiasedElementsBackup;
3800 bool mOpenGlCacheLabelsBackup;
3801 #ifdef QCP_OPENGL_FBO 3802 QSharedPointer<QOpenGLContext> mGlContext;
3803 QSharedPointer<QSurface> mGlSurface;
3804 QSharedPointer<QOpenGLPaintDevice> mGlPaintDevice;
3808 virtual QSize minimumSizeHint() const Q_DECL_OVERRIDE;
3809 virtual QSize sizeHint() const Q_DECL_OVERRIDE;
3810 virtual
void paintEvent(
QPaintEvent *event) Q_DECL_OVERRIDE;
3811 virtual
void resizeEvent(
QResizeEvent *event) Q_DECL_OVERRIDE;
3812 virtual
void mouseDoubleClickEvent(
QMouseEvent *event) Q_DECL_OVERRIDE;
3813 virtual
void mousePressEvent(
QMouseEvent *event) Q_DECL_OVERRIDE;
3814 virtual
void mouseMoveEvent(
QMouseEvent *event) Q_DECL_OVERRIDE;
3815 virtual
void mouseReleaseEvent(
QMouseEvent *event) Q_DECL_OVERRIDE;
3816 virtual
void wheelEvent(
QWheelEvent *event) Q_DECL_OVERRIDE;
3820 virtual
void updateLayout();
3821 virtual
void axisRemoved(
QCPAxis *axis);
3822 virtual
void legendRemoved(
QCPLegend *legend);
3823 Q_SLOT virtual
void processRectSelection(QRect rect,
QMouseEvent *event);
3824 Q_SLOT virtual
void processRectZoom(QRect rect,
QMouseEvent *event);
3825 Q_SLOT virtual
void processPointSelection(
QMouseEvent *event);
3829 bool registerGraph(
QCPGraph *graph);
3831 void updateLayerIndices() const;
3835 void setupPaintBuffers();
3837 bool hasInvalidatedPaintBuffers();
3861 virtual ~QCPPlottableInterface1D() {}
3863 virtual int dataCount()
const = 0;
3864 virtual double dataMainKey(
int index)
const = 0;
3865 virtual double dataSortKey(
int index)
const = 0;
3866 virtual double dataMainValue(
int index)
const = 0;
3867 virtual QCPRange dataValueRange(
int index)
const = 0;
3868 virtual QPointF dataPixelPosition(
int index)
const = 0;
3869 virtual bool sortKeyIsMainKey()
const = 0;
3871 virtual int findBegin(
double sortKey,
bool expandedRange=
true)
const = 0;
3872 virtual int findEnd(
double sortKey,
bool expandedRange=
true)
const = 0;
3875 template <
class DataType>
3885 virtual int dataCount()
const Q_DECL_OVERRIDE;
3886 virtual double dataMainKey(
int index)
const Q_DECL_OVERRIDE;
3887 virtual double dataSortKey(
int index)
const Q_DECL_OVERRIDE;
3888 virtual double dataMainValue(
int index)
const Q_DECL_OVERRIDE;
3889 virtual QCPRange dataValueRange(
int index)
const Q_DECL_OVERRIDE;
3890 virtual QPointF dataPixelPosition(
int index)
const Q_DECL_OVERRIDE;
3891 virtual bool sortKeyIsMainKey()
const Q_DECL_OVERRIDE;
3893 virtual int findBegin(
double sortKey,
bool expandedRange=
true)
const Q_DECL_OVERRIDE;
3894 virtual int findEnd(
double sortKey,
bool expandedRange=
true)
const Q_DECL_OVERRIDE;
3897 virtual double selectTest(
const QPointF &pos,
bool onlySelectable,
QVariant *details=0)
const Q_DECL_OVERRIDE;
3902 QSharedPointer<QCPDataContainer<DataType> > mDataContainer;
4103 template <
class DataType>
4110 template <
class DataType>
4118 template <
class DataType>
4121 return mDataContainer->size();
4127 template <
class DataType>
4130 if (index >= 0 && index < mDataContainer->size())
4132 return (mDataContainer->constBegin()+index)->mainKey();
4135 qDebug() << Q_FUNC_INFO <<
"Index out of bounds" << index;
4143 template <
class DataType>
4146 if (index >= 0 && index < mDataContainer->size())
4148 return (mDataContainer->constBegin()+index)->sortKey();
4151 qDebug() << Q_FUNC_INFO <<
"Index out of bounds" << index;
4159 template <
class DataType>
4162 if (index >= 0 && index < mDataContainer->size())
4164 return (mDataContainer->constBegin()+index)->mainValue();
4167 qDebug() << Q_FUNC_INFO <<
"Index out of bounds" << index;
4175 template <
class DataType>
4178 if (index >= 0 && index < mDataContainer->size())
4180 return (mDataContainer->constBegin()+index)->valueRange();
4183 qDebug() << Q_FUNC_INFO <<
"Index out of bounds" << index;
4191 template <
class DataType>
4194 if (index >= 0 && index < mDataContainer->size())
4196 const typename QCPDataContainer<DataType>::const_iterator it = mDataContainer->constBegin()+index;
4200 qDebug() << Q_FUNC_INFO <<
"Index out of bounds" << index;
4208 template <
class DataType>
4211 return DataType::sortKeyIsMainKey();
4221 template <
class DataType>
4225 if ((onlySelectable && mSelectable ==
QCP::stNone) || mDataContainer->isEmpty())
4227 if (!mKeyAxis || !mValueAxis)
4231 double key1, value1, key2, value2;
4235 QCPRange valueRange(value1, value2);
4236 typename QCPDataContainer<DataType>::const_iterator begin = mDataContainer->constBegin();
4237 typename QCPDataContainer<DataType>::const_iterator end = mDataContainer->constEnd();
4238 if (DataType::sortKeyIsMainKey())
4240 begin = mDataContainer->findBegin(keyRange.lower,
false);
4241 end = mDataContainer->findEnd(keyRange.upper,
false);
4246 int currentSegmentBegin = -1;
4247 for (
typename QCPDataContainer<DataType>::const_iterator it=begin; it!=end; ++it)
4249 if (currentSegmentBegin == -1)
4251 if (valueRange.
contains(it->mainValue()) && keyRange.contains(it->mainKey()))
4252 currentSegmentBegin = it-mDataContainer->constBegin();
4253 }
else if (!valueRange.
contains(it->mainValue()) || !keyRange.contains(it->mainKey()))
4256 currentSegmentBegin = -1;
4260 if (currentSegmentBegin != -1)
4270 template <
class DataType>
4273 return mDataContainer->findBegin(sortKey, expandedRange)-mDataContainer->constBegin();
4279 template <
class DataType>
4282 return mDataContainer->findEnd(sortKey, expandedRange)-mDataContainer->constBegin();
4295 template <
class DataType>
4298 if ((onlySelectable && mSelectable ==
QCP::stNone) || mDataContainer->isEmpty())
4300 if (!mKeyAxis || !mValueAxis)
4304 double minDistSqr = (std::numeric_limits<double>::max)();
4305 int minDistIndex = mDataContainer->size();
4307 typename QCPDataContainer<DataType>::const_iterator begin = mDataContainer->constBegin();
4308 typename QCPDataContainer<DataType>::const_iterator end = mDataContainer->constEnd();
4309 if (DataType::sortKeyIsMainKey())
4312 double posKeyMin, posKeyMax, dummy;
4313 pixelsToCoords(pos-
QPointF(mParentPlot->selectionTolerance(), mParentPlot->selectionTolerance()), posKeyMin, dummy);
4314 pixelsToCoords(pos+
QPointF(mParentPlot->selectionTolerance(), mParentPlot->selectionTolerance()), posKeyMax, dummy);
4315 if (posKeyMin > posKeyMax)
4316 qSwap(posKeyMin, posKeyMax);
4317 begin = mDataContainer->findBegin(posKeyMin,
true);
4318 end = mDataContainer->findEnd(posKeyMax,
true);
4322 QCPRange keyRange(mKeyAxis->range());
4323 QCPRange valueRange(mValueAxis->range());
4324 for (
typename QCPDataContainer<DataType>::const_iterator it=begin; it!=end; ++it)
4326 const double mainKey = it->mainKey();
4327 const double mainValue = it->mainValue();
4328 if (keyRange.contains(mainKey) && valueRange.contains(mainValue))
4331 if (currentDistSqr < minDistSqr)
4333 minDistSqr = currentDistSqr;
4334 minDistIndex = it-mDataContainer->constBegin();
4338 if (minDistIndex != mDataContainer->size())
4343 details->setValue(selectionResult);
4344 return qSqrt(minDistSqr);
4357 template <
class DataType>
4360 selectedSegments.clear();
4361 unselectedSegments.clear();
4367 unselectedSegments << QCPDataRange(0,
dataCount());
4387 template <
class DataType>
4392 painter->pen().style() == Qt::SolidLine &&
4397 bool lastIsNan =
false;
4398 const int lineDataSize = lineData.size();
4399 while (i < lineDataSize && (qIsNaN(lineData.at(i).y()) || qIsNaN(lineData.at(i).x())))
4402 while (i < lineDataSize)
4404 if (!qIsNaN(lineData.at(i).y()) && !qIsNaN(lineData.at(i).x()))
4407 painter->
drawLine(lineData.at(i-1), lineData.at(i));
4416 int segmentStart = 0;
4418 const int lineDataSize = lineData.size();
4419 while (i < lineDataSize)
4421 if (qIsNaN(lineData.at(i).y()) || qIsNaN(lineData.at(i).x()) || qIsInf(lineData.at(i).y()))
4423 painter->drawPolyline(lineData.constData()+segmentStart, i-segmentStart);
4429 painter->drawPolyline(lineData.constData()+segmentStart, lineDataSize-segmentStart);
4476 bool operator==(const QCPColorGradient &other) const;
4477 bool operator!=(const QCPColorGradient &other)
const {
return !(*
this == other); }
4480 int levelCount()
const {
return mLevelCount; }
4483 bool periodic()
const {
return mPeriodic; }
4486 void setLevelCount(
int n);
4488 void setColorStopAt(
double position,
const QColor &color);
4490 void setPeriodic(
bool enabled);
4493 void colorize(
const double *data,
const QCPRange &range, QRgb *scanLine,
int n,
int dataIndexFactor=1,
bool logarithmic=
false);
4494 void colorize(
const double *data,
const unsigned char *alpha,
const QCPRange &range, QRgb *scanLine,
int n,
int dataIndexFactor=1,
bool logarithmic=
false);
4495 QRgb color(
double position,
const QCPRange &range,
bool logarithmic=
false);
4497 void clearColorStops();
4509 bool mColorBufferInvalidated;
4512 bool stopsUseAlpha()
const;
4513 void updateColorBuffer();
4544 virtual ~QCPSelectionDecoratorBracket();
4547 QPen bracketPen()
const {
return mBracketPen; }
4548 QBrush bracketBrush()
const {
return mBracketBrush; }
4549 int bracketWidth()
const {
return mBracketWidth; }
4550 int bracketHeight()
const {
return mBracketHeight; }
4551 BracketStyle bracketStyle()
const {
return mBracketStyle; }
4552 bool tangentToData()
const {
return mTangentToData; }
4553 int tangentAverage()
const {
return mTangentAverage; }
4556 void setBracketPen(
const QPen &pen);
4557 void setBracketBrush(
const QBrush &brush);
4558 void setBracketWidth(
int width);
4559 void setBracketHeight(
int height);
4561 void setTangentToData(
bool enabled);
4562 void setTangentAverage(
int pointCount);
4565 virtual void drawBracket(
QCPPainter *painter,
int direction)
const;
4577 bool mTangentToData;
4578 int mTangentAverage;
4597 Q_PROPERTY(
QPixmap background READ background WRITE setBackground)
4598 Q_PROPERTY(
bool backgroundScaled READ backgroundScaled WRITE setBackgroundScaled)
4599 Q_PROPERTY(Qt::AspectRatioMode backgroundScaledMode READ backgroundScaledMode WRITE setBackgroundScaledMode)
4600 Q_PROPERTY(Qt::Orientations rangeDrag READ rangeDrag WRITE setRangeDrag)
4601 Q_PROPERTY(Qt::Orientations rangeZoom READ rangeZoom WRITE setRangeZoom)
4608 QPixmap background()
const {
return mBackgroundPixmap; }
4609 QBrush backgroundBrush()
const {
return mBackgroundBrush; }
4610 bool backgroundScaled()
const {
return mBackgroundScaled; }
4611 Qt::AspectRatioMode backgroundScaledMode()
const {
return mBackgroundScaledMode; }
4612 Qt::Orientations rangeDrag()
const {
return mRangeDrag; }
4613 Qt::Orientations rangeZoom()
const {
return mRangeZoom; }
4614 QCPAxis *rangeDragAxis(Qt::Orientation orientation);
4615 QCPAxis *rangeZoomAxis(Qt::Orientation orientation);
4618 double rangeZoomFactor(Qt::Orientation orientation);
4621 void setBackground(
const QPixmap &pm);
4622 void setBackground(
const QPixmap &pm,
bool scaled, Qt::AspectRatioMode mode=Qt::KeepAspectRatioByExpanding);
4623 void setBackground(
const QBrush &brush);
4624 void setBackgroundScaled(
bool scaled);
4625 void setBackgroundScaledMode(Qt::AspectRatioMode mode);
4626 void setRangeDrag(Qt::Orientations orientations);
4627 void setRangeZoom(Qt::Orientations orientations);
4634 void setRangeZoomFactor(
double horizontalFactor,
double verticalFactor);
4635 void setRangeZoomFactor(
double factor);
4644 bool removeAxis(
QCPAxis *axis);
4647 void zoom(
const QRectF &pixelRect);
4649 void setupFullAxesBox(
bool connectRanges=
false);
4655 int left()
const {
return mRect.left(); }
4656 int right()
const {
return mRect.right(); }
4657 int top()
const {
return mRect.top(); }
4658 int bottom()
const {
return mRect.bottom(); }
4659 int width()
const {
return mRect.width(); }
4660 int height()
const {
return mRect.height(); }
4661 QSize
size()
const {
return mRect.size(); }
4662 QPoint
topLeft()
const {
return mRect.topLeft(); }
4666 QPoint
center()
const {
return mRect.center(); }
4669 virtual void update(
UpdatePhase phase) Q_DECL_OVERRIDE;
4676 QPixmap mScaledBackgroundPixmap;
4677 bool mBackgroundScaled;
4678 Qt::AspectRatioMode mBackgroundScaledMode;
4680 Qt::Orientations mRangeDrag, mRangeZoom;
4683 double mRangeZoomFactorHorz, mRangeZoomFactorVert;
4687 QCP::AntialiasedElements mAADragBackup, mNotAADragBackup;
4692 virtual void applyDefaultAntialiasingHint(
QCPPainter *painter)
const Q_DECL_OVERRIDE;
4693 virtual void draw(
QCPPainter *painter) Q_DECL_OVERRIDE;
4694 virtual int calculateAutoMargin(
QCP::MarginSide side) Q_DECL_OVERRIDE;
4695 virtual void layoutChanged() Q_DECL_OVERRIDE;
4723 Q_PROPERTY(
QCPLegend* parentLegend READ parentLegend)
4724 Q_PROPERTY(
QFont font READ font WRITE setFont)
4725 Q_PROPERTY(
QColor textColor READ textColor WRITE setTextColor)
4726 Q_PROPERTY(
QFont selectedFont READ selectedFont WRITE setSelectedFont)
4727 Q_PROPERTY(
QColor selectedTextColor READ selectedTextColor WRITE setSelectedTextColor)
4735 QCPLegend *parentLegend()
const {
return mParentLegend; }
4736 QFont font()
const {
return mFont; }
4737 QColor textColor()
const {
return mTextColor; }
4738 QFont selectedFont()
const {
return mSelectedFont; }
4739 QColor selectedTextColor()
const {
return mSelectedTextColor; }
4740 bool selectable()
const {
return mSelectable; }
4741 bool selected()
const {
return mSelected; }
4744 void setFont(
const QFont &font);
4745 void setTextColor(
const QColor &color);
4746 void setSelectedFont(
const QFont &font);
4747 void setSelectedTextColor(
const QColor &color);
4749 Q_SLOT
void setSelected(
bool selected);
4763 QFont mSelectedFont;
4764 QColor mSelectedTextColor;
4765 bool mSelectable, mSelected;
4769 virtual void applyDefaultAntialiasingHint(
QCPPainter *painter)
const Q_DECL_OVERRIDE;
4770 virtual QRect clipRect()
const Q_DECL_OVERRIDE;
4771 virtual void draw(
QCPPainter *painter) Q_DECL_OVERRIDE = 0;
4773 virtual void selectEvent(
QMouseEvent *event,
bool additive,
const QVariant &details,
bool *selectionStateChanged) Q_DECL_OVERRIDE;
4774 virtual void deselectEvent(
bool *selectionStateChanged) Q_DECL_OVERRIDE;
4797 virtual void draw(
QCPPainter *painter) Q_DECL_OVERRIDE;
4798 virtual QSize minimumOuterSizeHint()
const Q_DECL_OVERRIDE;
4801 QPen getIconBorderPen()
const;
4802 QColor getTextColor()
const;
4803 QFont getFont()
const;
4811 Q_PROPERTY(
QPen borderPen READ borderPen WRITE setBorderPen)
4813 Q_PROPERTY(
QFont font READ font WRITE setFont)
4814 Q_PROPERTY(
QColor textColor READ textColor WRITE setTextColor)
4815 Q_PROPERTY(QSize iconSize READ iconSize WRITE setIconSize)
4816 Q_PROPERTY(
int iconTextPadding READ iconTextPadding WRITE setIconTextPadding)
4817 Q_PROPERTY(
QPen iconBorderPen READ iconBorderPen WRITE setIconBorderPen)
4818 Q_PROPERTY(SelectableParts selectableParts READ selectableParts WRITE setSelectableParts NOTIFY
selectionChanged)
4819 Q_PROPERTY(SelectableParts selectedParts READ selectedParts WRITE setSelectedParts NOTIFY
selectableChanged)
4820 Q_PROPERTY(
QPen selectedBorderPen READ selectedBorderPen WRITE setSelectedBorderPen)
4821 Q_PROPERTY(
QPen selectedIconBorderPen READ selectedIconBorderPen WRITE setSelectedIconBorderPen)
4822 Q_PROPERTY(
QBrush selectedBrush READ selectedBrush WRITE setSelectedBrush)
4823 Q_PROPERTY(
QFont selectedFont READ selectedFont WRITE setSelectedFont)
4824 Q_PROPERTY(
QColor selectedTextColor READ selectedTextColor WRITE setSelectedTextColor)
4833 ,spLegendBox = 0x001
4837 Q_FLAGS(SelectableParts)
4841 virtual ~QCPLegend();
4844 QPen borderPen()
const {
return mBorderPen; }
4845 QBrush brush()
const {
return mBrush; }
4846 QFont font()
const {
return mFont; }
4847 QColor textColor()
const {
return mTextColor; }
4848 QSize iconSize()
const {
return mIconSize; }
4849 int iconTextPadding()
const {
return mIconTextPadding; }
4850 QPen iconBorderPen()
const {
return mIconBorderPen; }
4851 SelectableParts selectableParts()
const {
return mSelectableParts; }
4852 SelectableParts selectedParts()
const;
4853 QPen selectedBorderPen()
const {
return mSelectedBorderPen; }
4854 QPen selectedIconBorderPen()
const {
return mSelectedIconBorderPen; }
4855 QBrush selectedBrush()
const {
return mSelectedBrush; }
4856 QFont selectedFont()
const {
return mSelectedFont; }
4857 QColor selectedTextColor()
const {
return mSelectedTextColor; }
4860 void setBorderPen(
const QPen &pen);
4862 void setFont(
const QFont &font);
4863 void setTextColor(
const QColor &color);
4864 void setIconSize(
const QSize &size);
4865 void setIconSize(
int width,
int height);
4866 void setIconTextPadding(
int padding);
4867 void setIconBorderPen(
const QPen &pen);
4868 Q_SLOT
void setSelectableParts(
const SelectableParts &selectableParts);
4869 Q_SLOT
void setSelectedParts(
const SelectableParts &selectedParts);
4870 void setSelectedBorderPen(
const QPen &pen);
4871 void setSelectedIconBorderPen(
const QPen &pen);
4872 void setSelectedBrush(
const QBrush &brush);
4873 void setSelectedFont(
const QFont &font);
4874 void setSelectedTextColor(
const QColor &color);
4882 int itemCount()
const;
4886 bool removeItem(
int index);
4897 QPen mBorderPen, mIconBorderPen;
4902 int mIconTextPadding;
4903 SelectableParts mSelectedParts, mSelectableParts;
4904 QPen mSelectedBorderPen, mSelectedIconBorderPen;
4906 QFont mSelectedFont;
4907 QColor mSelectedTextColor;
4910 virtual void parentPlotInitialized(
QCustomPlot *parentPlot) Q_DECL_OVERRIDE;
4912 virtual void applyDefaultAntialiasingHint(
QCPPainter *painter)
const Q_DECL_OVERRIDE;
4913 virtual void draw(
QCPPainter *painter) Q_DECL_OVERRIDE;
4915 virtual void selectEvent(
QMouseEvent *event,
bool additive,
const QVariant &details,
bool *selectionStateChanged) Q_DECL_OVERRIDE;
4916 virtual void deselectEvent(
bool *selectionStateChanged) Q_DECL_OVERRIDE;
4919 QPen getBorderPen()
const;
4928 Q_DECLARE_OPERATORS_FOR_FLAGS(QCPLegend::SelectableParts)
4941 Q_PROPERTY(
QString text READ text WRITE setText)
4957 QString text()
const {
return mText; }
4958 int textFlags()
const {
return mTextFlags; }
4959 QFont font()
const {
return mFont; }
4960 QColor textColor()
const {
return mTextColor; }
4961 QFont selectedFont()
const {
return mSelectedFont; }
4962 QColor selectedTextColor()
const {
return mSelectedTextColor; }
4963 bool selectable()
const {
return mSelectable; }
4964 bool selected()
const {
return mSelected; }
4967 void setText(
const QString &text);
4968 void setTextFlags(
int flags);
4994 QFont mSelectedFont;
4995 QColor mSelectedTextColor;
4996 QRect mTextBoundingRect;
4997 bool mSelectable, mSelected;
5000 virtual void applyDefaultAntialiasingHint(
QCPPainter *painter)
const Q_DECL_OVERRIDE;
5001 virtual void draw(
QCPPainter *painter) Q_DECL_OVERRIDE;
5005 virtual void selectEvent(
QMouseEvent *event,
bool additive,
const QVariant &details,
bool *selectionStateChanged) Q_DECL_OVERRIDE;
5006 virtual void deselectEvent(
bool *selectionStateChanged) Q_DECL_OVERRIDE;
5009 QFont mainFont()
const;
5010 QColor mainTextColor()
const;
5033 bool mGradientImageInvalidated;
5035 using QCPAxisRect::calculateAutoMargin;
5041 virtual void draw(
QCPPainter *painter) Q_DECL_OVERRIDE;
5042 void updateGradientImage();
5043 Q_SLOT
void axisSelectionChanged(QCPAxis::SelectableParts selectedParts);
5044 Q_SLOT
void axisSelectableChanged(QCPAxis::SelectableParts selectableParts);
5054 Q_PROPERTY(
QCPRange dataRange READ dataRange WRITE setDataRange NOTIFY dataRangeChanged)
5055 Q_PROPERTY(
QCPAxis::ScaleType dataScaleType READ dataScaleType WRITE setDataScaleType NOTIFY dataScaleTypeChanged)
5056 Q_PROPERTY(
QCPColorGradient gradient READ gradient WRITE setGradient NOTIFY gradientChanged)
5057 Q_PROPERTY(
QString label READ label WRITE setLabel)
5058 Q_PROPERTY(
int barWidth READ barWidth WRITE setBarWidth)
5059 Q_PROPERTY(
bool rangeDrag READ rangeDrag WRITE setRangeDrag)
5060 Q_PROPERTY(
bool rangeZoom READ rangeZoom WRITE setRangeZoom)
5069 QCPRange dataRange()
const {
return mDataRange; }
5073 int barWidth ()
const {
return mBarWidth; }
5074 bool rangeDrag()
const;
5075 bool rangeZoom()
const;
5079 Q_SLOT
void setDataRange(
const QCPRange &dataRange);
5082 void setLabel(
const QString &str);
5083 void setBarWidth(
int width);
5084 void setRangeDrag(
bool enabled);
5085 void setRangeZoom(
bool enabled);
5089 void rescaleDataRange(
bool onlyVisibleMaps);
5092 virtual void update(
UpdatePhase phase) Q_DECL_OVERRIDE;
5095 void dataRangeChanged(
const QCPRange &newRange);
5108 QPointer<QCPColorScaleAxisRectPrivate> mAxisRect;
5109 QPointer<QCPAxis> mColorAxis;
5112 virtual void applyDefaultAntialiasingHint(
QCPPainter *painter)
const Q_DECL_OVERRIDE;
5167 Q_PROPERTY(
LineStyle lineStyle READ lineStyle WRITE setLineStyle)
5168 Q_PROPERTY(
QCPScatterStyle scatterStyle READ scatterStyle WRITE setScatterStyle)
5169 Q_PROPERTY(
int scatterSkip READ scatterSkip WRITE setScatterSkip)
5170 Q_PROPERTY(
QCPGraph* channelFillGraph READ channelFillGraph WRITE setChannelFillGraph)
5171 Q_PROPERTY(
bool adaptiveSampling READ adaptiveSampling WRITE setAdaptiveSampling)
5194 LineStyle lineStyle()
const {
return mLineStyle; }
5196 int scatterSkip()
const {
return mScatterSkip; }
5197 QCPGraph *channelFillGraph()
const {
return mChannelFillGraph.
data(); }
5198 bool adaptiveSampling()
const {
return mAdaptiveSampling; }
5201 void setData(QSharedPointer<QCPGraphDataContainer> data);
5205 void setScatterSkip(
int skip);
5206 void setChannelFillGraph(
QCPGraph *targetGraph);
5207 void setAdaptiveSampling(
bool enabled);
5211 void addData(
double key,
double value);
5223 QPointer<QCPGraph> mChannelFillGraph;
5224 bool mAdaptiveSampling;
5227 virtual void draw(
QCPPainter *painter) Q_DECL_OVERRIDE;
5228 virtual void drawLegendIcon(
QCPPainter *painter,
const QRectF &rect)
const Q_DECL_OVERRIDE;
5236 virtual void getOptimizedLineData(
QVector<QCPGraphData> *lineData,
const QCPGraphDataContainer::const_iterator &begin,
const QCPGraphDataContainer::const_iterator &end)
const;
5237 virtual void getOptimizedScatterData(
QVector<QCPGraphData> *scatterData, QCPGraphDataContainer::const_iterator begin, QCPGraphDataContainer::const_iterator end)
const;
5240 void getVisibleDataBounds(QCPGraphDataContainer::const_iterator &begin, QCPGraphDataContainer::const_iterator &end,
const QCPDataRange &rangeRestriction)
const;
5250 bool segmentsIntersect(
double aLower,
double aUpper,
double bLower,
double bUpper,
int &bPrecedence)
const;
5258 double pointDistance(
const QPointF &pixelPoint, QCPGraphDataContainer::const_iterator &closestData)
const;
5286 double t, key, value;
5307 Q_PROPERTY(
QCPScatterStyle scatterStyle READ scatterStyle WRITE setScatterStyle)
5308 Q_PROPERTY(
int scatterSkip READ scatterSkip WRITE setScatterSkip)
5309 Q_PROPERTY(
LineStyle lineStyle READ lineStyle WRITE setLineStyle)
5328 int scatterSkip()
const {
return mScatterSkip; }
5329 LineStyle lineStyle()
const {
return mLineStyle; }
5332 void setData(QSharedPointer<QCPCurveDataContainer> data);
5336 void setScatterSkip(
int skip);
5342 void addData(
double t,
double key,
double value);
5343 void addData(
double key,
double value);
5357 virtual void draw(
QCPPainter *painter) Q_DECL_OVERRIDE;
5358 virtual void drawLegendIcon(
QCPPainter *painter,
const QRectF &rect)
const Q_DECL_OVERRIDE;
5367 int getRegion(
double key,
double value,
double keyMin,
double valueMax,
double keyMax,
double valueMin)
const;
5368 QPointF getOptimizedPoint(
int prevRegion,
double prevKey,
double prevValue,
double key,
double value,
double keyMin,
double valueMax,
double keyMax,
double valueMin)
const;
5369 QVector<QPointF> getOptimizedCornerPoints(
int prevRegion,
int currentRegion,
double prevKey,
double prevValue,
double key,
double value,
double keyMin,
double valueMax,
double keyMax,
double valueMin)
const;
5370 bool mayTraverse(
int prevRegion,
int currentRegion)
const;
5371 bool getTraverse(
double prevKey,
double prevValue,
double key,
double value,
double keyMin,
double valueMax,
double keyMax,
double valueMin,
QPointF &crossA,
QPointF &crossB)
const;
5372 void getTraverseCornerPoints(
int prevRegion,
int currentRegion,
double keyMin,
double valueMax,
double keyMax,
double valueMin,
QVector<QPointF> &beforeTraverse,
QVector<QPointF> &afterTraverse)
const;
5373 double pointDistance(
const QPointF &pixelPoint, QCPCurveDataContainer::const_iterator &closestData)
const;
5390 Q_PROPERTY(
SpacingType spacingType READ spacingType WRITE setSpacingType)
5391 Q_PROPERTY(
double spacing READ spacing WRITE setSpacing)
5410 SpacingType spacingType()
const {
return mSpacingType; }
5411 double spacing()
const {
return mSpacing; }
5415 void setSpacing(
double spacing);
5419 QCPBars* bars(
int index)
const;
5420 int size()
const {
return mBars.size(); }
5425 void insert(
int i,
QCPBars *bars);
5436 void registerBars(
QCPBars *bars);
5437 void unregisterBars(
QCPBars *bars);
5440 double keyPixelOffset(
const QCPBars *bars,
double keyCoord);
5441 double getPixelSpacing(
const QCPBars *bars,
double keyCoord);
5468 Q_DECLARE_TYPEINFO(
QCPBarsData, Q_PRIMITIVE_TYPE);
5486 Q_PROPERTY(
double width READ width WRITE setWidth)
5487 Q_PROPERTY(
WidthType widthType READ widthType WRITE setWidthType)
5488 Q_PROPERTY(
QCPBarsGroup* barsGroup READ barsGroup WRITE setBarsGroup)
5489 Q_PROPERTY(
double baseValue READ baseValue WRITE setBaseValue)
5490 Q_PROPERTY(
double stackingGap READ stackingGap WRITE setStackingGap)
5491 Q_PROPERTY(
QCPBars* barBelow READ barBelow)
5492 Q_PROPERTY(
QCPBars* barAbove READ barAbove)
5511 double width()
const {
return mWidth; }
5512 WidthType widthType()
const {
return mWidthType; }
5514 double baseValue()
const {
return mBaseValue; }
5515 double stackingGap()
const {
return mStackingGap; }
5518 QSharedPointer<QCPBarsDataContainer>
data()
const {
return mDataContainer; }
5521 void setData(QSharedPointer<QCPBarsDataContainer> data);
5523 void setWidth(
double width);
5526 void setBaseValue(
double baseValue);
5527 void setStackingGap(
double pixels);
5531 void addData(
double key,
double value);
5532 void moveBelow(
QCPBars *bars);
5533 void moveAbove(
QCPBars *bars);
5548 double mStackingGap;
5549 QPointer<QCPBars> mBarBelow, mBarAbove;
5552 virtual void draw(
QCPPainter *painter) Q_DECL_OVERRIDE;
5553 virtual void drawLegendIcon(
QCPPainter *painter,
const QRectF &rect)
const Q_DECL_OVERRIDE;
5556 void getVisibleDataBounds(QCPBarsDataContainer::const_iterator &begin, QCPBarsDataContainer::const_iterator &end)
const;
5557 QRectF getBarRect(
double key,
double value)
const;
5558 void getPixelWidth(
double key,
double &lower,
double &upper)
const;
5559 double getStackedBaseValue(
double key,
bool positive)
const;
5595 double key, minimum, lowerQuartile, median, upperQuartile, maximum;
5617 Q_PROPERTY(
double width READ width WRITE setWidth)
5618 Q_PROPERTY(
double whiskerWidth READ whiskerWidth WRITE setWhiskerWidth)
5619 Q_PROPERTY(
QPen whiskerPen READ whiskerPen WRITE setWhiskerPen)
5620 Q_PROPERTY(
QPen whiskerBarPen READ whiskerBarPen WRITE setWhiskerBarPen)
5621 Q_PROPERTY(
bool whiskerAntialiased READ whiskerAntialiased WRITE setWhiskerAntialiased)
5622 Q_PROPERTY(
QPen medianPen READ medianPen WRITE setMedianPen)
5623 Q_PROPERTY(
QCPScatterStyle outlierStyle READ outlierStyle WRITE setOutlierStyle)
5629 QSharedPointer<QCPStatisticalBoxDataContainer>
data()
const {
return mDataContainer; }
5630 double width()
const {
return mWidth; }
5631 double whiskerWidth()
const {
return mWhiskerWidth; }
5632 QPen whiskerPen()
const {
return mWhiskerPen; }
5633 QPen whiskerBarPen()
const {
return mWhiskerBarPen; }
5634 bool whiskerAntialiased()
const {
return mWhiskerAntialiased; }
5635 QPen medianPen()
const {
return mMedianPen; }
5639 void setData(QSharedPointer<QCPStatisticalBoxDataContainer> data);
5641 void setWidth(
double width);
5642 void setWhiskerWidth(
double width);
5643 void setWhiskerPen(
const QPen &pen);
5644 void setWhiskerBarPen(
const QPen &pen);
5645 void setWhiskerAntialiased(
bool enabled);
5646 void setMedianPen(
const QPen &pen);
5651 void addData(
double key,
double minimum,
double lowerQuartile,
double median,
double upperQuartile,
double maximum,
const QVector<double> &outliers=
QVector<double>());
5662 double mWhiskerWidth;
5663 QPen mWhiskerPen, mWhiskerBarPen;
5664 bool mWhiskerAntialiased;
5669 virtual void draw(
QCPPainter *painter) Q_DECL_OVERRIDE;
5670 virtual void drawLegendIcon(
QCPPainter *painter,
const QRectF &rect)
const Q_DECL_OVERRIDE;
5673 virtual void drawStatisticalBox(
QCPPainter *painter, QCPStatisticalBoxDataContainer::const_iterator it,
const QCPScatterStyle &outlierStyle)
const;
5676 void getVisibleDataBounds(QCPStatisticalBoxDataContainer::const_iterator &begin, QCPStatisticalBoxDataContainer::const_iterator &end)
const;
5677 QRectF getQuartileBox(QCPStatisticalBoxDataContainer::const_iterator it)
const;
5678 QVector<QLineF> getWhiskerBackboneLines(QCPStatisticalBoxDataContainer::const_iterator it)
const;
5679 QVector<QLineF> getWhiskerBarLines(QCPStatisticalBoxDataContainer::const_iterator it)
const;
5700 int keySize()
const {
return mKeySize; }
5701 int valueSize()
const {
return mValueSize; }
5702 QCPRange keyRange()
const {
return mKeyRange; }
5703 QCPRange valueRange()
const {
return mValueRange; }
5704 QCPRange dataBounds()
const {
return mDataBounds; }
5705 double data(
double key,
double value);
5706 double cell(
int keyIndex,
int valueIndex);
5707 unsigned char alpha(
int keyIndex,
int valueIndex);
5710 void setSize(
int keySize,
int valueSize);
5711 void setKeySize(
int keySize);
5712 void setValueSize(
int valueSize);
5714 void setKeyRange(
const QCPRange &keyRange);
5715 void setValueRange(
const QCPRange &valueRange);
5716 void setData(
double key,
double value,
double z);
5717 void setCell(
int keyIndex,
int valueIndex,
double z);
5718 void setAlpha(
int keyIndex,
int valueIndex,
unsigned char alpha);
5721 void recalculateDataBounds();
5724 void fill(
double z);
5725 void fillAlpha(
unsigned char alpha);
5727 void coordToCell(
double key,
double value,
int *keyIndex,
int *valueIndex)
const;
5728 void cellToCoord(
int keyIndex,
int valueIndex,
double *key,
double *value)
const;
5732 int mKeySize, mValueSize;
5738 unsigned char *mAlpha;
5742 bool createAlpha(
bool initializeOpaque=
true);
5752 Q_PROPERTY(
QCPRange dataRange READ dataRange WRITE setDataRange NOTIFY dataRangeChanged)
5753 Q_PROPERTY(
QCPAxis::ScaleType dataScaleType READ dataScaleType WRITE setDataScaleType NOTIFY dataScaleTypeChanged)
5754 Q_PROPERTY(
QCPColorGradient gradient READ gradient WRITE setGradient NOTIFY gradientChanged)
5755 Q_PROPERTY(
bool interpolate READ interpolate WRITE setInterpolate)
5756 Q_PROPERTY(
bool tightBoundary READ tightBoundary WRITE setTightBoundary)
5757 Q_PROPERTY(
QCPColorScale* colorScale READ colorScale WRITE setColorScale)
5765 QCPRange dataRange()
const {
return mDataRange; }
5767 bool interpolate()
const {
return mInterpolate; }
5768 bool tightBoundary()
const {
return mTightBoundary; }
5770 QCPColorScale *colorScale()
const {
return mColorScale.data(); }
5774 Q_SLOT
void setDataRange(
const QCPRange &dataRange);
5777 void setInterpolate(
bool enabled);
5778 void setTightBoundary(
bool enabled);
5782 void rescaleDataRange(
bool recalculateDataBounds=
false);
5783 Q_SLOT
void updateLegendIcon(Qt::TransformationMode transformMode=Qt::SmoothTransformation,
const QSize &thumbSize=QSize(32, 18));
5791 void dataRangeChanged(
const QCPRange &newRange);
5802 bool mTightBoundary;
5803 QPointer<QCPColorScale> mColorScale;
5806 QImage mMapImage, mUndersampledMapImage;
5808 bool mMapImageInvalidated;
5811 virtual void updateMapImage();
5814 virtual void draw(
QCPPainter *painter) Q_DECL_OVERRIDE;
5815 virtual void drawLegendIcon(
QCPPainter *painter,
const QRectF &rect)
const Q_DECL_OVERRIDE;
5831 QCPFinancialData(
double key,
double open,
double high,
double low,
double close);
5842 double key, open, high, low, close;
5862 Q_PROPERTY(
ChartStyle chartStyle READ chartStyle WRITE setChartStyle)
5863 Q_PROPERTY(
double width READ width WRITE setWidth)
5864 Q_PROPERTY(
WidthType widthType READ widthType WRITE setWidthType)
5865 Q_PROPERTY(
bool twoColored READ twoColored WRITE setTwoColored)
5866 Q_PROPERTY(
QBrush brushPositive READ brushPositive WRITE setBrushPositive)
5867 Q_PROPERTY(
QBrush brushNegative READ brushNegative WRITE setBrushNegative)
5868 Q_PROPERTY(
QPen penPositive READ penPositive WRITE setPenPositive)
5869 Q_PROPERTY(
QPen penNegative READ penNegative WRITE setPenNegative)
5899 ChartStyle chartStyle()
const {
return mChartStyle; }
5900 double width()
const {
return mWidth; }
5901 WidthType widthType()
const {
return mWidthType; }
5902 bool twoColored()
const {
return mTwoColored; }
5903 QBrush brushPositive()
const {
return mBrushPositive; }
5904 QBrush brushNegative()
const {
return mBrushNegative; }
5905 QPen penPositive()
const {
return mPenPositive; }
5906 QPen penNegative()
const {
return mPenNegative; }
5909 void setData(QSharedPointer<QCPFinancialDataContainer> data);
5912 void setWidth(
double width);
5914 void setTwoColored(
bool twoColored);
5915 void setBrushPositive(
const QBrush &brush);
5916 void setBrushNegative(
const QBrush &brush);
5917 void setPenPositive(
const QPen &pen);
5918 void setPenNegative(
const QPen &pen);
5922 void addData(
double key,
double open,
double high,
double low,
double close);
5939 QBrush mBrushPositive, mBrushNegative;
5940 QPen mPenPositive, mPenNegative;
5943 virtual void draw(
QCPPainter *painter) Q_DECL_OVERRIDE;
5944 virtual void drawLegendIcon(
QCPPainter *painter,
const QRectF &rect)
const Q_DECL_OVERRIDE;
5947 void drawOhlcPlot(
QCPPainter *painter,
const QCPFinancialDataContainer::const_iterator &begin,
const QCPFinancialDataContainer::const_iterator &end,
bool isSelected);
5948 void drawCandlestickPlot(
QCPPainter *painter,
const QCPFinancialDataContainer::const_iterator &begin,
const QCPFinancialDataContainer::const_iterator &end,
bool isSelected);
5949 double getPixelWidth(
double key,
double keyPixel)
const;
5950 double ohlcSelectTest(
const QPointF &pos,
const QCPFinancialDataContainer::const_iterator &begin,
const QCPFinancialDataContainer::const_iterator &end, QCPFinancialDataContainer::const_iterator &closestDataPoint)
const;
5951 double candlestickSelectTest(
const QPointF &pos,
const QCPFinancialDataContainer::const_iterator &begin,
const QCPFinancialDataContainer::const_iterator &end, QCPFinancialDataContainer::const_iterator &closestDataPoint)
const;
5952 void getVisibleDataBounds(QCPFinancialDataContainer::const_iterator &begin, QCPFinancialDataContainer::const_iterator &end)
const;
5953 QRectF selectionHitBox(QCPFinancialDataContainer::const_iterator it)
const;
5973 double errorMinus, errorPlus;
5999 Q_PROPERTY(QSharedPointer<QCPErrorBarsDataContainer> data READ data WRITE setData)
6001 Q_PROPERTY(
ErrorType errorType READ errorType WRITE setErrorType)
6002 Q_PROPERTY(
double whiskerWidth READ whiskerWidth WRITE setWhiskerWidth)
6003 Q_PROPERTY(
double symbolGap READ symbolGap WRITE setSymbolGap)
6023 ErrorType errorType()
const {
return mErrorType; }
6024 double whiskerWidth()
const {
return mWhiskerWidth; }
6025 double symbolGap()
const {
return mSymbolGap; }
6028 void setData(QSharedPointer<QCPErrorBarsDataContainer> data);
6033 void setWhiskerWidth(
double pixels);
6034 void setSymbolGap(
double pixels);
6039 void addData(
double error);
6040 void addData(
double errorMinus,
double errorPlus);
6043 virtual int dataCount()
const Q_DECL_OVERRIDE;
6044 virtual double dataMainKey(
int index)
const Q_DECL_OVERRIDE;
6045 virtual double dataSortKey(
int index)
const Q_DECL_OVERRIDE;
6046 virtual double dataMainValue(
int index)
const Q_DECL_OVERRIDE;
6051 virtual int findBegin(
double sortKey,
bool expandedRange=
true)
const Q_DECL_OVERRIDE;
6052 virtual int findEnd(
double sortKey,
bool expandedRange=
true)
const Q_DECL_OVERRIDE;
6060 QSharedPointer<QCPErrorBarsDataContainer> mDataContainer;
6061 QPointer<QCPAbstractPlottable> mDataPlottable;
6063 double mWhiskerWidth;
6067 virtual void draw(
QCPPainter *painter) Q_DECL_OVERRIDE;
6068 virtual void drawLegendIcon(
QCPPainter *painter,
const QRectF &rect)
const Q_DECL_OVERRIDE;
6078 bool errorBarVisible(
int index)
const;
6079 bool rectIntersectsLine(
const QRectF &pixelRect,
const QLineF &line)
const;
6096 Q_PROPERTY(
QPen selectedPen READ selectedPen WRITE setSelectedPen)
6103 QPen pen()
const {
return mPen; }
6104 QPen selectedPen()
const {
return mSelectedPen; }
6108 void setSelectedPen(
const QPen &pen);
6118 QPen mPen, mSelectedPen;
6121 virtual void draw(
QCPPainter *painter) Q_DECL_OVERRIDE;
6125 QPen mainPen()
const;
6139 Q_PROPERTY(
QPen selectedPen READ selectedPen WRITE setSelectedPen)
6148 QPen pen()
const {
return mPen; }
6149 QPen selectedPen()
const {
return mSelectedPen; }
6155 void setSelectedPen(
const QPen &pen);
6167 QPen mPen, mSelectedPen;
6171 virtual void draw(
QCPPainter *painter) Q_DECL_OVERRIDE;
6175 QPen mainPen()
const;
6189 Q_PROPERTY(
QPen selectedPen READ selectedPen WRITE setSelectedPen)
6198 QPen pen()
const {
return mPen; }
6199 QPen selectedPen()
const {
return mSelectedPen; }
6205 void setSelectedPen(
const QPen &pen);
6219 QPen mPen, mSelectedPen;
6223 virtual void draw(
QCPPainter *painter) Q_DECL_OVERRIDE;
6226 QPen mainPen()
const;
6240 Q_PROPERTY(
QPen selectedPen READ selectedPen WRITE setSelectedPen)
6242 Q_PROPERTY(
QBrush selectedBrush READ selectedBrush WRITE setSelectedBrush)
6249 QPen pen()
const {
return mPen; }
6250 QPen selectedPen()
const {
return mSelectedPen; }
6251 QBrush brush()
const {
return mBrush; }
6252 QBrush selectedBrush()
const {
return mSelectedBrush; }
6256 void setSelectedPen(
const QPen &pen);
6258 void setSelectedBrush(
const QBrush &brush);
6273 enum AnchorIndex {aiTop, aiTopRight, aiRight, aiBottom, aiBottomLeft, aiLeft};
6276 QPen mPen, mSelectedPen;
6277 QBrush mBrush, mSelectedBrush;
6280 virtual void draw(
QCPPainter *painter) Q_DECL_OVERRIDE;
6281 virtual QPointF anchorPixelPosition(
int anchorId)
const Q_DECL_OVERRIDE;
6284 QPen mainPen()
const;
6285 QBrush mainBrush()
const;
6298 Q_PROPERTY(
QColor color READ color WRITE setColor)
6299 Q_PROPERTY(
QColor selectedColor READ selectedColor WRITE setSelectedColor)
6301 Q_PROPERTY(
QPen selectedPen READ selectedPen WRITE setSelectedPen)
6303 Q_PROPERTY(
QBrush selectedBrush READ selectedBrush WRITE setSelectedBrush)
6304 Q_PROPERTY(
QFont font READ font WRITE setFont)
6305 Q_PROPERTY(
QFont selectedFont READ selectedFont WRITE setSelectedFont)
6306 Q_PROPERTY(
QString text READ text WRITE setText)
6307 Q_PROPERTY(Qt::Alignment positionAlignment READ positionAlignment WRITE setPositionAlignment)
6308 Q_PROPERTY(Qt::Alignment textAlignment READ textAlignment WRITE setTextAlignment)
6309 Q_PROPERTY(
double rotation READ rotation WRITE setRotation)
6310 Q_PROPERTY(QMargins padding READ padding WRITE setPadding)
6317 QColor color()
const {
return mColor; }
6318 QColor selectedColor()
const {
return mSelectedColor; }
6319 QPen pen()
const {
return mPen; }
6320 QPen selectedPen()
const {
return mSelectedPen; }
6321 QBrush brush()
const {
return mBrush; }
6322 QBrush selectedBrush()
const {
return mSelectedBrush; }
6323 QFont font()
const {
return mFont; }
6324 QFont selectedFont()
const {
return mSelectedFont; }
6325 QString text()
const {
return mText; }
6326 Qt::Alignment positionAlignment()
const {
return mPositionAlignment; }
6327 Qt::Alignment textAlignment()
const {
return mTextAlignment; }
6328 double rotation()
const {
return mRotation; }
6329 QMargins padding()
const {
return mPadding; }
6332 void setColor(
const QColor &color);
6333 void setSelectedColor(
const QColor &color);
6335 void setSelectedPen(
const QPen &pen);
6337 void setSelectedBrush(
const QBrush &brush);
6338 void setFont(
const QFont &font);
6339 void setSelectedFont(
const QFont &font);
6340 void setText(
const QString &text);
6341 void setPositionAlignment(Qt::Alignment alignment);
6342 void setTextAlignment(Qt::Alignment alignment);
6343 void setRotation(
double degrees);
6344 void setPadding(
const QMargins &padding);
6360 enum AnchorIndex {aiTopLeft, aiTop, aiTopRight, aiRight, aiBottomRight, aiBottom, aiBottomLeft, aiLeft};
6363 QColor mColor, mSelectedColor;
6364 QPen mPen, mSelectedPen;
6365 QBrush mBrush, mSelectedBrush;
6366 QFont mFont, mSelectedFont;
6368 Qt::Alignment mPositionAlignment;
6369 Qt::Alignment mTextAlignment;
6374 virtual void draw(
QCPPainter *painter) Q_DECL_OVERRIDE;
6375 virtual QPointF anchorPixelPosition(
int anchorId)
const Q_DECL_OVERRIDE;
6378 QPointF getTextDrawPoint(
const QPointF &pos,
const QRectF &rect, Qt::Alignment positionAlignment)
const;
6379 QFont mainFont()
const;
6380 QColor mainColor()
const;
6381 QPen mainPen()
const;
6382 QBrush mainBrush()
const;
6396 Q_PROPERTY(
QPen selectedPen READ selectedPen WRITE setSelectedPen)
6398 Q_PROPERTY(
QBrush selectedBrush READ selectedBrush WRITE setSelectedBrush)
6405 QPen pen()
const {
return mPen; }
6406 QPen selectedPen()
const {
return mSelectedPen; }
6407 QBrush brush()
const {
return mBrush; }
6408 QBrush selectedBrush()
const {
return mSelectedBrush; }
6412 void setSelectedPen(
const QPen &pen);
6414 void setSelectedBrush(
const QBrush &brush);
6432 enum AnchorIndex {aiTopLeftRim, aiTop, aiTopRightRim, aiRight, aiBottomRightRim, aiBottom, aiBottomLeftRim, aiLeft, aiCenter};
6435 QPen mPen, mSelectedPen;
6436 QBrush mBrush, mSelectedBrush;
6439 virtual void draw(
QCPPainter *painter) Q_DECL_OVERRIDE;
6440 virtual QPointF anchorPixelPosition(
int anchorId)
const Q_DECL_OVERRIDE;
6443 QPen mainPen()
const;
6444 QBrush mainBrush()
const;
6457 Q_PROPERTY(
QPixmap pixmap READ pixmap WRITE setPixmap)
6458 Q_PROPERTY(
bool scaled READ scaled WRITE setScaled)
6459 Q_PROPERTY(Qt::AspectRatioMode aspectRatioMode READ aspectRatioMode)
6460 Q_PROPERTY(Qt::TransformationMode transformationMode READ transformationMode)
6462 Q_PROPERTY(
QPen selectedPen READ selectedPen WRITE setSelectedPen)
6469 QPixmap pixmap()
const {
return mPixmap; }
6470 bool scaled()
const {
return mScaled; }
6471 Qt::AspectRatioMode aspectRatioMode()
const {
return mAspectRatioMode; }
6472 Qt::TransformationMode transformationMode()
const {
return mTransformationMode; }
6473 QPen pen()
const {
return mPen; }
6474 QPen selectedPen()
const {
return mSelectedPen; }
6477 void setPixmap(
const QPixmap &pixmap);
6478 void setScaled(
bool scaled, Qt::AspectRatioMode aspectRatioMode=Qt::KeepAspectRatio, Qt::TransformationMode transformationMode=Qt::SmoothTransformation);
6480 void setSelectedPen(
const QPen &pen);
6495 enum AnchorIndex {aiTop, aiTopRight, aiRight, aiBottom, aiBottomLeft, aiLeft};
6501 bool mScaledPixmapInvalidated;
6502 Qt::AspectRatioMode mAspectRatioMode;
6503 Qt::TransformationMode mTransformationMode;
6504 QPen mPen, mSelectedPen;
6507 virtual void draw(
QCPPainter *painter) Q_DECL_OVERRIDE;
6508 virtual QPointF anchorPixelPosition(
int anchorId)
const Q_DECL_OVERRIDE;
6511 void updateScaledPixmap(QRect finalRect=QRect(),
bool flipHorz=
false,
bool flipVert=
false);
6512 QRect getFinalRect(
bool *flippedHorz=0,
bool *flippedVert=0)
const;
6513 QPen mainPen()
const;
6527 Q_PROPERTY(
QPen selectedPen READ selectedPen WRITE setSelectedPen)
6529 Q_PROPERTY(
QBrush selectedBrush READ selectedBrush WRITE setSelectedBrush)
6530 Q_PROPERTY(
double size READ size WRITE setSize)
6531 Q_PROPERTY(
TracerStyle style READ style WRITE setStyle)
6532 Q_PROPERTY(
QCPGraph* graph READ graph WRITE setGraph)
6533 Q_PROPERTY(
double graphKey READ graphKey WRITE setGraphKey)
6534 Q_PROPERTY(
bool interpolating READ interpolating WRITE setInterpolating)
6554 QPen pen()
const {
return mPen; }
6555 QPen selectedPen()
const {
return mSelectedPen; }
6556 QBrush brush()
const {
return mBrush; }
6557 QBrush selectedBrush()
const {
return mSelectedBrush; }
6558 double size()
const {
return mSize; }
6560 QCPGraph *graph()
const {
return mGraph; }
6561 double graphKey()
const {
return mGraphKey; }
6562 bool interpolating()
const {
return mInterpolating; }
6566 void setSelectedPen(
const QPen &pen);
6568 void setSelectedBrush(
const QBrush &brush);
6569 void setSize(
double size);
6572 void setGraphKey(
double key);
6573 void setInterpolating(
bool enabled);
6579 void updatePosition();
6585 QPen mPen, mSelectedPen;
6586 QBrush mBrush, mSelectedBrush;
6591 bool mInterpolating;
6594 virtual void draw(
QCPPainter *painter) Q_DECL_OVERRIDE;
6597 QPen mainPen()
const;
6598 QBrush mainBrush()
const;
6613 Q_PROPERTY(
QPen selectedPen READ selectedPen WRITE setSelectedPen)
6614 Q_PROPERTY(
double length READ length WRITE setLength)
6615 Q_PROPERTY(
BracketStyle style READ style WRITE setStyle)
6635 QPen pen()
const {
return mPen; }
6636 QPen selectedPen()
const {
return mSelectedPen; }
6637 double length()
const {
return mLength; }
6642 void setSelectedPen(
const QPen &pen);
6643 void setLength(
double length);
6655 enum AnchorIndex {aiCenter};
6656 QPen mPen, mSelectedPen;
6661 virtual void draw(
QCPPainter *painter) Q_DECL_OVERRIDE;
6662 virtual QPointF anchorPixelPosition(
int anchorId)
const Q_DECL_OVERRIDE;
6665 QPen mainPen()
const;
6672 #endif // QCUSTOMPLOT_H bool isNull() const
Definition: qcustomplot.h:411
0x02 right margin
Definition: qcustomplot.h:202
ColorInterpolation
Definition: qcustomplot.h:4450
void setBrush(const QBrush &brush)
Definition: qcustomplot.cpp:10784
BracketStyle
Definition: qcustomplot.h:6624
virtual QCPItemPosition * toQCPItemPosition() Q_DECL_OVERRIDE
Definition: qcustomplot.h:3504
bool addToLegend()
Definition: qcustomplot.cpp:11121
The base class tick generator used by QCPAxis to create tick positions and tick labels.
Definition: qcustomplot.h:1538
0x001 Axis ranges are draggable (see QCPAxisRect::setRangeDrag, QCPAxisRect::setRangeDragAxes) ...
Definition: qcustomplot.h:256
bool isNone() const
Definition: qcustomplot.h:2373
QCPBars * barBelow() const
Definition: qcustomplot.h:5516
QList< QCPLayerable * > children() const
Definition: qcustomplot.h:660
Manages the position of an item.
Definition: qcustomplot.h:3443
EndingStyle
Definition: qcustomplot.h:1489
QCPRange & operator/=(const double &value)
Definition: qcustomplot.h:791
virtual int findBegin(double sortKey, bool expandedRange=true) const Q_DECL_OVERRIDE
Definition: qcustomplot.h:4271
QCPAxis * axis() const
Definition: qcustomplot.h:5067
bool isEmpty() const
Definition: qcustomplot.h:5726
int size() const
Definition: qcustomplot.h:5420
bool isEmpty() const
Definition: qcustomplot.h:2422
A text label.
Definition: qcustomplot.h:6294
bool isEmpty() const
Definition: qcustomplot.h:963
Definition: qcustomplot.h:2270
QPoint bottomLeft() const
Definition: qcustomplot.h:4664
0x0200 Zero-lines, see QCPGrid::setZeroLinePen
Definition: qcustomplot.h:228
void setName(const QString &name)
Definition: qcustomplot.cpp:10735
void setX(double x)
Definition: qcustomplot.h:402
Any combination of data points/ranges can be selected.
Definition: qcustomplot.h:300
The abstract base class for layouts.
Definition: qcustomplot.h:1287
Resolution is given in dots per inch (DPI/PPI)
Definition: qcustomplot.h:172
void selectionChanged(bool selected)
QPointF toPointF() const
Definition: qcustomplot.h:409
Specialized axis ticker to display ticks in units of an arbitrary constant, for example pi...
Definition: qcustomplot.h:1776
void setBegin(int begin)
Definition: qcustomplot.h:911
void setKeyAxis(QCPAxis *axis)
Definition: qcustomplot.cpp:10800
Cosmetic pens are converted to pens with pixel width 1 when exporting.
Definition: qcustomplot.h:180
A curved line from one point to another.
Definition: qcustomplot.h:6184
double mainKey() const
Definition: qcustomplot.h:5461
QCPRange valueRange() const
Definition: qcustomplot.h:5587
Controls how a plottable's data selection is drawn.
Definition: qcustomplot.h:3248
void remove(double sortKeyFrom, double sortKeyTo)
Definition: qcustomplot.h:2797
double sortKey() const
Definition: qcustomplot.h:5833
Represents the range an axis is encompassing.
Definition: qcustomplot.h:777
virtual QCPItemPosition * toQCPItemPosition()
Definition: qcustomplot.h:3427
An arbitrary pixmap.
Definition: qcustomplot.h:6453
LineStyle
Definition: qcustomplot.h:5179
LayerMode
Definition: qcustomplot.h:648
int width() const
Definition: qcustomplot.h:4659
A straight line that spans infinitely in both directions.
Definition: qcustomplot.h:6091
virtual void mousePressEvent(QMouseEvent *event, const QVariant &details)
Definition: qcustomplot.cpp:1712
bool isActive() const
Definition: qcustomplot.h:1111
QCPVector2D perpendicular() const
Definition: qcustomplot.h:414
static bool sortKeyIsMainKey()
Definition: qcustomplot.h:5459
virtual QCPPlottableInterface1D * interface1D() Q_DECL_OVERRIDE
Definition: qcustomplot.h:6056
Definition: qcustomplot.h:144
void drawPolyline(QCPPainter *painter, const QVector< QPointF > &lineData) const
Definition: qcustomplot.h:4388
Holds the data of one single data point for QCPCurve.
Definition: qcustomplot.h:5271
bool realVisibility() const
Definition: qcustomplot.cpp:1432
virtual QSize maximumOuterSizeHint() const
Definition: qcustomplot.cpp:3471
QCPRange valueRange() const
Definition: qcustomplot.h:5284
void pixelsToCoords(double x, double y, double &key, double &value) const
Definition: qcustomplot.cpp:10955
virtual double selectTest(const QPointF &pos, bool onlySelectable, QVariant *details=0) const
Definition: qcustomplot.cpp:1475
0x004 axis (tick) labels will be cached as pixmaps, increasing replot performance.
Definition: qcustomplot.h:245
void coordsToPixels(double key, double value, double &x, double &y) const
Definition: qcustomplot.cpp:10913
QCPRange & operator+=(const double &value)
Definition: qcustomplot.h:788
virtual QSize minimumOuterSizeHint() const
Definition: qcustomplot.cpp:3452
Holds the data of one single data point (one bar) for QCPBars.
Definition: qcustomplot.h:5451
InsetPlacement
Definition: qcustomplot.h:1425
double length() const
Definition: qcustomplot.h:406
QCPRange valueRange(bool &foundRange, QCP::SignDomain signDomain=QCP::sdBoth, const QCPRange &inKeyRange=QCPRange())
Definition: qcustomplot.h:3083
Provides rect/rubber-band data selection and range zoom interaction.
Definition: qcustomplot.h:1099
0x0000 No elements
Definition: qcustomplot.h:231
ErrorType
Definition: qcustomplot.h:6013
Definition: qcustomplot.h:5025
void setSelectedTextColor(const QColor &color)
Definition: qcustomplot.cpp:18057
Represents the visual appearance of scatter points.
Definition: qcustomplot.h:2296
static QCPStatisticalBoxData fromSortKey(double sortKey)
Definition: qcustomplot.h:5581
void removeBefore(double sortKey)
Definition: qcustomplot.h:2765
void set(const QCPDataContainer< DataType > &data)
Definition: qcustomplot.h:2640
double mainKey() const
Definition: qcustomplot.h:5584
Specialized axis ticker for calendar dates and times as axis ticks.
Definition: qcustomplot.h:1603
Defines an abstract interface for one-dimensional plottables.
Definition: qcustomplot.h:3858
ResolutionUnit
Definition: qcustomplot.h:170
double sortKey() const
Definition: qcustomplot.h:5457
void getDataSegments(QList< QCPDataRange > &selectedSegments, QList< QCPDataRange > &unselectedSegments) const
Definition: qcustomplot.h:4358
Specialized axis ticker suited for logarithmic axes.
Definition: qcustomplot.h:1835
0x04 top margin
Definition: qcustomplot.h:203
const_iterator findEnd(double sortKey, bool expandedRange=true) const
Definition: qcustomplot.h:2933
A plottable representing a single statistical box in a plot.
Definition: qcustomplot.h:5613
SignDomain
Definition: qcustomplot.h:191
0x0020 Main lines of plottables
Definition: qcustomplot.h:224
virtual void update(UpdatePhase phase) Q_DECL_OVERRIDE
Definition: qcustomplot.cpp:17257
double mainValue() const
Definition: qcustomplot.h:5838
void simplify()
Definition: qcustomplot.cpp:2573
QCPLayoutInset * insetLayout() const
Definition: qcustomplot.h:4645
A rectangle.
Definition: qcustomplot.h:6235
int right() const
Definition: qcustomplot.h:4656
static bool sortKeyIsMainKey()
Definition: qcustomplot.h:5582
virtual QCPRange dataValueRange(int index) const Q_DECL_OVERRIDE
Definition: qcustomplot.h:4176
QCPRange valueRange() const
Definition: qcustomplot.h:5145
QCPSelectionRect * selectionRect() const
Definition: qcustomplot.h:3647
When dragging the mouse, a selection rect becomes active. Upon releasing, the axes that are currently...
Definition: qcustomplot.h:273
RefreshPriority
Definition: qcustomplot.h:3621
double mainValue() const
Definition: qcustomplot.h:5282
QCPDataRange bounded(const QCPDataRange &other) const
Definition: qcustomplot.cpp:2256
QMap< double, QString > & ticks()
Definition: qcustomplot.h:1744
A layout element displaying a text.
Definition: qcustomplot.h:4937
Q_SLOT void setSelection(QCPDataSelection selection)
Definition: qcustomplot.cpp:10840
double mainKey() const
Definition: qcustomplot.h:5281
double lengthSquared() const
Definition: qcustomplot.h:407
virtual void wheelEvent(QWheelEvent *event) Q_DECL_OVERRIDE
Definition: qcustomplot.cpp:17927
void setY(double y)
Definition: qcustomplot.h:403
A layer that may contain objects, to control the rendering order.
Definition: qcustomplot.h:628
double sortKey() const
Definition: qcustomplot.h:5277
0x02 Mode for all sorts of exports (e.g. PNG, PDF,...). For example, this prevents using cached pixma...
Definition: qcustomplot.h:471
Handles the different ending decorations for line-like items.
Definition: qcustomplot.h:1474
The positive sign domain, i.e. numbers greater than zero.
Definition: qcustomplot.h:193
Responsible for drawing the grid of a QCPAxis.
Definition: qcustomplot.h:1868
TickStepStrategy
Definition: qcustomplot.h:1547
QCPSelectionDecorator * selectionDecorator() const
Definition: qcustomplot.h:3325
const_iterator constBegin() const
Definition: qcustomplot.h:2442
Describes a data set by holding multiple QCPDataRange instances.
Definition: qcustomplot.h:932
void sort()
Definition: qcustomplot.h:2858
double dot(const QCPVector2D &vec) const
Definition: qcustomplot.h:415
0x004 The user can select multiple objects by holding the modifier set by QCustomPlot::setMultiSelect...
Definition: qcustomplot.h:258
0xFF all margins
Definition: qcustomplot.h:205
void expand(const QCPRange &otherRange)
Definition: qcustomplot.cpp:1931
void layerChanged(QCPLayer *newLayer)
ExportPen
Definition: qcustomplot.h:180
virtual int dataCount() const Q_DECL_OVERRIDE
Definition: qcustomplot.h:4119
Definition: qcustomplot.h:2224
0x020 Legends are selectable (or their child items, see QCPLegend::setSelectableParts) ...
Definition: qcustomplot.h:261
virtual QCPRange getValueRange(bool &foundRange, QCP::SignDomain inSignDomain=QCP::sdBoth, const QCPRange &inKeyRange=QCPRange()) const =0
Q_SLOT bool setLayer(QCPLayer *layer)
Definition: qcustomplot.cpp:1384
Defines a color gradient for use with e.g. QCPColorMap.
Definition: qcustomplot.h:4441
ScatterShape
Definition: qcustomplot.h:2326
AntialiasedElement
Definition: qcustomplot.h:219
QCPRange valueRange() const
Definition: qcustomplot.h:5464
Q_SLOT void setSelectable(QCP::SelectionType selectable)
Definition: qcustomplot.cpp:10887
bool qcpLessThanSortKey(const DataType &a, const DataType &b)
Definition: qcustomplot.h:2409
An ellipse.
Definition: qcustomplot.h:6391
const_iterator findBegin(double sortKey, bool expandedRange=true) const
Definition: qcustomplot.h:2906
Holds the data of one single data point for QCPStatisticalBox.
Definition: qcustomplot.h:5574
bool isValid() const
Definition: qcustomplot.h:915
QCPItemAnchor * parentAnchor() const
Definition: qcustomplot.h:3471
int height() const
Definition: qcustomplot.h:4660
The central class of the library. This is the QWidget which displays the plot and interacts with the ...
Definition: qcustomplot.h:3590
virtual void mouseDoubleClickEvent(QMouseEvent *event, const QVariant &details)
Definition: qcustomplot.cpp:1780
One individual data point can be selected at a time.
Definition: qcustomplot.h:298
LabelSide
Definition: qcustomplot.h:1985
virtual double dataSortKey(int index) const Q_DECL_OVERRIDE
Definition: qcustomplot.h:4144
int left() const
Definition: qcustomplot.h:4655
void removeAfter(double sortKey)
Definition: qcustomplot.h:2780
int length() const
Definition: qcustomplot.h:908
virtual double selectTest(const QPointF &pos, bool onlySelectable, QVariant *details=0) const Q_DECL_OVERRIDE
Definition: qcustomplot.h:4296
0x0002 Grid lines
Definition: qcustomplot.h:220
void squeeze(bool preAllocation=true, bool postAllocation=true)
Definition: qcustomplot.h:2874
QCPRange valueRange() const
Definition: qcustomplot.h:5840
Represents two doubles as a mathematical 2D vector.
Definition: qcustomplot.h:387
virtual QCPPlottableInterface1D * interface1D() Q_DECL_OVERRIDE
Definition: qcustomplot.h:3898
QPoint toPoint() const
Definition: qcustomplot.h:408
bool contains(double value) const
Definition: qcustomplot.h:809
double mainKey() const
Definition: qcustomplot.h:5837
SelectablePart
Definition: qcustomplot.h:2001
ScatterProperty
Definition: qcustomplot.h:2308
The generic data container for one-dimensional plottables.
Definition: qcustomplot.h:2412
BracketStyle
Definition: qcustomplot.h:4535
Manages a legend inside a QCustomPlot.
Definition: qcustomplot.h:4807
double mainValue() const
Definition: qcustomplot.h:5585
void setAntialiased(bool enabled)
Definition: qcustomplot.cpp:1417
QCPAxis * yAxis2
Definition: qcustomplot.h:3739
virtual void mouseReleaseEvent(QMouseEvent *event, const QPointF &startPos) Q_DECL_OVERRIDE
Definition: qcustomplot.cpp:17901
The selection rect is disabled, and all mouse events are forwarded to the underlying objects...
Definition: qcustomplot.h:272
void setValueAxis(QCPAxis *axis)
Definition: qcustomplot.cpp:10816
void setSelectedFont(const QFont &font)
Definition: qcustomplot.cpp:18046
virtual void mousePressEvent(QMouseEvent *event, const QVariant &details) Q_DECL_OVERRIDE
Definition: qcustomplot.cpp:17809
A layout that arranges child elements in a grid.
Definition: qcustomplot.h:1327
QCPDataRange dataRange(int index=0) const
Definition: qcustomplot.cpp:2517
static QCPGraphData fromSortKey(double sortKey)
Definition: qcustomplot.h:5139
QPainter subclass used internally.
Definition: qcustomplot.h:461
The abstract base class for all objects that form the layout system.
Definition: qcustomplot.h:1184
Holds the data of one single data point for QCPGraph.
Definition: qcustomplot.h:5132
0x000 No hints are set
Definition: qcustomplot.h:240
virtual void mouseReleaseEvent(QMouseEvent *event, const QPointF &startPos)
Definition: qcustomplot.cpp:1748
Multiple contiguous data points (a data range) can be selected.
Definition: qcustomplot.h:299
Holds multiple axes and arranges them in a rectangular shape.
Definition: qcustomplot.h:4593
virtual QCPDataSelection selectTestRect(const QRectF &rect, bool onlySelectable) const Q_DECL_OVERRIDE
Definition: qcustomplot.h:4222
void setPen(const QPen &pen)
Definition: qcustomplot.cpp:10770
virtual double dataMainValue(int index) const Q_DECL_OVERRIDE
Definition: qcustomplot.h:4160
void rescaleAxes(bool onlyEnlarge=false) const
Definition: qcustomplot.cpp:10994
When dragging the mouse, a selection rect becomes active. It is the programmer's responsibility to co...
Definition: qcustomplot.h:275
Both sign domains, including zero, i.e. all numbers.
Definition: qcustomplot.h:192
QSharedPointer< QCPStatisticalBoxDataContainer > data() const
Definition: qcustomplot.h:5629
virtual double selectTest(const QPointF &pos, bool onlySelectable, QVariant *details=0) const Q_DECL_OVERRIDE=0
0x00 no margin
Definition: qcustomplot.h:206
A color scale for use with color coding data such as QCPColorMap.
Definition: qcustomplot.h:5049
virtual int findEnd(double sortKey, bool expandedRange=true) const Q_DECL_OVERRIDE
Definition: qcustomplot.h:4280
QSharedPointer< QCPAxisTicker > ticker() const
Definition: qcustomplot.h:2019
0x010 Axes are selectable (or parts of them, see QCPAxis::setSelectableParts)
Definition: qcustomplot.h:260
Groups multiple QCPBars together so they appear side by side.
Definition: qcustomplot.h:5386
void rescaleValueAxis(bool onlyEnlarge=false, bool inKeyRange=false) const
Definition: qcustomplot.cpp:11047
void clear()
Definition: qcustomplot.h:2839
0x0004 Sub grid lines
Definition: qcustomplot.h:221
A bracket for referencing/highlighting certain parts in the plot.
Definition: qcustomplot.h:6608
virtual QCPRange getKeyRange(bool &foundRange, QCP::SignDomain inSignDomain=QCP::sdBoth) const =0
LayerInsertMode
Definition: qcustomplot.h:3611
The abstract base class for all entries in a QCPLegend.
Definition: qcustomplot.h:4719
SelectionRectMode
Definition: qcustomplot.h:272
WidthType
Definition: qcustomplot.h:5878
QList< QCPLayoutElement * > elements(QCP::MarginSide side) const
Definition: qcustomplot.h:1161
double sortKey() const
Definition: qcustomplot.h:5138
QList< QCPItemAnchor * > anchors() const
Definition: qcustomplot.h:3543
Describes a data range given by begin and end index.
Definition: qcustomplot.h:895
void normalize()
Definition: qcustomplot.h:801
virtual double dataMainKey(int index) const Q_DECL_OVERRIDE
Definition: qcustomplot.h:4128
UpdatePhase
Definition: qcustomplot.h:1202
static QCPCurveData fromSortKey(double sortKey)
Definition: qcustomplot.h:5278
0x008 Plottables are selectable (e.g. graphs, curves, bars,... see QCPAbstractPlottable) ...
Definition: qcustomplot.h:259
PositionType
Definition: qcustomplot.h:3453
The abstract base class for paint buffers, which define the rendering backend.
Definition: qcustomplot.h:520
void setTextColor(const QColor &color)
Definition: qcustomplot.cpp:18035
QCPLayoutGrid * plotLayout() const
Definition: qcustomplot.h:3637
static QCPFinancialData fromSortKey(double sortKey)
Definition: qcustomplot.h:5834
QCPDataSelection inverse(const QCPDataRange &outerRange) const
Definition: qcustomplot.cpp:2712
A plottable representing a parametric curve in a plot.
Definition: qcustomplot.h:5303
QCPLegend * legend
Definition: qcustomplot.h:3740
void addDataRange(const QCPDataRange &dataRange, bool simplify=true)
Definition: qcustomplot.cpp:2547
static bool sortKeyIsMainKey()
Definition: qcustomplot.h:5835
A legend item representing a plottable with an icon and the plottable name.
Definition: qcustomplot.h:4783
QCPLayerable(QCustomPlot *plot, QString targetLayer=QString(), QCPLayerable *parentLayerable=0)
Definition: qcustomplot.cpp:1339
int top() const
Definition: qcustomplot.h:4657
0x0040 Main lines of items
Definition: qcustomplot.h:225
Manages a single axis inside a QCustomPlot.
Definition: qcustomplot.h:1919
void setAntialiasedFill(bool enabled)
Definition: qcustomplot.cpp:10746
Definition: qcustomplot.h:243
FractionStyle
Definition: qcustomplot.h:1785
TracerStyle
Definition: qcustomplot.h:6542
QPoint topLeft() const
Definition: qcustomplot.h:4662
A template base class for plottables with one-dimensional data.
Definition: qcustomplot.h:3876
void clear()
Definition: qcustomplot.cpp:3750
0x01 The pen property, see setPen
Definition: qcustomplot.h:2309
Item that sticks to QCPGraph data points.
Definition: qcustomplot.h:6522
Definition: qcustomplot.h:241
void limitIteratorsToDataRange(const_iterator &begin, const_iterator &end, const QCPDataRange &dataRange) const
Definition: qcustomplot.h:3171
GradientPreset
Definition: qcustomplot.h:4459
int size() const
Definition: qcustomplot.h:907
A margin group allows synchronization of margin sides if working with multiple layout elements...
Definition: qcustomplot.h:1153
QCPRange & operator-=(const double &value)
Definition: qcustomplot.h:789
QRect rect() const
Definition: qcustomplot.h:1226
virtual void mouseMoveEvent(QMouseEvent *event, const QPointF &startPos) Q_DECL_OVERRIDE
Definition: qcustomplot.cpp:17841
QCPRange keyRange(bool &foundRange, QCP::SignDomain signDomain=QCP::sdBoth)
Definition: qcustomplot.h:2960
void setVisible(bool on)
Definition: qcustomplot.cpp:1370
0x08 bottom margin
Definition: qcustomplot.h:204
bool removeFromLegend() const
Definition: qcustomplot.cpp:11159
const_iterator at(int index) const
Definition: qcustomplot.h:2448
An anchor of an item to which positions can be attached to.
Definition: qcustomplot.h:3405
0x0100 Borders of fills (e.g. under or between graphs)
Definition: qcustomplot.h:227
The abstract base class for all items in a plot.
Definition: qcustomplot.h:3513
static const double minRange
Definition: qcustomplot.h:813
WidthType
Definition: qcustomplot.h:5501
int size() const
Definition: qcustomplot.h:2421
void rescaleKeyAxis(bool onlyEnlarge=false) const
Definition: qcustomplot.cpp:11005
QSharedPointer< QCPGraphDataContainer > data() const
Definition: qcustomplot.h:5193
double center() const
Definition: qcustomplot.h:800
Selection behaves like stMultipleDataRanges, but if there are any data points selected, the entire plottable is drawn as selected.
Definition: qcustomplot.h:297
QSharedPointer< QCPBarsDataContainer > data() const
Definition: qcustomplot.h:5518
SelectionType
Definition: qcustomplot.h:296
Specialized axis ticker for time spans in units of milliseconds to days.
Definition: qcustomplot.h:1644
A paint buffer based on QPixmap, using software raster rendering.
Definition: qcustomplot.h:555
ScaleStrategy
Definition: qcustomplot.h:1706
static bool sortKeyIsMainKey()
Definition: qcustomplot.h:5140
bool contains(QCPBars *bars) const
Definition: qcustomplot.h:5423
static QCPBarsData fromSortKey(double sortKey)
Definition: qcustomplot.h:5458
QList< QCPBars * > bars() const
Definition: qcustomplot.h:5418
TimeUnit
Definition: qcustomplot.h:1653
0x0080 Scatter symbols of plottables (excluding scatter symbols of type ssPixmap) ...
Definition: qcustomplot.h:226
Specialized axis ticker which allows arbitrary labels at specified coordinates.
Definition: qcustomplot.h:1738
virtual int elementCount() const Q_DECL_OVERRIDE
Definition: qcustomplot.h:1379
QRect outerRect() const
Definition: qcustomplot.h:1227
A layout that places child elements aligned to the border or arbitrarily positioned.
Definition: qcustomplot.h:1418
QPoint bottomRight() const
Definition: qcustomplot.h:4665
0x080 All other objects are selectable (e.g. your own derived layerables, other layout elements...
Definition: qcustomplot.h:263
Whether to use immediate or queued refresh depends on whether the plotting hint QCP::phImmediateRefre...
Definition: qcustomplot.h:3623
0x002 Axis ranges are zoomable with the mouse wheel (see QCPAxisRect::setRangeZoom, QCPAxisRect::setRangeZoomAxes)
Definition: qcustomplot.h:257
QCPDataRange adjusted(int changeBegin, int changeEnd) const
Definition: qcustomplot.h:920
double mainKey() const
Definition: qcustomplot.h:5142
QCPColorMapData * data() const
Definition: qcustomplot.h:5764
int pixelOrientation() const
Definition: qcustomplot.h:2109
A plottable representing a bar chart in a plot.
Definition: qcustomplot.h:5482
AxisType
Definition: qcustomplot.h:1972
void setFont(const QFont &font)
Definition: qcustomplot.cpp:18025
QCPLayerable * parentLayerable() const
Definition: qcustomplot.h:714
QCPDataSelection selection() const
Definition: qcustomplot.h:3324
bool isEmpty() const
Definition: qcustomplot.h:5421
0x8000 Other elements that don't fit into any of the existing categories
Definition: qcustomplot.h:229
QCPGrid * grid() const
Definition: qcustomplot.h:2056
void add(const QCPDataContainer< DataType > &data)
Definition: qcustomplot.h:2672
iterator end()
Definition: qcustomplot.h:2445
A selection decorator which draws brackets around each selected data segment.
Definition: qcustomplot.h:4524
0x01 Mode for vectorized painting (e.g. PDF export). For example, this prevents some antialiasing fix...
Definition: qcustomplot.h:470
virtual QPointF dataPixelPosition(int index) const Q_DECL_OVERRIDE
Definition: qcustomplot.h:4192
Base class for all drawable objects.
Definition: qcustomplot.h:697
bool selected() const
Definition: qcustomplot.h:3323
Specialized axis ticker with a fixed tick step.
Definition: qcustomplot.h:1696
bool isEmpty() const
Definition: qcustomplot.h:916
0x0008 Legend box
Definition: qcustomplot.h:222
QCPBars * barAbove() const
Definition: qcustomplot.h:5517
const_iterator constEnd() const
Definition: qcustomplot.h:2443
QList< QCPItemPosition * > positions() const
Definition: qcustomplot.h:3542
static bool sortKeyIsMainKey()
Definition: qcustomplot.h:5279
QCPAbstractPlottable1D(QCPAxis *keyAxis, QCPAxis *valueAxis)
Definition: qcustomplot.h:4104
SelectablePart
Definition: qcustomplot.h:4832
QCPDataRange dataRange() const
Definition: qcustomplot.h:2451
Qt::Orientation orientation() const
Definition: qcustomplot.h:2108
The plottable is not selectable.
Definition: qcustomplot.h:296
Resolution is given in dots per centimeter (dpcm)
Definition: qcustomplot.h:171
ScaleType
Definition: qcustomplot.h:1993
0xFFFF All elements
Definition: qcustomplot.h:230
QSize size() const
Definition: qcustomplot.h:4661
void setEnd(int end)
Definition: qcustomplot.h:912
bool isPenDefined() const
Definition: qcustomplot.h:2374
SizeConstraintRect
Definition: qcustomplot.h:1216
A plottable representing a graph in a plot.
Definition: qcustomplot.h:5163
QCPAbstractPlottable(QCPAxis *keyAxis, QCPAxis *valueAxis)
Definition: qcustomplot.cpp:10701
double mainValue() const
Definition: qcustomplot.h:5462
FillOrder
Definition: qcustomplot.h:1349
The negative sign domain, i.e. numbers smaller than zero.
Definition: qcustomplot.h:191
void selectableChanged(QCP::SelectionType selectable)
0x040 Items are selectable (Rectangles, Arrows, Textitems, etc. see QCPAbstractItem) ...
Definition: qcustomplot.h:262
Holds the two-dimensional data of a QCPColorMap plottable.
Definition: qcustomplot.h:5691
int dataRangeCount() const
Definition: qcustomplot.h:954
virtual void donePainting()
Definition: qcustomplot.h:538
int bottom() const
Definition: qcustomplot.h:4658
The abstract base class for all data representing objects in a plot.
Definition: qcustomplot.h:3295
SpacingType
Definition: qcustomplot.h:5400
QCPDataContainer()
Definition: qcustomplot.h:2607
iterator begin()
Definition: qcustomplot.h:2444
double size() const
Definition: qcustomplot.h:799
double mainValue() const
Definition: qcustomplot.h:5143
void drawLine(const QLineF &line)
Definition: qcustomplot.cpp:360
ChartStyle
Definition: qcustomplot.h:5889
0x0001 Axis base line and tick marks
Definition: qcustomplot.h:219
void setAntialiasedScatters(bool enabled)
Definition: qcustomplot.cpp:10757
PainterMode
Definition: qcustomplot.h:469
static Qt::Orientation orientation(AxisType type)
Definition: qcustomplot.h:2123
Q_SLOT void setSelected(bool selected)
Definition: qcustomplot.cpp:18084
void clear()
Definition: qcustomplot.cpp:3049
Holds the data of one single error bar for QCPErrorBars.
Definition: qcustomplot.h:5966
Definition: qcustomplot.h:2265
PlottingHint
Definition: qcustomplot.h:240
QList< QCPDataRange > dataRanges() const
Definition: qcustomplot.h:957
Cosmetic pens are exported normally (e.g. in PDF exports, cosmetic pens always appear as 1 pixel on s...
Definition: qcustomplot.h:181
0x01 left margin
Definition: qcustomplot.h:201
MarginSide
Definition: qcustomplot.h:201
0x0010 Legend items
Definition: qcustomplot.h:223
A plottable representing a financial stock chart.
Definition: qcustomplot.h:5858
void setAutoSqueeze(bool enabled)
Definition: qcustomplot.h:2623
A plottable representing a two-dimensional color map in a plot.
Definition: qcustomplot.h:5748
QCPRange & operator*=(const double &value)
Definition: qcustomplot.h:790
virtual QCPPlottableInterface1D * interface1D()
Definition: qcustomplot.h:3341
static const double maxRange
Definition: qcustomplot.h:814
virtual bool sortKeyIsMainKey() const Q_DECL_OVERRIDE
Definition: qcustomplot.h:4209
LineStyle
Definition: qcustomplot.h:5317
QPoint center() const
Definition: qcustomplot.h:4666
A line from one point to another.
Definition: qcustomplot.h:6134
Holds the data of one single data point for QCPFinancial.
Definition: qcustomplot.h:5827
When dragging the mouse, a selection rect becomes active. Upon releasing, plottable data points that ...
Definition: qcustomplot.h:274
Resolution is given in dots per meter (dpm)
Definition: qcustomplot.h:170
A plottable that adds a set of error bars to other plottables.
Definition: qcustomplot.h:5995
virtual void wheelEvent(QWheelEvent *event)
Definition: qcustomplot.cpp:1803
virtual void mouseMoveEvent(QMouseEvent *event, const QPointF &startPos)
Definition: qcustomplot.cpp:1730
double sortKey() const
Definition: qcustomplot.h:5580
int index() const
Definition: qcustomplot.h:659
int columnCount() const
Definition: qcustomplot.h:1359
Interaction
Definition: qcustomplot.h:256
void setSelectionDecorator(QCPSelectionDecorator *decorator)
Definition: qcustomplot.cpp:10860
QPoint topRight() const
Definition: qcustomplot.h:4663