29 #include <QtCore/qglobal.h> 33 #ifdef QCUSTOMPLOT_USE_OPENGL 34 #if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) 35 #define QCP_OPENGL_PBUFFER 37 #define QCP_OPENGL_FBO 39 #if QT_VERSION >= QT_VERSION_CHECK(5, 3, 0) 40 #define QCP_OPENGL_OFFSCREENSURFACE 44 #if QT_VERSION >= QT_VERSION_CHECK(5, 4, 0) 45 #define QCP_DEVICEPIXELRATIO_SUPPORTED 46 #if QT_VERSION >= QT_VERSION_CHECK(5, 6, 0) 47 #define QCP_DEVICEPIXELRATIO_FLOAT 53 #include <QtCore/QCache> 54 #include <QtCore/QDateTime> 55 #include <QtCore/QDebug> 56 #include <QtCore/QFlags> 57 #include <QtCore/QMargins> 58 #include <QtCore/QMultiMap> 59 #include <QtCore/QObject> 60 #include <QtCore/QPointer> 61 #include <QtCore/QSharedPointer> 62 #include <QtCore/QStack> 63 #include <QtCore/QString> 64 #include <QtCore/QTimer> 65 #include <QtCore/QVector> 66 #include <QtGui/QMouseEvent> 67 #include <QtGui/QPaintEvent> 68 #include <QtGui/QPainter> 69 #include <QtGui/QPixmap> 70 #include <QtGui/QWheelEvent> 74 #include <QtGui/QOpenGLContext> 75 #include <QtGui/QOpenGLFramebufferObject> 76 #ifdef QCP_OPENGL_OFFSCREENSURFACE 77 #include <QtGui/QOffscreenSurface> 79 #include <QtGui/QWindow> 82 #ifdef QCP_OPENGL_PBUFFER 83 #include <QtOpenGL/QGLPixelBuffer> 85 #if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) 88 #include <QtGui/QPrintEngine> 89 #include <QtGui/QPrinter> 90 #include <QtGui/QWidget> 93 #include <QtPrintSupport/QtPrintSupport> 94 #include <QtWidgets/QWidget> 121 #define QCUSTOMPLOT_VERSION_STR "2.0.1" 122 #define QCUSTOMPLOT_VERSION 0x020001 125 #if defined(QT_STATIC_BUILD) 127 #elif defined(QCUSTOMPLOT_COMPILE_LIBRARY) 128 #define QCP_LIB_DECL Q_DECL_EXPORT 129 #elif defined(QCUSTOMPLOT_USE_LIBRARY) 130 #define QCP_LIB_DECL Q_DECL_IMPORT 136 #ifndef Q_DECL_OVERRIDE 137 #define Q_DECL_OVERRIDE 159 Q_FLAGS(AntialiasedElements)
161 Q_FLAGS(PlottingHints)
163 Q_FLAGS(Interactions)
420 return qIsNaN(value) || qIsInf(value);
441 margins.setLeft(value);
444 margins.setRight(value);
447 margins.setTop(value);
450 margins.setBottom(value);
453 margins = QMargins(value, value, value, value);
470 return margins.left();
472 return margins.right();
474 return margins.top();
476 return margins.bottom();
483 extern const QMetaObject
489 Q_DECLARE_OPERATORS_FOR_FLAGS(QCP::AntialiasedElements)
490 Q_DECLARE_OPERATORS_FOR_FLAGS(QCP::PlottingHints)
491 Q_DECLARE_OPERATORS_FOR_FLAGS(QCP::MarginSides)
492 Q_DECLARE_OPERATORS_FOR_FLAGS(QCP::Interactions)
516 double x()
const {
return mX; }
517 double y()
const {
return mY; }
518 double &
rx() {
return mX; }
519 double &
ry() {
return mY; }
522 void setX(
double x) { mX = x; }
523 void setY(
double y) { mY = y; }
526 double length()
const {
return qSqrt(mX * mX + mY * mY); }
528 QPoint
toPoint()
const {
return QPoint(mX, mY); }
529 QPointF
toPointF()
const {
return QPointF(mX, mY); }
531 bool isNull()
const {
return qIsNull(mX) && qIsNull(mY); }
536 double distanceSquaredToLine(
const QCPVector2D &start,
538 double distanceSquaredToLine(
const QLineF &line)
const;
539 double distanceToStraightLine(
const QCPVector2D &base,
566 return QCPVector2D(vec.mX * factor, vec.mY * factor);
569 return QCPVector2D(vec.mX * factor, vec.mY * factor);
572 return QCPVector2D(vec.mX / divisor, vec.mY / divisor);
576 return QCPVector2D(vec1.mX + vec2.mX, vec1.mY + vec2.mY);
580 return QCPVector2D(vec1.mX - vec2.mX, vec1.mY - vec2.mY);
591 d.nospace() <<
"QCPVector2D(" << vec.
x() <<
", " << vec.
y() <<
")";
626 Q_FLAGS(PainterModes)
633 bool antialiasing()
const {
return testRenderHint(QPainter::Antialiasing); }
634 PainterModes
modes()
const {
return mModes; }
637 void setAntialiasing(
bool enabled);
638 void setMode(
PainterMode mode,
bool enabled =
true);
639 void setModes(PainterModes modes);
642 bool begin(QPaintDevice *device);
643 void setPen(
const QPen &pen);
644 void setPen(
const QColor &color);
645 void setPen(Qt::PenStyle penStyle);
646 void drawLine(
const QLineF &line);
647 void drawLine(
const QPointF &p1,
const QPointF &p2) {
648 drawLine(QLineF(p1, p2));
654 void makeNonCosmetic();
659 bool mIsAntialiasing;
662 QStack<bool> mAntialiasingStack;
664 Q_DECLARE_OPERATORS_FOR_FLAGS(QCPPainter::PainterModes)
678 QSize
size()
const {
return mSize; }
683 void setSize(
const QSize &size);
684 void setInvalidated(
bool invalidated =
true);
685 void setDevicePixelRatio(
double ratio);
690 virtual void draw(
QCPPainter *painter)
const = 0;
691 virtual void clear(
const QColor &color) = 0;
702 virtual void reallocateBuffer() = 0;
720 virtual void reallocateBuffer() Q_DECL_OVERRIDE;
723 #ifdef QCP_OPENGL_PBUFFER 726 explicit QCPPaintBufferGlPbuffer(
const QSize &size,
double devicePixelRatio,
728 virtual ~QCPPaintBufferGlPbuffer();
737 QGLPixelBuffer *mGlPBuffer;
743 #endif // QCP_OPENGL_PBUFFER 745 #ifdef QCP_OPENGL_FBO 748 explicit QCPPaintBufferGlFbo(
const QSize &size,
double devicePixelRatio,
749 QWeakPointer<QOpenGLContext> glContext,
750 QWeakPointer<QOpenGLPaintDevice> glPaintDevice);
751 virtual ~QCPPaintBufferGlFbo();
761 QWeakPointer<QOpenGLContext> mGlContext;
762 QWeakPointer<QOpenGLPaintDevice> mGlPaintDevice;
763 QOpenGLFramebufferObject *mGlFrameBuffer;
768 #endif // QCP_OPENGL_FBO 778 Q_PROPERTY(
QCustomPlot *parentPlot READ parentPlot)
779 Q_PROPERTY(QString name READ name)
780 Q_PROPERTY(
int index READ index)
781 Q_PROPERTY(QList<QCPLayerable *> children READ children)
782 Q_PROPERTY(
bool visible READ visible WRITE setVisible)
783 Q_PROPERTY(LayerMode mode READ mode WRITE setMode)
802 QCPLayer(
QCustomPlot *parentPlot,
const QString &layerName);
807 QString
name()
const {
return mName; }
808 int index()
const {
return mIndex; }
809 QList<QCPLayerable *>
children()
const {
return mChildren; }
814 void setVisible(
bool visible);
825 QList<QCPLayerable *> mChildren;
834 void drawToPaintBuffer();
839 Q_DISABLE_COPY(QCPLayer)
849 Q_PROPERTY(
bool visible READ visible WRITE setVisible)
850 Q_PROPERTY(
QCustomPlot *parentPlot READ parentPlot)
851 Q_PROPERTY(
QCPLayerable *parentLayerable READ parentLayerable)
852 Q_PROPERTY(QCPLayer *layer READ layer WRITE setLayer NOTIFY layerChanged)
853 Q_PROPERTY(
bool antialiased READ antialiased WRITE setAntialiased)
864 QCPLayer *
layer()
const {
return mLayer; }
868 void setVisible(
bool on);
869 Q_SLOT
bool setLayer(QCPLayer *layer);
870 bool setLayer(
const QString &layerName);
871 void setAntialiased(
bool enabled);
874 virtual double selectTest(
const QPointF &pos,
bool onlySelectable,
875 QVariant *details = 0)
const;
878 bool realVisibility()
const;
881 void layerChanged(QCPLayer *newLayer);
887 QPointer<QCPLayerable> mParentLayerable;
892 virtual void parentPlotInitialized(
QCustomPlot *parentPlot);
894 virtual QRect clipRect()
const;
895 virtual void applyDefaultAntialiasingHint(
QCPPainter *painter)
const = 0;
898 virtual void selectEvent(QMouseEvent *event,
bool additive,
899 const QVariant &details,
900 bool *selectionStateChanged);
901 virtual void deselectEvent(
bool *selectionStateChanged);
903 virtual void mousePressEvent(QMouseEvent *event,
const QVariant &details);
904 virtual void mouseMoveEvent(QMouseEvent *event,
const QPointF &startPos);
905 virtual void mouseReleaseEvent(QMouseEvent *event,
const QPointF &startPos);
906 virtual void mouseDoubleClickEvent(QMouseEvent *event,
907 const QVariant &details);
908 virtual void wheelEvent(QWheelEvent *event);
911 void initializeParentPlot(
QCustomPlot *parentPlot);
913 bool moveToLayer(QCPLayer *layer,
bool prepend);
914 void applyAntialiasingHint(
QCPPainter *painter,
bool localAntialiased,
921 friend class QCPLayer;
935 QCPRange(
double lower,
double upper);
938 return lower == other.
lower && upper == other.
upper;
969 double size()
const {
return upper - lower; }
970 double center()
const {
return (upper + lower) * 0.5; }
972 if (lower > upper) qSwap(lower, upper);
974 void expand(
const QCPRange &otherRange);
975 void expand(
double includeCoord);
977 QCPRange expanded(
double includeCoord)
const;
978 QCPRange bounded(
double lowerBound,
double upperBound)
const;
979 QCPRange sanitizedForLogScale()
const;
980 QCPRange sanitizedForLinScale()
const;
981 bool contains(
double value)
const {
return value >= lower && value <= upper; }
983 static bool validRange(
double lower,
double upper);
984 static bool validRange(
const QCPRange &range);
985 static const double minRange;
986 static const double maxRange;
995 d.nospace() <<
"QCPRange(" << range.
lower <<
", " << range.
upper <<
")";
1064 return mBegin == other.mBegin && mEnd == other.mEnd;
1070 int end()
const {
return mEnd; }
1071 int size()
const {
return mEnd - mBegin; }
1079 bool isValid()
const {
return (mEnd >= mBegin) && (mBegin >= 0); }
1085 return QCPDataRange(mBegin + changeBegin, mEnd + changeEnd);
1103 return !(*
this == other);
1128 int dataPointCount()
const;
1134 void addDataRange(
const QCPDataRange &dataRange,
bool simplify =
true);
1136 bool isEmpty()
const {
return mDataRanges.isEmpty(); }
1146 QList<QCPDataRange> mDataRanges;
1148 inline static bool lessThanDataRangeBegin(
const QCPDataRange &a,
1252 d.nospace() <<
"QCPDataRange(" << dataRange.
begin() <<
", " << dataRange.
end()
1262 d.nospace() <<
"QCPDataSelection(";
1264 if (i != 0) d <<
", ";
1283 QRect
rect()
const {
return mRect; }
1285 QPen
pen()
const {
return mPen; }
1290 void setPen(
const QPen &pen);
1291 void setBrush(
const QBrush &brush);
1294 Q_SLOT
void cancel();
1297 void started(QMouseEvent *event);
1298 void changed(
const QRect &rect, QMouseEvent *event);
1299 void canceled(
const QRect &rect, QInputEvent *event);
1300 void accepted(
const QRect &rect, QMouseEvent *event);
1311 virtual void startSelection(QMouseEvent *event);
1312 virtual void moveSelection(QMouseEvent *event);
1313 virtual void endSelection(QMouseEvent *event);
1314 virtual void keyPressEvent(QKeyEvent *event);
1317 virtual void applyDefaultAntialiasingHint(
QCPPainter *painter)
const 1337 return mChildren.value(side);
1339 bool isEmpty()
const;
1345 QHash<QCP::MarginSide, QList<QCPLayoutElement *> > mChildren;
1363 Q_PROPERTY(
QCPLayout *layout READ layout)
1364 Q_PROPERTY(QRect rect READ rect)
1365 Q_PROPERTY(QRect outerRect READ outerRect WRITE setOuterRect)
1366 Q_PROPERTY(QMargins margins READ margins WRITE setMargins)
1368 QMargins minimumMargins READ minimumMargins WRITE setMinimumMargins)
1369 Q_PROPERTY(QSize minimumSize READ minimumSize WRITE setMinimumSize)
1370 Q_PROPERTY(QSize maximumSize READ maximumSize WRITE setMaximumSize)
1371 Q_PROPERTY(SizeConstraintRect sizeConstraintRect READ sizeConstraintRect WRITE
1372 setSizeConstraintRect)
1406 explicit QCPLayoutElement(
QCustomPlot *parentPlot = 0);
1407 virtual ~QCPLayoutElement();
1411 QRect
rect()
const {
return mRect; }
1423 return mMarginGroups;
1427 void setOuterRect(
const QRect &rect);
1428 void setMargins(
const QMargins &margins);
1429 void setMinimumMargins(
const QMargins &margins);
1430 void setAutoMargins(QCP::MarginSides sides);
1431 void setMinimumSize(
const QSize &size);
1432 void setMinimumSize(
int width,
int height);
1433 void setMaximumSize(
const QSize &size);
1434 void setMaximumSize(
int width,
int height);
1436 void setMarginGroup(QCP::MarginSides sides,
QCPMarginGroup *group);
1440 virtual QSize minimumOuterSizeHint()
const;
1441 virtual QSize maximumOuterSizeHint()
const;
1442 virtual QList<QCPLayoutElement *> elements(
bool recursive)
const;
1445 virtual double selectTest(
const QPointF &pos,
bool onlySelectable,
1451 QSize mMinimumSize, mMaximumSize;
1453 QRect mRect, mOuterRect;
1454 QMargins mMargins, mMinimumMargins;
1455 QCP::MarginSides mAutoMargins;
1456 QHash<QCP::MarginSide, QCPMarginGroup *> mMarginGroups;
1460 virtual void layoutChanged();
1471 Q_DISABLE_COPY(QCPLayoutElement)
1482 explicit QCPLayout();
1486 virtual QList<QCPLayoutElement *> elements(
bool recursive)
const 1490 virtual int elementCount()
const = 0;
1494 virtual void simplify();
1497 bool removeAt(
int index);
1503 virtual void updateLayout();
1506 void sizeConstraintsChanged()
const;
1509 QVector<int> getSectionSizes(QVector<int> maxSizes, QVector<int> minSizes,
1510 QVector<double> stretchFactors,
1511 int totalSize)
const;
1516 Q_DISABLE_COPY(QCPLayout)
1523 Q_PROPERTY(
int rowCount READ rowCount)
1524 Q_PROPERTY(
int columnCount READ columnCount)
1525 Q_PROPERTY(QList<double> columnStretchFactors READ columnStretchFactors WRITE
1526 setColumnStretchFactors)
1527 Q_PROPERTY(QList<double> rowStretchFactors READ rowStretchFactors WRITE
1528 setRowStretchFactors)
1529 Q_PROPERTY(
int columnSpacing READ columnSpacing WRITE setColumnSpacing)
1530 Q_PROPERTY(
int rowSpacing READ rowSpacing WRITE setRowSpacing)
1531 Q_PROPERTY(FillOrder fillOrder READ fillOrder WRITE setFillOrder)
1532 Q_PROPERTY(
int wrap READ wrap WRITE setWrap)
1552 explicit QCPLayoutGrid();
1553 virtual ~QCPLayoutGrid();
1558 return mElements.size() > 0 ? mElements.first().size() : 0;
1568 void setColumnStretchFactor(
int column,
double factor);
1569 void setColumnStretchFactors(
const QList<double> &factors);
1570 void setRowStretchFactor(
int row,
double factor);
1571 void setRowStretchFactors(
const QList<double> &factors);
1572 void setColumnSpacing(
int pixels);
1573 void setRowSpacing(
int pixels);
1574 void setWrap(
int count);
1575 void setFillOrder(
FillOrder order,
bool rearrange =
true);
1580 return rowCount() * columnCount();
1585 virtual QList<QCPLayoutElement *> elements(
bool recursive)
const 1595 bool hasElement(
int row,
int column);
1596 void expandTo(
int newRowCount,
int newColumnCount);
1597 void insertRow(
int newIndex);
1598 void insertColumn(
int newIndex);
1599 int rowColToIndex(
int row,
int column)
const;
1600 void indexToRowCol(
int index,
int &row,
int &column)
const;
1604 QList<QList<QCPLayoutElement *> > mElements;
1605 QList<double> mColumnStretchFactors;
1606 QList<double> mRowStretchFactors;
1607 int mColumnSpacing, mRowSpacing;
1612 void getMinimumRowColSizes(QVector<int> *minColWidths,
1613 QVector<int> *minRowHeights)
const;
1614 void getMaximumRowColSizes(QVector<int> *maxColWidths,
1615 QVector<int> *maxRowHeights)
const;
1618 Q_DISABLE_COPY(QCPLayoutGrid)
1643 Qt::Alignment insetAlignment(
int index)
const;
1644 QRectF insetRect(
int index)
const;
1648 void setInsetAlignment(
int index, Qt::Alignment alignment);
1649 void setInsetRect(
int index,
const QRectF &rect);
1658 virtual double selectTest(
const QPointF &pos,
bool onlySelectable,
1667 QList<QCPLayoutElement *> mElements;
1668 QList<InsetPlacement> mInsetPlacement;
1669 QList<Qt::Alignment> mInsetAlignment;
1670 QList<QRectF> mInsetRect;
1724 QCPLineEnding(
EndingStyle style,
double width = 8,
double length = 10,
1725 bool inverted =
false);
1735 void setWidth(
double width);
1736 void setLength(
double length);
1737 void setInverted(
bool inverted);
1740 double boundingDistance()
const;
1741 double realLength()
const;
1749 double mWidth, mLength;
1781 virtual ~QCPAxisTicker();
1790 void setTickCount(
int count);
1791 void setTickOrigin(
double origin);
1794 virtual void generate(
const QCPRange &range,
const QLocale &locale,
1795 QChar formatChar,
int precision, QVector<double> &ticks,
1796 QVector<double> *subTicks,
1797 QVector<QString> *tickLabels);
1806 virtual double getTickStep(
const QCPRange &range);
1807 virtual int getSubTickCount(
double tickStep);
1808 virtual QString getTickLabel(
double tick,
const QLocale &locale,
1809 QChar formatChar,
int precision);
1810 virtual QVector<double> createTickVector(
double tickStep,
1812 virtual QVector<double> createSubTickVector(
int subTickCount,
1813 const QVector<double> &ticks);
1814 virtual QVector<QString> createLabelVector(
const QVector<double> &ticks,
1815 const QLocale &locale,
1816 QChar formatChar,
int precision);
1819 void trimTicks(
const QCPRange &range, QVector<double> &ticks,
1820 bool keepOneOutlier)
const;
1821 double pickClosest(
double target,
const QVector<double> &candidates)
const;
1822 double getMantissa(
double input,
double *magnitude = 0)
const;
1823 double cleanMantissa(
double input)
const;
1826 Q_DISABLE_COPY(QCPAxisTicker)
1829 Q_DECLARE_METATYPE(QSharedPointer<QCPAxisTicker>)
1845 void setDateTimeFormat(
const QString &format);
1846 void setDateTimeSpec(Qt::TimeSpec spec);
1850 void setTickOrigin(
const QDateTime &origin);
1853 static QDateTime keyToDateTime(
double key);
1854 static double dateTimeToKey(
const QDateTime dateTime);
1855 static double dateTimeToKey(
const QDate date);
1872 virtual QString getTickLabel(
double tick,
const QLocale &locale,
1874 virtual QVector<double> createTickVector(
1912 void setTimeFormat(
const QString &format);
1913 void setFieldWidth(
TimeUnit unit,
int width);
1927 virtual QString getTickLabel(
double tick,
const QLocale &locale,
1931 void replaceUnit(QString &text,
TimeUnit unit,
int value)
const;
1969 void setTickStep(
double step);
1992 QMap<double, QString> &
ticks() {
return mTicks; }
1996 void setTicks(
const QMap<double, QString> &ticks);
1997 void setTicks(
const QVector<double> &positions,
1998 const QVector<QString> &labels);
1999 void setSubTickCount(
int subTicks);
2003 void addTick(
double position,
const QString &label);
2004 void addTicks(
const QMap<double, QString> &ticks);
2005 void addTicks(
const QVector<double> &positions,
2006 const QVector<QString> &labels);
2016 virtual QString getTickLabel(
double tick,
const QLocale &locale,
2018 virtual QVector<double> createTickVector(
2056 void setPiSymbol(QString symbol);
2057 void setPiValue(
double pi);
2058 void setPeriodicity(
int multiplesOfPi);
2074 virtual QString getTickLabel(
double tick,
const QLocale &locale,
2078 void simplifyFraction(
int &numerator,
int &denominator)
const;
2079 QString fractionToString(
int numerator,
int denominator)
const;
2080 QString unicodeFraction(
int numerator,
int denominator)
const;
2081 QString unicodeSuperscript(
int number)
const;
2082 QString unicodeSubscript(
int number)
const;
2100 void setLogBase(
double base);
2101 void setSubTickCount(
int subTicks);
2114 virtual QVector<double> createTickVector(
2126 Q_PROPERTY(
bool subGridVisible READ subGridVisible WRITE setSubGridVisible)
2127 Q_PROPERTY(
bool antialiasedSubGrid READ antialiasedSubGrid WRITE
2128 setAntialiasedSubGrid)
2129 Q_PROPERTY(
bool antialiasedZeroLine READ antialiasedZeroLine WRITE
2130 setAntialiasedZeroLine)
2131 Q_PROPERTY(QPen pen READ pen WRITE setPen)
2132 Q_PROPERTY(QPen subGridPen READ subGridPen WRITE setSubGridPen)
2133 Q_PROPERTY(QPen zeroLinePen READ zeroLinePen WRITE setZeroLinePen)
2142 QPen
pen()
const {
return mPen; }
2147 void setSubGridVisible(
bool visible);
2148 void setAntialiasedSubGrid(
bool enabled);
2149 void setAntialiasedZeroLine(
bool enabled);
2150 void setPen(
const QPen &pen);
2151 void setSubGridPen(
const QPen &pen);
2152 void setZeroLinePen(
const QPen &pen);
2156 bool mSubGridVisible;
2157 bool mAntialiasedSubGrid, mAntialiasedZeroLine;
2158 QPen mPen, mSubGridPen, mZeroLinePen;
2164 virtual void applyDefaultAntialiasingHint(
QCPPainter *painter)
const 2169 void drawGridLines(
QCPPainter *painter)
const;
2170 void drawSubGridLines(
QCPPainter *painter)
const;
2178 Q_PROPERTY(AxisType axisType READ axisType)
2180 Q_PROPERTY(ScaleType scaleType READ scaleType WRITE setScaleType NOTIFY
2182 Q_PROPERTY(
QCPRange range READ range WRITE setRange NOTIFY rangeChanged)
2183 Q_PROPERTY(
bool rangeReversed READ rangeReversed WRITE setRangeReversed)
2184 Q_PROPERTY(QSharedPointer<QCPAxisTicker> ticker READ ticker WRITE setTicker)
2185 Q_PROPERTY(
bool ticks READ ticks WRITE setTicks)
2186 Q_PROPERTY(
bool tickLabels READ tickLabels WRITE setTickLabels)
2188 int tickLabelPadding READ tickLabelPadding WRITE setTickLabelPadding)
2189 Q_PROPERTY(QFont tickLabelFont READ tickLabelFont WRITE setTickLabelFont)
2190 Q_PROPERTY(QColor tickLabelColor READ tickLabelColor WRITE setTickLabelColor)
2191 Q_PROPERTY(
double tickLabelRotation READ tickLabelRotation WRITE
2192 setTickLabelRotation)
2193 Q_PROPERTY(LabelSide tickLabelSide READ tickLabelSide WRITE setTickLabelSide)
2194 Q_PROPERTY(QString numberFormat READ numberFormat WRITE setNumberFormat)
2195 Q_PROPERTY(
int numberPrecision READ numberPrecision WRITE setNumberPrecision)
2196 Q_PROPERTY(QVector<double> tickVector READ tickVector)
2197 Q_PROPERTY(QVector<QString> tickVectorLabels READ tickVectorLabels)
2198 Q_PROPERTY(
int tickLengthIn READ tickLengthIn WRITE setTickLengthIn)
2199 Q_PROPERTY(
int tickLengthOut READ tickLengthOut WRITE setTickLengthOut)
2200 Q_PROPERTY(
bool subTicks READ subTicks WRITE setSubTicks)
2201 Q_PROPERTY(
int subTickLengthIn READ subTickLengthIn WRITE setSubTickLengthIn)
2203 int subTickLengthOut READ subTickLengthOut WRITE setSubTickLengthOut)
2204 Q_PROPERTY(QPen basePen READ basePen WRITE setBasePen)
2205 Q_PROPERTY(QPen tickPen READ tickPen WRITE setTickPen)
2206 Q_PROPERTY(QPen subTickPen READ subTickPen WRITE setSubTickPen)
2207 Q_PROPERTY(QFont labelFont READ labelFont WRITE setLabelFont)
2208 Q_PROPERTY(QColor labelColor READ labelColor WRITE setLabelColor)
2209 Q_PROPERTY(QString label READ label WRITE setLabel)
2210 Q_PROPERTY(
int labelPadding READ labelPadding WRITE setLabelPadding)
2211 Q_PROPERTY(
int padding READ padding WRITE setPadding)
2212 Q_PROPERTY(
int offset READ offset WRITE setOffset)
2213 Q_PROPERTY(SelectableParts selectedParts READ selectedParts WRITE
2214 setSelectedParts NOTIFY selectionChanged)
2215 Q_PROPERTY(SelectableParts selectableParts READ selectableParts WRITE
2216 setSelectableParts NOTIFY selectableChanged)
2217 Q_PROPERTY(QFont selectedTickLabelFont READ selectedTickLabelFont WRITE
2218 setSelectedTickLabelFont)
2220 QFont selectedLabelFont READ selectedLabelFont WRITE setSelectedLabelFont)
2221 Q_PROPERTY(QColor selectedTickLabelColor READ selectedTickLabelColor WRITE
2222 setSelectedTickLabelColor)
2223 Q_PROPERTY(QColor selectedLabelColor READ selectedLabelColor WRITE
2224 setSelectedLabelColor)
2225 Q_PROPERTY(QPen selectedBasePen READ selectedBasePen WRITE setSelectedBasePen)
2226 Q_PROPERTY(QPen selectedTickPen READ selectedTickPen WRITE setSelectedTickPen)
2227 Q_PROPERTY(QPen selectedSubTickPen READ selectedSubTickPen WRITE
2228 setSelectedSubTickPen)
2229 Q_PROPERTY(
QCPLineEnding lowerEnding READ lowerEnding WRITE setLowerEnding)
2230 Q_PROPERTY(
QCPLineEnding upperEnding READ upperEnding WRITE setUpperEnding)
2231 Q_PROPERTY(
QCPGrid *grid READ grid)
2254 Q_DECLARE_FLAGS(AxisTypes,
AxisType)
2288 spTickLabels = 0x002
2294 Q_FLAGS(SelectableParts)
2306 QSharedPointer<QCPAxisTicker>
ticker()
const {
return mTicker; }
2309 int tickLabelPadding()
const;
2312 double tickLabelRotation()
const;
2314 QString numberFormat()
const;
2318 int tickLengthIn()
const;
2319 int tickLengthOut()
const;
2321 int subTickLengthIn()
const;
2322 int subTickLengthOut()
const;
2328 QString
label()
const {
return mLabel; }
2329 int labelPadding()
const;
2347 Q_SLOT
void setRange(
const QCPRange &range);
2348 void setRange(
double lower,
double upper);
2349 void setRange(
double position,
double size, Qt::AlignmentFlag alignment);
2350 void setRangeLower(
double lower);
2351 void setRangeUpper(
double upper);
2352 void setRangeReversed(
bool reversed);
2353 void setTicker(QSharedPointer<QCPAxisTicker> ticker);
2354 void setTicks(
bool show);
2355 void setTickLabels(
bool show);
2356 void setTickLabelPadding(
int padding);
2357 void setTickLabelFont(
const QFont &font);
2358 void setTickLabelColor(
const QColor &color);
2359 void setTickLabelRotation(
double degrees);
2361 void setNumberFormat(
const QString &formatCode);
2362 void setNumberPrecision(
int precision);
2363 void setTickLength(
int inside,
int outside = 0);
2364 void setTickLengthIn(
int inside);
2365 void setTickLengthOut(
int outside);
2366 void setSubTicks(
bool show);
2367 void setSubTickLength(
int inside,
int outside = 0);
2368 void setSubTickLengthIn(
int inside);
2369 void setSubTickLengthOut(
int outside);
2370 void setBasePen(
const QPen &pen);
2371 void setTickPen(
const QPen &pen);
2372 void setSubTickPen(
const QPen &pen);
2373 void setLabelFont(
const QFont &font);
2374 void setLabelColor(
const QColor &color);
2375 void setLabel(
const QString &str);
2376 void setLabelPadding(
int padding);
2377 void setPadding(
int padding);
2378 void setOffset(
int offset);
2379 void setSelectedTickLabelFont(
const QFont &font);
2380 void setSelectedLabelFont(
const QFont &font);
2381 void setSelectedTickLabelColor(
const QColor &color);
2382 void setSelectedLabelColor(
const QColor &color);
2383 void setSelectedBasePen(
const QPen &pen);
2384 void setSelectedTickPen(
const QPen &pen);
2385 void setSelectedSubTickPen(
const QPen &pen);
2386 Q_SLOT
void setSelectableParts(
2387 const QCPAxis::SelectableParts &selectableParts);
2388 Q_SLOT
void setSelectedParts(
const QCPAxis::SelectableParts &selectedParts);
2393 virtual double selectTest(
const QPointF &pos,
bool onlySelectable,
2399 return rangeReversed() != (orientation() == Qt::Vertical) ? -1 : 1;
2401 void moveRange(
double diff);
2402 void scaleRange(
double factor);
2403 void scaleRange(
double factor,
double center);
2404 void setScaleRatio(
const QCPAxis *otherAxis,
double ratio = 1.0);
2405 void rescale(
bool onlyVisiblePlottables =
false);
2406 double pixelToCoord(
double value)
const;
2407 double coordToPixel(
double value)
const;
2409 QList<QCPAbstractPlottable *> plottables()
const;
2410 QList<QCPGraph *> graphs()
const;
2411 QList<QCPAbstractItem *> items()
const;
2415 return type == atBottom || type == atTop ? Qt::Horizontal : Qt::Vertical;
2420 void rangeChanged(
const QCPRange &newRange);
2423 void selectionChanged(
const QCPAxis::SelectableParts &parts);
2424 void selectableChanged(
const QCPAxis::SelectableParts &parts);
2433 Qt::Orientation mOrientation;
2434 SelectableParts mSelectableParts, mSelectedParts;
2435 QPen mBasePen, mSelectedBasePen;
2440 QFont mLabelFont, mSelectedLabelFont;
2441 QColor mLabelColor, mSelectedLabelColor;
2446 QFont mTickLabelFont, mSelectedTickLabelFont;
2447 QColor mTickLabelColor, mSelectedTickLabelColor;
2448 int mNumberPrecision;
2449 QLatin1Char mNumberFormatChar;
2450 bool mNumberBeautifulPowers;
2457 QPen mTickPen, mSelectedTickPen;
2458 QPen mSubTickPen, mSelectedSubTickPen;
2461 bool mRangeReversed;
2468 QVector<double> mTickVector;
2469 QVector<QString> mTickVectorLabels;
2470 QVector<double> mSubTickVector;
2471 bool mCachedMarginValid;
2478 virtual int calculateMargin();
2481 virtual void applyDefaultAntialiasingHint(
QCPPainter *painter)
const 2486 virtual
void selectEvent(QMouseEvent *event,
bool additive,
2487 const QVariant &details,
2489 virtual
void deselectEvent(
bool *selectionStateChanged) Q_DECL_OVERRIDE;
2491 virtual
void mousePressEvent(QMouseEvent *event,
2492 const QVariant &details) Q_DECL_OVERRIDE;
2493 virtual
void mouseMoveEvent(QMouseEvent *event,
2494 const QPointF &startPos) Q_DECL_OVERRIDE;
2495 virtual
void mouseReleaseEvent(QMouseEvent *event,
2496 const QPointF &startPos) Q_DECL_OVERRIDE;
2497 virtual
void wheelEvent(QWheelEvent *event) Q_DECL_OVERRIDE;
2500 void setupTickVectors();
2501 QPen getBasePen() const;
2502 QPen getTickPen() const;
2503 QPen getSubTickPen() const;
2504 QFont getTickLabelFont() const;
2505 QFont getLabelFont() const;
2506 QColor getTickLabelColor() const;
2507 QColor getLabelColor() const;
2510 Q_DISABLE_COPY(QCPAxis)
2516 Q_DECLARE_OPERATORS_FOR_FLAGS(QCPAxis::SelectableParts)
2517 Q_DECLARE_OPERATORS_FOR_FLAGS(QCPAxis::AxisTypes)
2518 Q_DECLARE_METATYPE(QCPAxis::
AxisType)
2525 explicit QCPAxisPainterPrivate(QCustomPlot *parentPlot);
2526 virtual ~QCPAxisPainterPrivate();
2529 virtual int size()
const;
2545 int tickLabelPadding;
2546 double tickLabelRotation;
2549 bool substituteExponent;
2550 bool numberMultiplyCross;
2551 int tickLengthIn, tickLengthOut, subTickLengthIn,
2553 QPen tickPen, subTickPen;
2554 QFont tickLabelFont;
2555 QColor tickLabelColor;
2556 QRect axisRect, viewportRect;
2558 bool abbreviateDecimalPowers;
2559 bool reversedEndings;
2561 QVector<double> subTickPositions;
2562 QVector<double> tickPositions;
2563 QVector<QString> tickLabels;
2572 QRect baseBounds, expBounds,
suffixBounds, totalBounds, rotatedTotalBounds;
2573 QFont baseFont, expFont;
2575 QCustomPlot *mParentPlot;
2576 QByteArray mLabelParameterHash;
2578 QCache<QString, CachedLabel> mLabelCache;
2579 QRect mAxisSelectionBox, mTickLabelsSelectionBox, mLabelSelectionBox;
2581 virtual QByteArray generateLabelParameterHash()
const;
2583 virtual void placeTickLabel(
QCPPainter *painter,
double position,
2584 int distanceToAxis,
const QString &text,
2585 QSize *tickLabelsSize);
2586 virtual void drawTickLabel(
QCPPainter *painter,
double x,
double y,
2589 const QString &text)
const;
2590 virtual QPointF getTickLabelDrawOffset(
const TickLabelData &labelData)
const;
2591 virtual void getMaxTickLabelSize(
const QFont &font,
const QString &text,
2592 QSize *tickLabelsSize)
const;
2626 Q_FLAGS(ScatterProperties)
2696 const QBrush &brush = Qt::NoBrush,
double size = 6);
2699 double size()
const {
return mSize; }
2701 QPen
pen()
const {
return mPen; }
2707 void setFromOther(
const QCPScatterStyle &other, ScatterProperties properties);
2708 void setSize(
double size);
2710 void setPen(
const QPen &pen);
2711 void setBrush(
const QBrush &brush);
2712 void setPixmap(
const QPixmap &pixmap);
2713 void setCustomPath(
const QPainterPath &customPath);
2716 bool isNone()
const {
return mShape == ssNone; }
2719 void applyTo(
QCPPainter *painter,
const QPen &defaultPen)
const;
2720 void drawShape(
QCPPainter *painter,
const QPointF &pos)
const;
2721 void drawShape(
QCPPainter *painter,
double x,
double y)
const;
2730 QPainterPath mCustomPath;
2736 Q_DECLARE_OPERATORS_FOR_FLAGS(QCPScatterStyle::ScatterProperties)
2750 template <
class DataType>
2752 return a.sortKey() < b.sortKey();
2755 template <
class DataType>
2766 int size()
const {
return mData.size() - mPreallocSize; }
2771 void setAutoSqueeze(
bool enabled);
2775 void set(
const QVector<DataType> &data,
bool alreadySorted =
false);
2777 void add(
const QVector<DataType> &data,
bool alreadySorted =
false);
2778 void add(
const DataType &data);
2779 void removeBefore(
double sortKey);
2780 void removeAfter(
double sortKey);
2781 void remove(
double sortKeyFrom,
double sortKeyTo);
2782 void remove(
double sortKey);
2785 void squeeze(
bool preAllocation =
true,
bool postAllocation =
true);
2788 return mData.constBegin() + mPreallocSize;
2790 const_iterator
constEnd()
const {
return mData.constEnd(); }
2791 iterator
begin() {
return mData.begin() + mPreallocSize; }
2792 iterator
end() {
return mData.end(); }
2793 const_iterator findBegin(
double sortKey,
bool expandedRange =
true)
const;
2794 const_iterator findEnd(
double sortKey,
bool expandedRange =
true)
const;
2795 const_iterator
at(
int index)
const {
2796 return constBegin() + qBound(0, index, size());
2799 QCPRange valueRange(
bool &foundRange,
2803 void limitIteratorsToDataRange(const_iterator &begin, const_iterator &end,
2816 void preallocateGrow(
int minimumPreallocSize);
2817 void performAutoSqueeze();
2977 template <
class DataType>
2979 : mAutoSqueeze(true), mPreallocSize(0), mPreallocIteration(0) {}
2989 template <
class DataType>
3003 template <
class DataType>
3019 template <
class DataType>
3021 bool alreadySorted) {
3025 if (!alreadySorted)
sort();
3034 template <
class DataType>
3038 const int n = data.
size();
3039 const int oldSize =
size();
3042 !qcpLessThanSortKey<DataType>(
3055 !qcpLessThanSortKey<DataType>(
3060 qcpLessThanSortKey<DataType>);
3073 template <
class DataType>
3075 bool alreadySorted) {
3076 if (data.isEmpty())
return;
3078 set(data, alreadySorted);
3082 const int n = data.size();
3083 const int oldSize =
size();
3085 if (alreadySorted && oldSize > 0 &&
3086 !qcpLessThanSortKey<DataType>(
3093 std::copy(data.constBegin(), data.constEnd(),
begin());
3098 std::copy(data.constBegin(), data.constEnd(),
end() - n);
3100 std::sort(
end() - n,
end(), qcpLessThanSortKey<DataType>);
3102 !qcpLessThanSortKey<DataType>(
3107 qcpLessThanSortKey<DataType>);
3117 template <
class DataType>
3120 !qcpLessThanSortKey<DataType>(
3125 }
else if (qcpLessThanSortKey<DataType>(
3135 std::lower_bound(
begin(),
end(), data, qcpLessThanSortKey<DataType>);
3136 mData.insert(insertionPoint, data);
3145 template <
class DataType>
3149 std::lower_bound(
begin(),
end(), DataType::fromSortKey(sortKey),
3150 qcpLessThanSortKey<DataType>);
3162 template <
class DataType>
3165 std::upper_bound(
begin(),
end(), DataType::fromSortKey(sortKey),
3166 qcpLessThanSortKey<DataType>);
3168 mData.erase(it, itEnd);
3180 template <
class DataType>
3182 if (sortKeyFrom >= sortKeyTo ||
isEmpty())
return;
3185 std::lower_bound(
begin(),
end(), DataType::fromSortKey(sortKeyFrom),
3186 qcpLessThanSortKey<DataType>);
3188 std::upper_bound(it,
end(), DataType::fromSortKey(sortKeyTo),
3189 qcpLessThanSortKey<DataType>);
3190 mData.erase(it, itEnd);
3203 template <
class DataType>
3206 std::lower_bound(
begin(),
end(), DataType::fromSortKey(sortKey),
3207 qcpLessThanSortKey<DataType>);
3208 if (it !=
end() && it->sortKey() == sortKey) {
3224 template <
class DataType>
3243 template <
class DataType>
3245 std::sort(
begin(),
end(), qcpLessThanSortKey<DataType>);
3259 template <
class DataType>
3261 bool postAllocation) {
3262 if (preAllocation) {
3270 if (postAllocation)
mData.squeeze();
3289 template <
class DataType>
3292 bool expandedRange)
const {
3297 qcpLessThanSortKey<DataType>);
3298 if (expandedRange &&
3322 template <
class DataType>
3329 qcpLessThanSortKey<DataType>);
3330 if (expandedRange && it !=
constEnd()) ++it;
3350 template <
class DataType>
3358 bool haveLower =
false;
3359 bool haveUpper =
false;
3366 if (DataType::sortKeyIsMainKey())
3373 if (!qIsNaN(it->mainValue())) {
3374 range.
lower = it->mainKey();
3384 if (!qIsNaN(it->mainValue())) {
3385 range.
upper = it->mainKey();
3393 while (it != itEnd) {
3394 if (!qIsNaN(it->mainValue())) {
3395 current = it->mainKey();
3396 if (current < range.
lower || !haveLower) {
3397 range.
lower = current;
3400 if (current > range.
upper || !haveUpper) {
3401 range.
upper = current;
3408 }
else if (signDomain ==
3411 while (it != itEnd) {
3412 if (!qIsNaN(it->mainValue())) {
3413 current = it->mainKey();
3414 if ((current < range.
lower || !haveLower) && current < 0) {
3415 range.
lower = current;
3418 if ((current > range.
upper || !haveUpper) && current < 0) {
3419 range.
upper = current;
3425 }
else if (signDomain ==
3428 while (it != itEnd) {
3429 if (!qIsNaN(it->mainValue())) {
3430 current = it->mainKey();
3431 if ((current < range.
lower || !haveLower) && current > 0) {
3432 range.
lower = current;
3435 if ((current > range.
upper || !haveUpper) && current > 0) {
3436 range.
upper = current;
3444 foundRange = haveLower && haveUpper;
3466 template <
class DataType>
3475 const bool restrictKeyRange = inKeyRange !=
QCPRange();
3476 bool haveLower =
false;
3477 bool haveUpper =
false;
3481 if (DataType::sortKeyIsMainKey() && restrictKeyRange) {
3489 if (restrictKeyRange && (it->mainKey() < inKeyRange.
lower ||
3490 it->mainKey() > inKeyRange.
upper))
3492 current = it->valueRange();
3493 if ((current.
lower < range.
lower || !haveLower) &&
3494 !qIsNaN(current.
lower)) {
3498 if ((current.
upper > range.
upper || !haveUpper) &&
3499 !qIsNaN(current.
upper)) {
3504 }
else if (signDomain ==
3509 if (restrictKeyRange && (it->mainKey() < inKeyRange.
lower ||
3510 it->mainKey() > inKeyRange.
upper))
3512 current = it->valueRange();
3513 if ((current.
lower < range.
lower || !haveLower) && current.
lower < 0 &&
3514 !qIsNaN(current.
lower)) {
3518 if ((current.
upper > range.
upper || !haveUpper) && current.
upper < 0 &&
3519 !qIsNaN(current.
upper)) {
3524 }
else if (signDomain ==
3529 if (restrictKeyRange && (it->mainKey() < inKeyRange.
lower ||
3530 it->mainKey() > inKeyRange.
upper))
3532 current = it->valueRange();
3533 if ((current.
lower < range.
lower || !haveLower) && current.
lower > 0 &&
3534 !qIsNaN(current.
lower)) {
3538 if ((current.
upper > range.
upper || !haveUpper) && current.
upper > 0 &&
3539 !qIsNaN(current.
upper)) {
3546 foundRange = haveLower && haveUpper;
3559 template <
class DataType>
3564 iteratorRange = iteratorRange.
bounded(dataRange.
bounded(this->dataRange()));
3579 template <
class DataType>
3583 int newPreallocSize = minimumPreallocSize;
3593 mPreallocSize = newPreallocSize;
3612 template <
class DataType>
3614 const int totalAlloc =
mData.capacity();
3615 const int postAllocSize = totalAlloc -
mData.size();
3616 const int usedSize =
size();
3617 bool shrinkPostAllocation =
false;
3618 bool shrinkPreAllocation =
false;
3619 if (totalAlloc > 650000)
3622 shrinkPostAllocation =
3627 }
else if (totalAlloc >
3631 shrinkPostAllocation = postAllocSize > usedSize * 5;
3632 shrinkPreAllocation =
3637 if (shrinkPreAllocation || shrinkPostAllocation)
3638 squeeze(shrinkPreAllocation, shrinkPostAllocation);
3654 QPen
pen()
const {
return mPen; }
3658 return mUsedScatterProperties;
3662 void setPen(
const QPen &pen);
3663 void setBrush(
const QBrush &brush);
3665 QCPScatterStyle::ScatterProperties usedProperties =
3667 void setUsedScatterProperties(
3668 const QCPScatterStyle::ScatterProperties &properties);
3701 Q_PROPERTY(QString name READ name WRITE setName)
3702 Q_PROPERTY(
bool antialiasedFill READ antialiasedFill WRITE setAntialiasedFill)
3703 Q_PROPERTY(
bool antialiasedScatters READ antialiasedScatters WRITE
3704 setAntialiasedScatters)
3705 Q_PROPERTY(QPen pen READ pen WRITE setPen)
3706 Q_PROPERTY(QBrush brush READ brush WRITE setBrush)
3707 Q_PROPERTY(QCPAxis *keyAxis READ keyAxis WRITE setKeyAxis)
3708 Q_PROPERTY(QCPAxis *valueAxis READ valueAxis WRITE setValueAxis)
3710 NOTIFY selectableChanged)
3711 Q_PROPERTY(
QCPDataSelection selection READ selection WRITE setSelection NOTIFY
3714 WRITE setSelectionDecorator)
3717 QCPAbstractPlottable(QCPAxis *keyAxis, QCPAxis *valueAxis);
3718 virtual ~QCPAbstractPlottable();
3721 QString
name()
const {
return mName; }
3724 QPen
pen()
const {
return mPen; }
3726 QCPAxis *
keyAxis()
const {
return mKeyAxis.data(); }
3729 bool selected()
const {
return !mSelection.isEmpty(); }
3732 return mSelectionDecorator;
3736 void setName(
const QString &name);
3737 void setAntialiasedFill(
bool enabled);
3738 void setAntialiasedScatters(
bool enabled);
3739 void setPen(
const QPen &pen);
3740 void setBrush(
const QBrush &brush);
3741 void setKeyAxis(QCPAxis *axis);
3742 void setValueAxis(QCPAxis *axis);
3748 virtual double selectTest(
const QPointF &pos,
bool onlySelectable,
3749 QVariant *details = 0)
const 3761 void coordsToPixels(
double key,
double value,
double &x,
double &y)
const;
3762 const QPointF coordsToPixels(
double key,
double value)
const;
3763 void pixelsToCoords(
double x,
double y,
double &key,
double &value)
const;
3764 void pixelsToCoords(
const QPointF &pixelPos,
double &key,
3765 double &value)
const;
3766 void rescaleAxes(
bool onlyEnlarge =
false)
const;
3767 void rescaleKeyAxis(
bool onlyEnlarge =
false)
const;
3768 void rescaleValueAxis(
bool onlyEnlarge =
false,
3769 bool inKeyRange =
false)
const;
3772 bool removeFromLegend(
QCPLegend *legend)
const;
3773 bool removeFromLegend()
const;
3776 void selectionChanged(
bool selected);
3783 bool mAntialiasedFill, mAntialiasedScatters;
3786 QPointer<QCPAxis> mKeyAxis, mValueAxis;
3792 virtual QRect clipRect() const Q_DECL_OVERRIDE;
3793 virtual
void draw(
QCPPainter *painter) Q_DECL_OVERRIDE = 0;
3794 virtual
QCP::
Interaction selectionCategory() const Q_DECL_OVERRIDE;
3795 void applyDefaultAntialiasingHint(
QCPPainter *painter) const Q_DECL_OVERRIDE;
3797 virtual
void selectEvent(QMouseEvent *event,
bool additive,
3798 const QVariant &details,
3799 bool *selectionStateChanged) Q_DECL_OVERRIDE;
3800 virtual
void deselectEvent(
bool *selectionStateChanged) Q_DECL_OVERRIDE;
3803 virtual
void drawLegendIcon(
QCPPainter *painter,
3804 const QRectF &rect) const = 0;
3807 void applyFillAntialiasingHint(
QCPPainter *painter) const;
3808 void applyScattersAntialiasingHint(
QCPPainter *painter) const;
3811 Q_DISABLE_COPY(QCPAbstractPlottable)
3814 friend class QCPAxis;
3827 const QString &name,
int anchorId = -1);
3828 virtual ~QCPItemAnchor();
3831 QString
name()
const {
return mName; }
3832 virtual QPointF pixelPosition()
const;
3839 QCustomPlot *mParentPlot;
3842 QSet<QCPItemPosition *> mChildrenX, mChildrenY;
3858 Q_DISABLE_COPY(QCPItemAnchor)
3900 const QString &name);
3901 virtual ~QCPItemPosition();
3910 double key()
const {
return mKey; }
3912 QPointF
coords()
const {
return QPointF(mKey, mValue); }
3913 QCPAxis *
keyAxis()
const {
return mKeyAxis.data(); }
3923 bool keepPixelPosition =
false);
3925 bool keepPixelPosition =
false);
3927 bool keepPixelPosition =
false);
3928 void setCoords(
double key,
double value);
3929 void setCoords(
const QPointF &coords);
3930 void setAxes(QCPAxis *keyAxis, QCPAxis *valueAxis);
3932 void setPixelPosition(
const QPointF &pixelPosition);
3937 QPointer<QCPAxis> mKeyAxis, mValueAxis;
3938 QPointer<QCPAxisRect> mAxisRect;
3939 double mKey, mValue;
3946 Q_DISABLE_COPY(QCPItemPosition)
3950 class QCP_LIB_DECL QCPAbstractItem :
public QCPLayerable {
3953 Q_PROPERTY(
bool clipToAxisRect READ clipToAxisRect WRITE setClipToAxisRect)
3954 Q_PROPERTY(
QCPAxisRect *clipAxisRect READ clipAxisRect WRITE setClipAxisRect)
3955 Q_PROPERTY(
bool selectable READ selectable WRITE setSelectable NOTIFY
3958 bool selected READ selected WRITE setSelected NOTIFY selectionChanged)
3961 explicit QCPAbstractItem(
QCustomPlot *parentPlot);
3962 virtual ~QCPAbstractItem();
3971 void setClipToAxisRect(
bool clip);
3973 Q_SLOT
void setSelectable(
bool selectable);
3974 Q_SLOT
void setSelected(
bool selected);
3977 virtual double selectTest(
const QPointF &pos,
bool onlySelectable,
3978 QVariant *details = 0)
const Q_DECL_OVERRIDE = 0;
3981 QList<QCPItemPosition *>
positions()
const {
return mPositions; }
3982 QList<QCPItemAnchor *>
anchors()
const {
return mAnchors; }
3983 QCPItemPosition *position(
const QString &name)
const;
3985 bool hasAnchor(
const QString &name)
const;
3988 void selectionChanged(
bool selected);
3989 void selectableChanged(
bool selectable);
3993 bool mClipToAxisRect;
3994 QPointer<QCPAxisRect> mClipAxisRect;
3995 QList<QCPItemPosition *> mPositions;
3996 QList<QCPItemAnchor *> mAnchors;
3997 bool mSelectable, mSelected;
4002 virtual void applyDefaultAntialiasingHint(
QCPPainter *painter)
const 4004 virtual void draw(
QCPPainter *painter) Q_DECL_OVERRIDE = 0;
4006 virtual void selectEvent(QMouseEvent *event,
bool additive,
4007 const QVariant &details,
4009 virtual void deselectEvent(
bool *selectionStateChanged)
Q_DECL_OVERRIDE;
4012 virtual QPointF anchorPixelPosition(
int anchorId)
const;
4015 double rectDistance(
const QRectF &rect,
const QPointF &pos,
4016 bool filledRect)
const;
4017 QCPItemPosition *createPosition(
const QString &name);
4018 QCPItemAnchor *createAnchor(
const QString &name,
int anchorId);
4021 Q_DISABLE_COPY(QCPAbstractItem)
4035 Q_PROPERTY(QRect viewport READ viewport WRITE setViewport)
4036 Q_PROPERTY(QPixmap background READ background WRITE setBackground)
4038 bool backgroundScaled READ backgroundScaled WRITE setBackgroundScaled)
4039 Q_PROPERTY(Qt::AspectRatioMode backgroundScaledMode READ backgroundScaledMode
4040 WRITE setBackgroundScaledMode)
4042 Q_PROPERTY(
bool autoAddPlottableToLegend READ autoAddPlottableToLegend WRITE
4043 setAutoAddPlottableToLegend)
4044 Q_PROPERTY(
int selectionTolerance READ selectionTolerance WRITE
4045 setSelectionTolerance)
4046 Q_PROPERTY(
bool noAntialiasingOnDrag READ noAntialiasingOnDrag WRITE
4047 setNoAntialiasingOnDrag)
4048 Q_PROPERTY(Qt::KeyboardModifier multiSelectModifier READ multiSelectModifier
4049 WRITE setMultiSelectModifier)
4050 Q_PROPERTY(
bool openGl READ openGl WRITE setOpenGl)
4091 explicit QCustomPlot(QWidget *parent = 0);
4092 virtual ~QCustomPlot();
4100 return mBackgroundScaledMode;
4104 return mAntialiasedElements;
4107 return mNotAntialiasedElements;
4115 return mMultiSelectModifier;
4118 return mSelectionRectMode;
4124 void setViewport(
const QRect &rect);
4125 void setBufferDevicePixelRatio(
double ratio);
4126 void setBackground(
const QPixmap &pm);
4127 void setBackground(
const QPixmap &pm,
bool scaled,
4128 Qt::AspectRatioMode mode = Qt::KeepAspectRatioByExpanding);
4129 void setBackground(
const QBrush &brush);
4130 void setBackgroundScaled(
bool scaled);
4131 void setBackgroundScaledMode(Qt::AspectRatioMode mode);
4132 void setAntialiasedElements(
4133 const QCP::AntialiasedElements &antialiasedElements);
4135 bool enabled =
true);
4136 void setNotAntialiasedElements(
4137 const QCP::AntialiasedElements ¬AntialiasedElements);
4139 bool enabled =
true);
4140 void setAutoAddPlottableToLegend(
bool on);
4141 void setInteractions(
const QCP::Interactions &interactions);
4142 void setInteraction(
const QCP::Interaction &interaction,
bool enabled =
true);
4143 void setSelectionTolerance(
int pixels);
4144 void setNoAntialiasingOnDrag(
bool enabled);
4145 void setPlottingHints(
const QCP::PlottingHints &hints);
4147 void setMultiSelectModifier(Qt::KeyboardModifier modifier);
4150 void setOpenGl(
bool enabled,
int multisampling = 16);
4154 QCPAbstractPlottable *plottable(
int index);
4155 QCPAbstractPlottable *plottable();
4156 bool removePlottable(QCPAbstractPlottable *plottable);
4157 bool removePlottable(
int index);
4158 int clearPlottables();
4159 int plottableCount()
const;
4160 QList<QCPAbstractPlottable *> selectedPlottables()
const;
4161 QCPAbstractPlottable *plottableAt(
const QPointF &pos,
4162 bool onlySelectable =
false)
const;
4163 bool hasPlottable(QCPAbstractPlottable *plottable)
const;
4168 QCPGraph *addGraph(QCPAxis *keyAxis = 0, QCPAxis *valueAxis = 0);
4170 bool removeGraph(
int index);
4172 int graphCount()
const;
4173 QList<QCPGraph *> selectedGraphs()
const;
4176 QCPAbstractItem *item(
int index)
const;
4177 QCPAbstractItem *item()
const;
4178 bool removeItem(QCPAbstractItem *item);
4179 bool removeItem(
int index);
4181 int itemCount()
const;
4182 QList<QCPAbstractItem *> selectedItems()
const;
4183 QCPAbstractItem *itemAt(
const QPointF &pos,
4184 bool onlySelectable =
false)
const;
4185 bool hasItem(QCPAbstractItem *item)
const;
4188 QCPLayer *layer(
const QString &name)
const;
4191 bool setCurrentLayer(
const QString &name);
4192 bool setCurrentLayer(
QCPLayer *layer);
4193 int layerCount()
const;
4194 bool addLayer(
const QString &name,
QCPLayer *otherLayer = 0,
4201 int axisRectCount()
const;
4203 QList<QCPAxisRect *> axisRects()
const;
4205 QCPAxisRect *axisRectAt(
const QPointF &pos)
const;
4206 Q_SLOT
void rescaleAxes(
bool onlyVisiblePlottables =
false);
4208 QList<QCPAxis *> selectedAxes()
const;
4209 QList<QCPLegend *> selectedLegends()
const;
4210 Q_SLOT
void deselectAll();
4212 bool savePdf(
const QString &fileName,
int width = 0,
int height = 0,
4214 const QString &pdfCreator = QString(),
4215 const QString &pdfTitle = QString());
4216 bool savePng(
const QString &fileName,
int width = 0,
int height = 0,
4217 double scale = 1.0,
int quality = -1,
int resolution = 96,
4219 bool saveJpg(
const QString &fileName,
int width = 0,
int height = 0,
4220 double scale = 1.0,
int quality = -1,
int resolution = 96,
4222 bool saveBmp(
const QString &fileName,
int width = 0,
int height = 0,
4223 double scale = 1.0,
int resolution = 96,
4225 bool saveRastered(
const QString &fileName,
int width,
int height,
4226 double scale,
const char *format,
int quality = -1,
4227 int resolution = 96,
4229 QPixmap toPixmap(
int width = 0,
int height = 0,
double scale = 1.0);
4230 void toPainter(
QCPPainter *painter,
int width = 0,
int height = 0);
4234 QCPAxis *xAxis, *yAxis, *xAxis2, *yAxis2;
4238 void mouseDoubleClick(QMouseEvent *event);
4239 void mousePress(QMouseEvent *event);
4240 void mouseMove(QMouseEvent *event);
4241 void mouseRelease(QMouseEvent *event);
4242 void mouseWheel(QWheelEvent *event);
4244 void plottableClick(QCPAbstractPlottable *plottable,
int dataIndex,
4245 QMouseEvent *event);
4246 void plottableDoubleClick(QCPAbstractPlottable *plottable,
int dataIndex,
4247 QMouseEvent *event);
4248 void itemClick(QCPAbstractItem *item, QMouseEvent *event);
4249 void itemDoubleClick(QCPAbstractItem *item, QMouseEvent *event);
4251 QMouseEvent *event);
4253 QMouseEvent *event);
4255 QMouseEvent *event);
4257 QMouseEvent *event);
4259 void selectionChangedByUser();
4260 void beforeReplot();
4268 bool mAutoAddPlottableToLegend;
4269 QList<QCPAbstractPlottable *> mPlottables;
4270 QList<QCPGraph *> mGraphs;
4272 QList<QCPAbstractItem *> mItems;
4273 QList<QCPLayer *> mLayers;
4274 QCP::AntialiasedElements mAntialiasedElements, mNotAntialiasedElements;
4275 QCP::Interactions mInteractions;
4276 int mSelectionTolerance;
4277 bool mNoAntialiasingOnDrag;
4278 QBrush mBackgroundBrush;
4279 QPixmap mBackgroundPixmap;
4280 QPixmap mScaledBackgroundPixmap;
4281 bool mBackgroundScaled;
4282 Qt::AspectRatioMode mBackgroundScaledMode;
4284 QCP::PlottingHints mPlottingHints;
4285 Qt::KeyboardModifier mMultiSelectModifier;
4292 QPoint mMousePressPos;
4303 #ifdef QCP_OPENGL_FBO 4304 QSharedPointer<QOpenGLContext> mGlContext;
4305 QSharedPointer<QSurface> mGlSurface;
4306 QSharedPointer<QOpenGLPaintDevice> mGlPaintDevice;
4310 virtual QSize minimumSizeHint() const Q_DECL_OVERRIDE;
4311 virtual QSize sizeHint() const Q_DECL_OVERRIDE;
4312 virtual
void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE;
4313 virtual
void resizeEvent(QResizeEvent *event) Q_DECL_OVERRIDE;
4314 virtual
void mouseDoubleClickEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
4315 virtual
void mousePressEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
4316 virtual
void mouseMoveEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
4317 virtual
void mouseReleaseEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
4318 virtual
void wheelEvent(QWheelEvent *event) Q_DECL_OVERRIDE;
4322 virtual
void updateLayout();
4323 virtual
void axisRemoved(QCPAxis *axis);
4324 virtual
void legendRemoved(
QCPLegend *legend);
4325 Q_SLOT virtual
void processRectSelection(QRect rect, QMouseEvent *event);
4326 Q_SLOT virtual
void processRectZoom(QRect rect, QMouseEvent *event);
4327 Q_SLOT virtual
void processPointSelection(QMouseEvent *event);
4330 bool registerPlottable(QCPAbstractPlottable *plottable);
4331 bool registerGraph(
QCPGraph *graph);
4332 bool registerItem(QCPAbstractItem *item);
4333 void updateLayerIndices() const;
4334 QCPLayerable *layerableAt(const QPointF &pos,
bool onlySelectable,
4335 QVariant *selectionDetails = 0) const;
4336 QList<QCPLayerable *> layerableListAt(
4337 const QPointF &pos,
bool onlySelectable,
4338 QList<QVariant> *selectionDetails = 0) const;
4340 void setupPaintBuffers();
4342 bool hasInvalidatedPaintBuffers();
4347 friend class QCPAxis;
4350 friend class QCPAbstractPlottable;
4352 friend class QCPAbstractItem;
4366 virtual int dataCount()
const = 0;
4367 virtual double dataMainKey(
int index)
const = 0;
4368 virtual double dataSortKey(
int index)
const = 0;
4369 virtual double dataMainValue(
int index)
const = 0;
4370 virtual QCPRange dataValueRange(
int index)
const = 0;
4371 virtual QPointF dataPixelPosition(
int index)
const = 0;
4372 virtual bool sortKeyIsMainKey()
const = 0;
4374 bool onlySelectable)
const = 0;
4375 virtual int findBegin(
double sortKey,
bool expandedRange =
true)
const = 0;
4376 virtual int findEnd(
double sortKey,
bool expandedRange =
true)
const = 0;
4379 template <
class DataType>
4381 :
public QCPAbstractPlottable,
4403 virtual int findEnd(
double sortKey,
4407 virtual double selectTest(
const QPointF &pos,
bool onlySelectable,
4418 void getDataSegments(QList<QCPDataRange> &selectedSegments,
4419 QList<QCPDataRange> &unselectedSegments)
const;
4421 const QVector<QPointF> &lineData)
const;
4640 template <
class DataType>
4643 : QCPAbstractPlottable(keyAxis, valueAxis),
4646 template <
class DataType>
4652 template <
class DataType>
4660 template <
class DataType>
4662 if (index >= 0 && index < mDataContainer->size()) {
4665 qDebug() << Q_FUNC_INFO <<
"Index out of bounds" << index;
4673 template <
class DataType>
4675 if (index >= 0 && index < mDataContainer->size()) {
4678 qDebug() << Q_FUNC_INFO <<
"Index out of bounds" << index;
4686 template <
class DataType>
4688 if (index >= 0 && index < mDataContainer->size()) {
4691 qDebug() << Q_FUNC_INFO <<
"Index out of bounds" << index;
4699 template <
class DataType>
4701 if (index >= 0 && index < mDataContainer->size()) {
4704 qDebug() << Q_FUNC_INFO <<
"Index out of bounds" << index;
4712 template <
class DataType>
4714 if (index >= 0 && index < mDataContainer->size()) {
4719 qDebug() << Q_FUNC_INFO <<
"Index out of bounds" << index;
4727 template <
class DataType>
4729 return DataType::sortKeyIsMainKey();
4740 template <
class DataType>
4742 const QRectF &rect,
bool onlySelectable)
const {
4744 if ((onlySelectable && mSelectable ==
QCP::stNone) ||
4747 if (!mKeyAxis || !mValueAxis)
return result;
4750 double key1, value1, key2, value2;
4755 QCPRange valueRange(value1, value2);
4760 if (DataType::sortKeyIsMainKey())
4767 if (begin == end)
return result;
4769 int currentSegmentBegin =
4773 if (currentSegmentBegin == -1) {
4774 if (valueRange.
contains(it->mainValue()) &&
4775 keyRange.contains(it->mainKey()))
4777 }
else if (!valueRange.
contains(it->mainValue()) ||
4778 !keyRange.contains(it->mainKey()))
4783 currentSegmentBegin = -1;
4787 if (currentSegmentBegin != -1)
4799 template <
class DataType>
4801 bool expandedRange)
const {
4809 template <
class DataType>
4811 bool expandedRange)
const {
4827 template <
class DataType>
4829 bool onlySelectable,
4830 QVariant *details)
const {
4831 if ((onlySelectable && mSelectable ==
QCP::stNone) ||
4834 if (!mKeyAxis || !mValueAxis)
return -1;
4837 double minDistSqr = (std::numeric_limits<double>::max)();
4844 if (DataType::sortKeyIsMainKey())
4850 double posKeyMin, posKeyMax, dummy;
4857 if (posKeyMin > posKeyMax) qSwap(posKeyMin, posKeyMax);
4861 if (begin == end)
return -1;
4862 QCPRange keyRange(mKeyAxis->range());
4863 QCPRange valueRange(mValueAxis->range());
4866 const double mainKey = it->mainKey();
4867 const double mainValue = it->mainValue();
4868 if (keyRange.contains(mainKey) &&
4869 valueRange.contains(
4874 const double currentDistSqr =
4876 if (currentDistSqr < minDistSqr) {
4877 minDistSqr = currentDistSqr;
4887 if (details) details->setValue(selectionResult);
4888 return qSqrt(minDistSqr);
4901 template <
class DataType>
4903 QList<QCPDataRange> &selectedSegments,
4904 QList<QCPDataRange> &unselectedSegments)
const {
4905 selectedSegments.clear();
4906 unselectedSegments.clear();
4914 unselectedSegments << QCPDataRange(0,
dataCount());
4933 template <
class DataType>
4935 QCPPainter *painter,
const QVector<QPointF> &lineData)
const {
4939 painter->pen().style() == Qt::SolidLine &&
4943 bool lastIsNan =
false;
4944 const int lineDataSize = lineData.size();
4945 while (i < lineDataSize &&
4946 (qIsNaN(lineData.at(i).y()) ||
4947 qIsNaN(lineData.at(i).x())))
4950 while (i < lineDataSize) {
4951 if (!qIsNaN(lineData.at(i).y()) &&
4952 !qIsNaN(lineData.at(i).x()))
4955 painter->
drawLine(lineData.at(i - 1), lineData.at(i));
4963 int segmentStart = 0;
4965 const int lineDataSize = lineData.size();
4966 while (i < lineDataSize) {
4967 if (qIsNaN(lineData.at(i).y()) || qIsNaN(lineData.at(i).x()) ||
4969 lineData.at(i).y()))
4972 painter->drawPolyline(
4973 lineData.constData() + segmentStart,
4976 segmentStart = i + 1;
4981 painter->drawPolyline(lineData.constData() + segmentStart,
4982 lineDataSize - segmentStart);
5058 bool operator==(
const QCPColorGradient &other)
const;
5060 return !(*
this == other);
5070 void setLevelCount(
int n);
5071 void setColorStops(
const QMap<double, QColor> &colorStops);
5072 void setColorStopAt(
double position,
const QColor &color);
5074 void setPeriodic(
bool enabled);
5077 void colorize(
const double *data,
const QCPRange &range, QRgb *scanLine,
5078 int n,
int dataIndexFactor = 1,
bool logarithmic =
false);
5079 void colorize(
const double *data,
const unsigned char *alpha,
5080 const QCPRange &range, QRgb *scanLine,
int n,
5081 int dataIndexFactor = 1,
bool logarithmic =
false);
5082 QRgb color(
double position,
const QCPRange &range,
bool logarithmic =
false);
5084 void clearColorStops();
5085 QCPColorGradient inverted()
const;
5090 QMap<double, QColor> mColorStops;
5098 bool mColorBufferInvalidated;
5101 bool stopsUseAlpha()
const;
5102 void updateColorBuffer();
5150 void setBracketPen(
const QPen &pen);
5151 void setBracketBrush(
const QBrush &brush);
5152 void setBracketWidth(
int width);
5153 void setBracketHeight(
int height);
5155 void setTangentToData(
bool enabled);
5156 void setTangentAverage(
int pointCount);
5159 virtual void drawBracket(
QCPPainter *painter,
int direction)
const;
5162 virtual void drawDecoration(
QCPPainter *painter,
5177 int dataIndex,
int direction)
const;
5179 int dataIndex)
const;
5191 Q_PROPERTY(QPixmap background READ background WRITE setBackground)
5193 bool backgroundScaled READ backgroundScaled WRITE setBackgroundScaled)
5194 Q_PROPERTY(Qt::AspectRatioMode backgroundScaledMode READ backgroundScaledMode
5195 WRITE setBackgroundScaledMode)
5196 Q_PROPERTY(Qt::Orientations rangeDrag READ rangeDrag WRITE setRangeDrag)
5197 Q_PROPERTY(Qt::Orientations rangeZoom READ rangeZoom WRITE setRangeZoom)
5208 return mBackgroundScaledMode;
5212 QCPAxis *rangeDragAxis(Qt::Orientation orientation);
5213 QCPAxis *rangeZoomAxis(Qt::Orientation orientation);
5214 QList<QCPAxis *> rangeDragAxes(Qt::Orientation orientation);
5215 QList<QCPAxis *> rangeZoomAxes(Qt::Orientation orientation);
5216 double rangeZoomFactor(Qt::Orientation orientation);
5219 void setBackground(
const QPixmap &pm);
5220 void setBackground(
const QPixmap &pm,
bool scaled,
5221 Qt::AspectRatioMode mode = Qt::KeepAspectRatioByExpanding);
5222 void setBackground(
const QBrush &
brush);
5223 void setBackgroundScaled(
bool scaled);
5224 void setBackgroundScaledMode(Qt::AspectRatioMode mode);
5225 void setRangeDrag(Qt::Orientations orientations);
5226 void setRangeZoom(Qt::Orientations orientations);
5227 void setRangeDragAxes(QCPAxis *horizontal, QCPAxis *vertical);
5228 void setRangeDragAxes(QList<QCPAxis *> axes);
5229 void setRangeDragAxes(QList<QCPAxis *> horizontal, QList<QCPAxis *> vertical);
5230 void setRangeZoomAxes(QCPAxis *horizontal, QCPAxis *vertical);
5231 void setRangeZoomAxes(QList<QCPAxis *> axes);
5232 void setRangeZoomAxes(QList<QCPAxis *> horizontal, QList<QCPAxis *> vertical);
5233 void setRangeZoomFactor(
double horizontalFactor,
double verticalFactor);
5234 void setRangeZoomFactor(
double factor);
5239 QList<QCPAxis *> axes(QCPAxis::AxisTypes types)
const;
5240 QList<QCPAxis *> axes()
const;
5242 QList<QCPAxis *> addAxes(QCPAxis::AxisTypes types);
5243 bool removeAxis(QCPAxis *axis);
5246 void zoom(
const QRectF &pixelRect);
5247 void zoom(
const QRectF &pixelRect,
const QList<QCPAxis *> &affectedAxes);
5248 void setupFullAxesBox(
bool connectRanges =
false);
5249 QList<QCPAbstractPlottable *> plottables()
const;
5250 QList<QCPGraph *> graphs()
const;
5251 QList<QCPAbstractItem *> items()
const;
5254 int left()
const {
return mRect.left(); }
5255 int right()
const {
return mRect.right(); }
5256 int top()
const {
return mRect.top(); }
5257 int bottom()
const {
return mRect.bottom(); }
5258 int width()
const {
return mRect.width(); }
5259 int height()
const {
return mRect.height(); }
5260 QSize
size()
const {
return mRect.size(); }
5261 QPoint
topLeft()
const {
return mRect.topLeft(); }
5265 QPoint
center()
const {
return mRect.center(); }
5269 virtual QList<QCPLayoutElement *> elements(
bool recursive)
const 5274 QBrush mBackgroundBrush;
5275 QPixmap mBackgroundPixmap;
5276 QPixmap mScaledBackgroundPixmap;
5277 bool mBackgroundScaled;
5278 Qt::AspectRatioMode mBackgroundScaledMode;
5280 Qt::Orientations mRangeDrag, mRangeZoom;
5283 double mRangeZoomFactorHorz, mRangeZoomFactorVert;
5287 QCP::AntialiasedElements mAADragBackup, mNotAADragBackup;
5289 QHash<QCPAxis::AxisType, QList<QCPAxis *> > mAxes;
5296 virtual void layoutChanged() Q_DECL_OVERRIDE;
5299 const QVariant &details) Q_DECL_OVERRIDE;
5301 const QPointF &startPos) Q_DECL_OVERRIDE;
5303 const QPointF &startPos) Q_DECL_OVERRIDE;
5304 virtual
void wheelEvent(QWheelEvent *event) Q_DECL_OVERRIDE;
5308 void updateAxesOffset(QCPAxis::AxisType type);
5324 Q_PROPERTY(
QCPLegend *parentLegend READ parentLegend)
5325 Q_PROPERTY(QFont font READ font WRITE setFont)
5326 Q_PROPERTY(QColor textColor READ textColor WRITE setTextColor)
5327 Q_PROPERTY(QFont selectedFont READ selectedFont WRITE setSelectedFont)
5328 Q_PROPERTY(QColor selectedTextColor READ selectedTextColor WRITE
5329 setSelectedTextColor)
5340 QFont
font()
const {
return mFont; }
5348 void setFont(
const QFont &font);
5349 void setTextColor(
const QColor &color);
5350 void setSelectedFont(
const QFont &font);
5351 void setSelectedTextColor(
const QColor &color);
5356 virtual double selectTest(
const QPointF &pos,
bool onlySelectable,
5368 QFont mSelectedFont;
5369 QColor mSelectedTextColor;
5379 virtual void selectEvent(QMouseEvent *event,
bool additive,
5380 const QVariant &details,
5407 QPen getIconBorderPen()
const;
5408 QColor getTextColor()
const;
5409 QFont getFont()
const;
5415 Q_PROPERTY(QPen borderPen READ borderPen WRITE setBorderPen)
5416 Q_PROPERTY(QBrush brush READ brush WRITE
setBrush)
5417 Q_PROPERTY(QFont font READ font WRITE setFont)
5418 Q_PROPERTY(QColor textColor READ textColor WRITE setTextColor)
5419 Q_PROPERTY(QSize iconSize READ iconSize WRITE setIconSize)
5420 Q_PROPERTY(
int iconTextPadding READ iconTextPadding WRITE setIconTextPadding)
5421 Q_PROPERTY(QPen iconBorderPen READ iconBorderPen WRITE setIconBorderPen)
5422 Q_PROPERTY(SelectableParts selectableParts READ selectableParts WRITE
5424 Q_PROPERTY(SelectableParts selectedParts READ selectedParts WRITE
5427 QPen selectedBorderPen READ selectedBorderPen WRITE setSelectedBorderPen)
5428 Q_PROPERTY(QPen selectedIconBorderPen READ selectedIconBorderPen WRITE
5429 setSelectedIconBorderPen)
5431 Q_PROPERTY(QFont selectedFont READ selectedFont WRITE setSelectedFont)
5432 Q_PROPERTY(QColor selectedTextColor READ selectedTextColor WRITE
5433 setSelectedTextColor)
5450 Q_FLAGS(SelectableParts)
5453 explicit QCPLegend();
5454 virtual ~QCPLegend();
5459 QFont
font()
const {
return mFont; }
5465 SelectableParts selectedParts()
const;
5473 void setBorderPen(
const QPen &
pen);
5474 void setBrush(
const QBrush &brush);
5475 void setFont(
const QFont &font);
5476 void setTextColor(
const QColor &color);
5477 void setIconSize(
const QSize &size);
5478 void setIconSize(
int width,
int height);
5479 void setIconTextPadding(
int padding);
5480 void setIconBorderPen(
const QPen &pen);
5481 Q_SLOT
void setSelectableParts(
const SelectableParts &selectableParts);
5482 Q_SLOT
void setSelectedParts(
const SelectableParts &selectedParts);
5483 void setSelectedBorderPen(
const QPen &pen);
5484 void setSelectedIconBorderPen(
const QPen &pen);
5486 void setSelectedFont(
const QFont &font);
5487 void setSelectedTextColor(
const QColor &color);
5490 virtual double selectTest(
const QPointF &pos,
bool onlySelectable,
5495 QCPPlottableLegendItem *itemWithPlottable(
5497 int itemCount()
const;
5501 bool removeItem(
int index);
5504 QList<QCPAbstractLegendItem *> selectedItems()
const;
5512 QPen mBorderPen, mIconBorderPen;
5517 int mIconTextPadding;
5518 SelectableParts mSelectedParts, mSelectableParts;
5519 QPen mSelectedBorderPen, mSelectedIconBorderPen;
5521 QFont mSelectedFont;
5522 QColor mSelectedTextColor;
5531 virtual void selectEvent(QMouseEvent *event,
bool additive,
5532 const QVariant &details,
5537 QPen getBorderPen()
const;
5538 QBrush getBrush()
const;
5541 Q_DISABLE_COPY(QCPLegend)
5546 Q_DECLARE_OPERATORS_FOR_FLAGS(QCPLegend::SelectableParts)
5557 Q_PROPERTY(QString text READ text WRITE setText)
5574 const QString &fontFamily,
double pointSize);
5579 QString
text()
const {
return mText; }
5589 void setText(
const QString &text);
5590 void setTextFlags(
int flags);
5591 void setFont(
const QFont &font);
5599 virtual double selectTest(
const QPointF &pos,
bool onlySelectable,
5611 void clicked(QMouseEvent *event);
5612 void doubleClicked(QMouseEvent *event);
5632 virtual
void selectEvent(QMouseEvent *event,
bool additive,
5633 const QVariant &details,
5634 bool *selectionStateChanged) Q_DECL_OVERRIDE;
5635 virtual
void deselectEvent(
bool *selectionStateChanged) Q_DECL_OVERRIDE;
5638 QFont mainFont() const;
5639 QColor mainTextColor() const;
5657 QImage mGradientImage;
5658 bool mGradientImageInvalidated;
5668 void updateGradientImage();
5669 Q_SLOT
void axisSelectionChanged(QCPAxis::SelectableParts selectedParts);
5670 Q_SLOT
void axisSelectableChanged(QCPAxis::SelectableParts selectableParts);
5674 class QCP_LIB_DECL QCPColorScale :
public QCPLayoutElement {
5678 Q_PROPERTY(
QCPRange dataRange READ dataRange WRITE setDataRange NOTIFY
5681 setDataScaleType NOTIFY dataScaleTypeChanged)
5682 Q_PROPERTY(
QCPColorGradient gradient READ gradient WRITE setGradient NOTIFY
5684 Q_PROPERTY(QString label READ label WRITE setLabel)
5685 Q_PROPERTY(
int barWidth READ barWidth WRITE setBarWidth)
5686 Q_PROPERTY(
bool rangeDrag READ rangeDrag WRITE setRangeDrag)
5687 Q_PROPERTY(
bool rangeZoom READ rangeZoom WRITE setRangeZoom)
5691 virtual ~QCPColorScale();
5694 QCPAxis *
axis()
const {
return mColorAxis.data(); }
5699 QString label()
const;
5701 bool rangeDrag()
const;
5702 bool rangeZoom()
const;
5706 Q_SLOT
void setDataRange(
const QCPRange &dataRange);
5709 void setLabel(
const QString &str);
5710 void setBarWidth(
int width);
5711 void setRangeDrag(
bool enabled);
5712 void setRangeZoom(
bool enabled);
5715 QList<QCPColorMap *> colorMaps()
const;
5716 void rescaleDataRange(
bool onlyVisibleMaps);
5722 void dataRangeChanged(
const QCPRange &newRange);
5735 QPointer<QCPColorScaleAxisRectPrivate> mAxisRect;
5736 QPointer<QCPAxis> mColorAxis;
5751 Q_DISABLE_COPY(QCPColorScale)
5797 Q_PROPERTY(LineStyle lineStyle READ lineStyle WRITE setLineStyle)
5800 Q_PROPERTY(
int scatterSkip READ scatterSkip WRITE setScatterSkip)
5801 Q_PROPERTY(
QCPGraph *channelFillGraph READ channelFillGraph WRITE
5802 setChannelFillGraph)
5804 bool adaptiveSampling READ adaptiveSampling WRITE setAdaptiveSampling)
5845 void setData(QSharedPointer<QCPGraphDataContainer> data);
5846 void setData(
const QVector<double> &keys,
const QVector<double> &values,
5847 bool alreadySorted =
false);
5850 void setScatterSkip(
int skip);
5851 void setChannelFillGraph(
QCPGraph *targetGraph);
5852 void setAdaptiveSampling(
bool enabled);
5855 void addData(
const QVector<double> &keys,
const QVector<double> &values,
5856 bool alreadySorted =
false);
5857 void addData(
double key,
double value);
5860 virtual double selectTest(
const QPointF &pos,
bool onlySelectable,
5874 QPointer<QCPGraph> mChannelFillGraph;
5875 bool mAdaptiveSampling;
5883 virtual void drawFill(
QCPPainter *painter, QVector<QPointF> *lines)
const;
5884 virtual void drawScatterPlot(
QCPPainter *painter,
5885 const QVector<QPointF> &scatters,
5887 virtual void drawLinePlot(
QCPPainter *painter,
5888 const QVector<QPointF> &lines)
const;
5889 virtual void drawImpulsePlot(
QCPPainter *painter,
5890 const QVector<QPointF> &lines)
const;
5892 virtual void getOptimizedLineData(
5893 QVector<QCPGraphData> *lineData,
5896 virtual void getOptimizedScatterData(
5897 QVector<QCPGraphData> *scatterData,
5905 void getLines(QVector<QPointF> *lines,
const QCPDataRange &dataRange)
const;
5906 void getScatters(QVector<QPointF> *scatters,
5908 QVector<QPointF> dataToLines(
const QVector<QCPGraphData> &data)
const;
5909 QVector<QPointF> dataToStepLeftLines(
const QVector<QCPGraphData> &data)
const;
5910 QVector<QPointF> dataToStepRightLines(
5911 const QVector<QCPGraphData> &data)
const;
5912 QVector<QPointF> dataToStepCenterLines(
5913 const QVector<QCPGraphData> &data)
const;
5914 QVector<QPointF> dataToImpulseLines(
const QVector<QCPGraphData> &data)
const;
5915 QVector<QCPDataRange> getNonNanSegments(
const QVector<QPointF> *lineData,
5916 Qt::Orientation keyOrientation)
const;
5917 QVector<QPair<QCPDataRange, QCPDataRange> > getOverlappingSegments(
5918 QVector<QCPDataRange> thisSegments,
const QVector<QPointF> *thisData,
5919 QVector<QCPDataRange> otherSegments,
5920 const QVector<QPointF> *otherData)
const;
5921 bool segmentsIntersect(
double aLower,
double aUpper,
double bLower,
5922 double bUpper,
int &bPrecedence)
const;
5923 QPointF getFillBasePoint(QPointF matchingDataPoint)
const;
5924 const QPolygonF getFillPolygon(
const QVector<QPointF> *lineData,
5926 const QPolygonF getChannelFillPolygon(
const QVector<QPointF> *lineData,
5928 const QVector<QPointF> *otherData,
5930 int findIndexBelowX(
const QVector<QPointF> *data,
double x)
const;
5931 int findIndexAboveX(
const QVector<QPointF> *data,
double x)
const;
5932 int findIndexBelowY(
const QVector<QPointF> *data,
double y)
const;
5933 int findIndexAboveY(
const QVector<QPointF> *data,
double y)
const;
5934 double pointDistance(
5935 const QPointF &pixelPoint,
5939 friend class QCPLegend;
5964 double t, key, value;
5987 Q_PROPERTY(
int scatterSkip READ scatterSkip WRITE setScatterSkip)
5988 Q_PROPERTY(LineStyle lineStyle READ lineStyle WRITE setLineStyle)
6012 void setData(QSharedPointer<QCPCurveDataContainer> data);
6013 void setData(
const QVector<double> &t,
const QVector<double> &keys,
6014 const QVector<double> &values,
bool alreadySorted =
false);
6015 void setData(
const QVector<double> &keys,
const QVector<double> &values);
6017 void setScatterSkip(
int skip);
6021 void addData(
const QVector<double> &t,
const QVector<double> &keys,
6022 const QVector<double> &values,
bool alreadySorted =
false);
6023 void addData(
const QVector<double> &keys,
const QVector<double> &values);
6024 void addData(
double t,
double key,
double value);
6025 void addData(
double key,
double value);
6028 virtual double selectTest(
const QPointF &pos,
bool onlySelectable,
6049 virtual void drawCurveLine(
QCPPainter *painter,
6050 const QVector<QPointF> &lines)
const;
6051 virtual void drawScatterPlot(
QCPPainter *painter,
6052 const QVector<QPointF> &points,
6056 void getCurveLines(QVector<QPointF> *lines,
const QCPDataRange &dataRange,
6057 double penWidth)
const;
6058 void getScatters(QVector<QPointF> *scatters,
const QCPDataRange &dataRange,
6059 double scatterWidth)
const;
6060 int getRegion(
double key,
double value,
double keyMin,
double valueMax,
6061 double keyMax,
double valueMin)
const;
6062 QPointF getOptimizedPoint(
int prevRegion,
double prevKey,
double prevValue,
6063 double key,
double value,
double keyMin,
6064 double valueMax,
double keyMax,
6065 double valueMin)
const;
6066 QVector<QPointF> getOptimizedCornerPoints(
int prevRegion,
int currentRegion,
6067 double prevKey,
double prevValue,
6068 double key,
double value,
6069 double keyMin,
double valueMax,
6071 double valueMin)
const;
6072 bool mayTraverse(
int prevRegion,
int currentRegion)
const;
6073 bool getTraverse(
double prevKey,
double prevValue,
double key,
double value,
6074 double keyMin,
double valueMax,
double keyMax,
6075 double valueMin, QPointF &crossA, QPointF &crossB)
const;
6076 void getTraverseCornerPoints(
int prevRegion,
int currentRegion,
double keyMin,
6077 double valueMax,
double keyMax,
double valueMin,
6078 QVector<QPointF> &beforeTraverse,
6079 QVector<QPointF> &afterTraverse)
const;
6080 double pointDistance(
6081 const QPointF &pixelPoint,
6085 friend class QCPLegend;
6097 Q_PROPERTY(SpacingType spacingType READ spacingType WRITE setSpacingType)
6098 Q_PROPERTY(
double spacing READ spacing WRITE setSpacing)
6127 void setSpacing(
double spacing);
6130 QList<QCPBars *>
bars()
const {
return mBars; }
6131 QCPBars *bars(
int index)
const;
6132 int size()
const {
return mBars.size(); }
6137 void insert(
int i,
QCPBars *bars);
6145 QList<QCPBars *> mBars;
6148 void registerBars(
QCPBars *bars);
6149 void unregisterBars(
QCPBars *bars);
6152 double keyPixelOffset(
const QCPBars *bars,
double keyCoord);
6153 double getPixelSpacing(
const QCPBars *bars,
double keyCoord);
6165 QCPBarsData(
double key,
double value);
6169 return QCPBarsData(sortKey, 0);
6201 Q_PROPERTY(
double width READ width WRITE setWidth)
6202 Q_PROPERTY(WidthType widthType READ widthType WRITE setWidthType)
6203 Q_PROPERTY(
QCPBarsGroup *barsGroup READ barsGroup WRITE setBarsGroup)
6204 Q_PROPERTY(
double baseValue READ baseValue WRITE setBaseValue)
6205 Q_PROPERTY(
double stackingGap READ stackingGap WRITE setStackingGap)
6206 Q_PROPERTY(
QCPBars *barBelow READ barBelow)
6207 Q_PROPERTY(
QCPBars *barAbove READ barAbove)
6240 void setData(QSharedPointer<QCPBarsDataContainer> data);
6241 void setData(
const QVector<double> &keys,
const QVector<double> &values,
6242 bool alreadySorted =
false);
6243 void setWidth(
double width);
6246 void setBaseValue(
double baseValue);
6247 void setStackingGap(
double pixels);
6250 void addData(
const QVector<double> &keys,
const QVector<double> &values,
6251 bool alreadySorted =
false);
6252 void addData(
double key,
double value);
6253 void moveBelow(
QCPBars *bars);
6254 void moveAbove(
QCPBars *bars);
6259 virtual double selectTest(
const QPointF &pos,
bool onlySelectable,
6276 QPointer<QCPBars> mBarBelow, mBarAbove;
6286 QRectF getBarRect(
double key,
double value)
const;
6287 void getPixelWidth(
double key,
double &lower,
double &upper)
const;
6288 double getStackedBaseValue(
double key,
bool positive)
const;
6304 QCPStatisticalBoxData();
6305 QCPStatisticalBoxData(
double key,
double minimum,
double lowerQuartile,
6306 double median,
double upperQuartile,
double maximum,
6307 const QVector<double> &outliers = QVector<double>());
6311 return QCPStatisticalBoxData(sortKey, 0, 0, 0, 0, 0);
6320 for (QVector<double>::const_iterator it = outliers.constBegin();
6321 it != outliers.constEnd(); ++it)
6348 Q_PROPERTY(
double width READ width WRITE setWidth)
6349 Q_PROPERTY(
double whiskerWidth READ whiskerWidth WRITE setWhiskerWidth)
6350 Q_PROPERTY(QPen whiskerPen READ whiskerPen WRITE setWhiskerPen)
6351 Q_PROPERTY(QPen whiskerBarPen READ whiskerBarPen WRITE setWhiskerBarPen)
6352 Q_PROPERTY(
bool whiskerAntialiased READ whiskerAntialiased WRITE
6353 setWhiskerAntialiased)
6354 Q_PROPERTY(QPen medianPen READ medianPen WRITE setMedianPen)
6362 QSharedPointer<QCPStatisticalBoxDataContainer>
data()
const {
6374 void setData(QSharedPointer<QCPStatisticalBoxDataContainer> data);
6375 void setData(
const QVector<double> &keys,
const QVector<double> &minimum,
6376 const QVector<double> &lowerQuartile,
6377 const QVector<double> &median,
6378 const QVector<double> &upperQuartile,
6379 const QVector<double> &maximum,
bool alreadySorted =
false);
6380 void setWidth(
double width);
6381 void setWhiskerWidth(
double width);
6382 void setWhiskerPen(
const QPen &
pen);
6383 void setWhiskerBarPen(
const QPen &pen);
6384 void setWhiskerAntialiased(
bool enabled);
6385 void setMedianPen(
const QPen &pen);
6389 void addData(
const QVector<double> &keys,
const QVector<double> &minimum,
6390 const QVector<double> &lowerQuartile,
6391 const QVector<double> &median,
6392 const QVector<double> &upperQuartile,
6393 const QVector<double> &maximum,
bool alreadySorted =
false);
6394 void addData(
double key,
double minimum,
double lowerQuartile,
double median,
6395 double upperQuartile,
double maximum,
6396 const QVector<double> &outliers = QVector<double>());
6401 virtual double selectTest(
const QPointF &pos,
bool onlySelectable,
6413 double mWhiskerWidth;
6414 QPen mWhiskerPen, mWhiskerBarPen;
6425 virtual void drawStatisticalBox(
6430 void getVisibleDataBounds(
6433 QRectF getQuartileBox(
6435 QVector<QLineF> getWhiskerBackboneLines(
6437 QVector<QLineF> getWhiskerBarLines(
6463 double data(
double key,
double value);
6464 double cell(
int keyIndex,
int valueIndex);
6465 unsigned char alpha(
int keyIndex,
int valueIndex);
6468 void setSize(
int keySize,
int valueSize);
6469 void setKeySize(
int keySize);
6470 void setValueSize(
int valueSize);
6472 void setKeyRange(
const QCPRange &keyRange);
6473 void setValueRange(
const QCPRange &valueRange);
6474 void setData(
double key,
double value,
double z);
6475 void setCell(
int keyIndex,
int valueIndex,
double z);
6476 void setAlpha(
int keyIndex,
int valueIndex,
unsigned char alpha);
6479 void recalculateDataBounds();
6482 void fill(
double z);
6483 void fillAlpha(
unsigned char alpha);
6485 void coordToCell(
double key,
double value,
int *keyIndex,
6486 int *valueIndex)
const;
6487 void cellToCoord(
int keyIndex,
int valueIndex,
double *key,
6488 double *value)
const;
6492 int mKeySize, mValueSize;
6502 bool createAlpha(
bool initializeOpaque =
true);
6510 Q_PROPERTY(
QCPRange dataRange READ dataRange WRITE setDataRange NOTIFY
6513 setDataScaleType NOTIFY dataScaleTypeChanged)
6514 Q_PROPERTY(
QCPColorGradient gradient READ gradient WRITE setGradient NOTIFY
6516 Q_PROPERTY(
bool interpolate READ interpolate WRITE setInterpolate)
6517 Q_PROPERTY(
bool tightBoundary READ tightBoundary WRITE setTightBoundary)
6518 Q_PROPERTY(
QCPColorScale *colorScale READ colorScale WRITE setColorScale)
6535 Q_SLOT
void setDataRange(
const QCPRange &dataRange);
6538 void setInterpolate(
bool enabled);
6539 void setTightBoundary(
bool enabled);
6543 void rescaleDataRange(
bool recalculateDataBounds =
false);
6544 Q_SLOT
void updateLegendIcon(
6545 Qt::TransformationMode transformMode = Qt::SmoothTransformation,
6546 const QSize &thumbSize = QSize(32, 18));
6549 virtual double selectTest(
const QPointF &pos,
bool onlySelectable,
6559 void dataRangeChanged(
const QCPRange &newRange);
6570 bool mTightBoundary;
6571 QPointer<QCPColorScale> mColorScale;
6574 QImage mMapImage, mUndersampledMapImage;
6575 QPixmap mLegendIcon;
6576 bool mMapImageInvalidated;
6579 virtual void updateMapImage();
6598 QCPFinancialData(
double key,
double open,
double high,
double low,
6603 return QCPFinancialData(sortKey, 0, 0, 0, 0);
6615 double key, open, high, low, close;
6636 Q_PROPERTY(ChartStyle chartStyle READ chartStyle WRITE setChartStyle)
6637 Q_PROPERTY(
double width READ width WRITE setWidth)
6638 Q_PROPERTY(WidthType widthType READ widthType WRITE setWidthType)
6639 Q_PROPERTY(
bool twoColored READ twoColored WRITE setTwoColored)
6640 Q_PROPERTY(QBrush brushPositive READ brushPositive WRITE setBrushPositive)
6641 Q_PROPERTY(QBrush brushNegative READ brushNegative WRITE setBrushNegative)
6642 Q_PROPERTY(QPen penPositive READ penPositive WRITE setPenPositive)
6643 Q_PROPERTY(QPen penNegative READ penNegative WRITE setPenNegative)
6678 QSharedPointer<QCPFinancialDataContainer>
data()
const {
6691 void setData(QSharedPointer<QCPFinancialDataContainer> data);
6692 void setData(
const QVector<double> &keys,
const QVector<double> &open,
6693 const QVector<double> &high,
const QVector<double> &low,
6694 const QVector<double> &close,
bool alreadySorted =
false);
6696 void setWidth(
double width);
6698 void setTwoColored(
bool twoColored);
6699 void setBrushPositive(
const QBrush &
brush);
6700 void setBrushNegative(
const QBrush &brush);
6701 void setPenPositive(
const QPen &
pen);
6702 void setPenNegative(
const QPen &pen);
6705 void addData(
const QVector<double> &keys,
const QVector<double> &open,
6706 const QVector<double> &high,
const QVector<double> &low,
6707 const QVector<double> &close,
bool alreadySorted =
false);
6708 void addData(
double key,
double open,
double high,
double low,
double close);
6713 virtual double selectTest(
const QPointF &pos,
bool onlySelectable,
6724 const QVector<double> &time,
const QVector<double> &value,
6725 double timeBinSize,
double timeBinOffset = 0);
6733 QBrush mBrushPositive, mBrushNegative;
6734 QPen mPenPositive, mPenNegative;
6746 void drawCandlestickPlot(
6750 double getPixelWidth(
double key,
double keyPixel)
const;
6751 double ohlcSelectTest(
6756 double candlestickSelectTest(
6761 void getVisibleDataBounds(
6779 explicit QCPErrorBarsData(
double error);
6780 QCPErrorBarsData(
double errorMinus,
double errorPlus);
6809 QSharedPointer<QCPErrorBarsDataContainer> data READ data WRITE setData)
6812 Q_PROPERTY(
ErrorType errorType READ errorType WRITE setErrorType)
6813 Q_PROPERTY(
double whiskerWidth READ whiskerWidth WRITE setWhiskerWidth)
6814 Q_PROPERTY(
double symbolGap READ symbolGap WRITE setSymbolGap)
6836 QSharedPointer<QCPErrorBarsDataContainer>
data()
const {
6845 void setData(QSharedPointer<QCPErrorBarsDataContainer> data);
6846 void setData(
const QVector<double> &error);
6847 void setData(
const QVector<double> &errorMinus,
6848 const QVector<double> &errorPlus);
6851 void setWhiskerWidth(
double pixels);
6852 void setSymbolGap(
double pixels);
6855 void addData(
const QVector<double> &error);
6856 void addData(
const QVector<double> &errorMinus,
6857 const QVector<double> &errorPlus);
6858 void addData(
double error);
6859 void addData(
double errorMinus,
double errorPlus);
6873 virtual int findEnd(
double sortKey,
6877 virtual double selectTest(
const QPointF &pos,
bool onlySelectable,
6904 QVector<QLineF> &backbones,
6905 QVector<QLineF> &whiskers) const;
6909 double pointDistance(
6910 const QPointF &pixelPoint,
6915 bool errorBarVisible(
int index) const;
6916 bool rectIntersectsLine(const QRectF &pixelRect, const QLineF &line) const;
6946 virtual double selectTest(
const QPointF &pos,
bool onlySelectable,
6960 QLineF getRectClippedStraightLine(
const QCPVector2D &point1,
6962 const QRect &rect)
const;
6981 virtual ~QCPItemLine();
6996 virtual double selectTest(
const QPointF &pos,
bool onlySelectable,
7012 const QRect &rect)
const;
7031 virtual ~QCPItemCurve();
7046 virtual double selectTest(
const QPointF &pos,
bool onlySelectable,
7081 virtual ~QCPItemRect();
7096 virtual double selectTest(
const QPointF &pos,
bool onlySelectable,
7124 virtual QPointF anchorPixelPosition(
int anchorId)
const Q_DECL_OVERRIDE;
7139 Q_PROPERTY(QColor color READ color WRITE setColor)
7140 Q_PROPERTY(QColor selectedColor READ selectedColor WRITE setSelectedColor)
7145 Q_PROPERTY(QFont font READ font WRITE setFont)
7146 Q_PROPERTY(QFont selectedFont READ selectedFont WRITE setSelectedFont)
7147 Q_PROPERTY(QString text READ text WRITE setText)
7148 Q_PROPERTY(Qt::Alignment positionAlignment READ positionAlignment WRITE
7149 setPositionAlignment)
7151 Qt::Alignment textAlignment READ textAlignment WRITE setTextAlignment)
7152 Q_PROPERTY(
double rotation READ rotation WRITE setRotation)
7153 Q_PROPERTY(QMargins padding READ padding WRITE setPadding)
7157 virtual ~QCPItemText();
7166 QFont
font()
const {
return mFont; }
7168 QString
text()
const {
return mText; }
7175 void setColor(
const QColor &color);
7176 void setSelectedColor(
const QColor &color);
7181 void setFont(
const QFont &font);
7182 void setSelectedFont(
const QFont &font);
7183 void setText(
const QString &text);
7184 void setPositionAlignment(Qt::Alignment alignment);
7185 void setTextAlignment(Qt::Alignment alignment);
7186 void setRotation(
double degrees);
7187 void setPadding(
const QMargins &padding);
7190 virtual double selectTest(
const QPointF &pos,
bool onlySelectable,
7216 QColor mColor, mSelectedColor;
7219 QFont mFont, mSelectedFont;
7221 Qt::Alignment mPositionAlignment;
7222 Qt::Alignment mTextAlignment;
7228 virtual QPointF anchorPixelPosition(
int anchorId)
const Q_DECL_OVERRIDE;
7231 QPointF getTextDrawPoint(
const QPointF &pos,
const QRectF &rect,
7232 Qt::Alignment positionAlignment)
const;
7233 QFont mainFont()
const;
7234 QColor mainColor()
const;
7254 virtual ~QCPItemEllipse();
7269 virtual double selectTest(
const QPointF &pos,
bool onlySelectable,
7303 virtual QPointF anchorPixelPosition(
int anchorId)
const Q_DECL_OVERRIDE;
7318 Q_PROPERTY(QPixmap pixmap READ pixmap WRITE setPixmap)
7319 Q_PROPERTY(
bool scaled READ scaled WRITE setScaled)
7320 Q_PROPERTY(Qt::AspectRatioMode aspectRatioMode READ aspectRatioMode)
7321 Q_PROPERTY(Qt::TransformationMode transformationMode READ transformationMode)
7327 virtual ~QCPItemPixmap();
7334 return mTransformationMode;
7340 void setPixmap(
const QPixmap &pixmap);
7342 bool scaled, Qt::AspectRatioMode aspectRatioMode = Qt::KeepAspectRatio,
7343 Qt::TransformationMode transformationMode = Qt::SmoothTransformation);
7348 virtual double selectTest(
const QPointF &pos,
bool onlySelectable,
7372 QPixmap mScaledPixmap;
7374 bool mScaledPixmapInvalidated;
7375 Qt::AspectRatioMode mAspectRatioMode;
7376 Qt::TransformationMode mTransformationMode;
7381 virtual QPointF anchorPixelPosition(
int anchorId)
const Q_DECL_OVERRIDE;
7384 void updateScaledPixmap(QRect finalRect = QRect(),
bool flipHorz =
false,
7385 bool flipVert =
false);
7386 QRect getFinalRect(
bool *flippedHorz = 0,
bool *flippedVert = 0)
const;
7402 Q_PROPERTY(
double size READ size WRITE setSize)
7403 Q_PROPERTY(TracerStyle style READ style WRITE setStyle)
7404 Q_PROPERTY(
QCPGraph *graph READ graph WRITE setGraph)
7405 Q_PROPERTY(
double graphKey READ graphKey WRITE setGraphKey)
7406 Q_PROPERTY(
bool interpolating READ interpolating WRITE setInterpolating)
7429 virtual ~QCPItemTracer();
7436 double size()
const {
return mSize; }
7447 void setSize(
double size);
7450 void setGraphKey(
double key);
7451 void setInterpolating(
bool enabled);
7454 virtual double selectTest(
const QPointF &pos,
bool onlySelectable,
7458 void updatePosition();
7470 bool mInterpolating;
7491 Q_PROPERTY(
double length READ length WRITE setLength)
7492 Q_PROPERTY(BracketStyle style READ style WRITE setStyle)
7514 virtual ~QCPItemBracket();
7525 void setLength(
double length);
7529 virtual double selectTest(
const QPointF &pos,
bool onlySelectable,
7545 virtual QPointF anchorPixelPosition(
int anchorId)
const Q_DECL_OVERRIDE;
7554 #endif // QCUSTOMPLOT_H virtual void donePainting()
Definition: qcustomplot.h:689
double whiskerWidth() const
Definition: qcustomplot.h:6366
ColorInterpolation
Definition: qcustomplot.h:2201
BracketStyle mBracketStyle
Definition: qcustomplot.h:5171
int iconTextPadding() const
Definition: qcustomplot.h:5462
QSharedPointer< QCPStatisticalBoxDataContainer > data() const
Definition: qcustomplot.h:6362
void setBrush(const QBrush &brush)
bool isEmpty() const
Definition: qcustomplot.h:6484
QCPLineEnding tail() const
Definition: qcustomplot.h:7037
BracketStyle
Definition: qcustomplot.h:4215
Qt::TransformationMode transformationMode() const
Definition: qcustomplot.h:7333
int columnSpacing() const
Definition: qcustomplot.h:1562
virtual QCPItemPosition * toQCPItemPosition() Q_DECL_OVERRIDE
Definition: qcustomplot.h:3943
QColor selectedTickLabelColor() const
Definition: qcustomplot.h:2336
0x0001 Axis base line and tick marks
Definition: qcustomplot.h:127
bool visible() const
Definition: qcustomplot.h:861
Definition: qcustomplot.h:1760
QCustomPlot * parentPlot() const
Definition: qcustomplot.h:862
QHash< QCP::MarginSide, QCPMarginGroup * > marginGroups() const
Definition: qcustomplot.h:1422
int mOpenGlMultisamples
Definition: qcustomplot.h:4300
double mainValue() const
Definition: qcustomplot.h:5960
QPen mPen
Definition: qcustomplot.h:3682
friend class QCPPlottableLegendItem
Definition: qcustomplot.h:1721
QCPRange valueRange() const
Definition: qcustomplot.h:5775
Definition: qcustomplot.h:1763
EndingStyle
Definition: qcustomplot.h:1032
QCP::AntialiasedElements antialiasedElements() const
Definition: qcustomplot.h:4103
QPen pen() const
Definition: qcustomplot.h:1285
QCPAbstractPlottable * dataPlottable() const
Definition: qcustomplot.h:6839
void performAutoSqueeze()
Definition: qcustomplot.h:3613
virtual int findBegin(double sortKey, bool expandedRange=true) const Q_DECL_OVERRIDE
Definition: qcustomplot.h:4800
0x00 no margin
Definition: qcustomplot.h:111
QVector< double > tickVector() const
Definition: qcustomplot.h:2316
int size() const
Definition: qcustomplot.h:2766
Definition: qcustomplot.h:1570
QCPDataRange dataRange() const
Definition: qcustomplot.h:2802
QPen selectedPen() const
Definition: qcustomplot.h:7518
double mainValue() const
Definition: qcustomplot.h:5773
QCPDataContainer< QCPFinancialData > QCPFinancialDataContainer
Definition: qcustomplot.h:6630
virtual void parentPlotInitialized(QCustomPlot *parentPlot)
QColor mSelectedTextColor
Definition: qcustomplot.h:5621
QList< double > rowStretchFactors() const
Definition: qcustomplot.h:1561
Qt::AspectRatioMode backgroundScaledMode() const
Definition: qcustomplot.h:5207
double mLogBase
Definition: qcustomplot.h:2105
QList< QSharedPointer< QCPAbstractPaintBuffer > > mPaintBuffers
Definition: qcustomplot.h:4291
int top() const
Definition: qcustomplot.h:5256
Definition: qcustomplot.h:215
void setX(double x)
Definition: qcustomplot.h:522
QCPBars * barAbove() const
Definition: qcustomplot.h:6236
int dataRangeCount() const
Definition: qcustomplot.h:1127
QSize maximumSize() const
Definition: qcustomplot.h:1417
virtual QCP::Interaction selectionCategory() const
virtual int calculateAutoMargin(QCP::MarginSide side)
bool isEmpty() const
Definition: qcustomplot.h:1136
Definition: qcustomplot.h:408
QBrush mSelectedBrush
Definition: qcustomplot.h:1679
QFont labelFont() const
Definition: qcustomplot.h:2326
Definition: qcustomplot.h:856
bool tangentToData() const
Definition: qcustomplot.h:5146
Resolution is given in dots per inch (DPI/PPI)
Definition: qcustomplot.h:181
void selectionChanged(bool selected)
QCPGraph * channelFillGraph() const
Definition: qcustomplot.h:5841
double graphKey() const
Definition: qcustomplot.h:7439
QSharedPointer< QCPCurveDataContainer > data() const
Definition: qcustomplot.h:6006
QCPColorGradient gradient() const
Definition: qcustomplot.h:6530
Definition: qcustomplot.h:2027
bool inverted() const
Definition: qcustomplot.h:1731
QPixmap pixmap() const
Definition: qcustomplot.h:7330
void setBegin(int begin)
Definition: qcustomplot.h:1075
ErrorType errorType() const
Definition: qcustomplot.h:6840
Definition: qcustomplot.h:191
PainterModes modes() const
Definition: qcustomplot.h:634
SizeConstraintRect sizeConstraintRect() const
Definition: qcustomplot.h:1418
Qt::Alignment positionAlignment() const
Definition: qcustomplot.h:7169
QBrush selectedBrush() const
Definition: qcustomplot.h:7165
QPen selectedTickPen() const
Definition: qcustomplot.h:2339
bool antialiasedFill() const
Definition: qcustomplot.h:3722
bool clipToAxisRect() const
Definition: qcustomplot.h:3965
0xFF all margins
Definition: qcustomplot.h:109
ScaleType scaleType() const
Definition: qcustomplot.h:2303
int length() const
Definition: qcustomplot.h:1072
virtual QCPRange getKeyRange(bool &foundRange, SignDomain inSignDomain=sdBoth) const =0
QCP::MarginSides autoMargins() const
Definition: qcustomplot.h:1415
TickStepStrategy tickStepStrategy() const
Definition: qcustomplot.h:1784
QPen selectedPen() const
Definition: qcustomplot.h:6985
Definition: qcustomplot.h:148
QCP::SelectionRectMode selectionRectMode() const
Definition: qcustomplot.h:4117
Definition: qcustomplot.h:3647
QBrush mBracketBrush
Definition: qcustomplot.h:5168
void remove(double sortKeyFrom, double sortKeyTo)
Definition: qcustomplot.h:3181
bool openGl() const
Definition: qcustomplot.h:4121
Definition: qcustomplot.h:593
QString text() const
Definition: qcustomplot.h:7168
QDebug operator<<(QDebug d, const QCPRange &range)
Definition: qcustomplot.h:994
QRect axisSelectionBox() const
Definition: qcustomplot.h:2532
bool subGridVisible() const
Definition: qcustomplot.h:2139
bool backgroundScaled() const
Definition: qcustomplot.h:5206
bool antialiasing() const
Definition: qcustomplot.h:633
QPen selectedPen() const
Definition: qcustomplot.h:7433
int mScatterSkip
Definition: qcustomplot.h:5873
LineStyle
Definition: qcustomplot.h:2854
AnchorIndex
Definition: qcustomplot.h:4092
LayerMode
Definition: qcustomplot.h:793
QFont selectedTickLabelFont() const
Definition: qcustomplot.h:2334
QFont font() const
Definition: qcustomplot.h:7166
double rotation() const
Definition: qcustomplot.h:7171
0x08 bottom margin
Definition: qcustomplot.h:107
double width() const
Definition: qcustomplot.h:6230
Definition: qcustomplot.h:3686
QCPAxis * valueAxis() const
Definition: qcustomplot.h:3727
Definition: qcustomplot.h:1865
bool antialiasedSubGrid() const
Definition: qcustomplot.h:2140
const_iterator at(int index) const
Definition: qcustomplot.h:2795
QPen basePen() const
Definition: qcustomplot.h:2323
bool isActive() const
Definition: qcustomplot.h:1287
bool mInvalidated
Definition: qcustomplot.h:699
int tickCount() const
Definition: qcustomplot.h:1785
virtual QCPPlottableInterface1D * interface1D() Q_DECL_OVERRIDE
Definition: qcustomplot.h:6879
Definition: qcustomplot.h:94
QWeakPointer< QCPAbstractPaintBuffer > mPaintBuffer
Definition: qcustomplot.h:830
QPen pen() const
Definition: qcustomplot.h:3724
double & rx()
Definition: qcustomplot.h:518
int bracketWidth() const
Definition: qcustomplot.h:5143
Definition: qcustomplot.h:3037
Qt::Alignment textAlignment() const
Definition: qcustomplot.h:7170
QColor selectedTextColor() const
Definition: qcustomplot.h:5343
QList< QCPDataRange > dataRanges() const
Definition: qcustomplot.h:1130
double mPiValue
Definition: qcustomplot.h:2064
virtual void selectEvent(QMouseEvent *event, bool additive, const QVariant &details, bool *selectionStateChanged)
int index() const
Definition: qcustomplot.h:808
QPen pen() const
Definition: qcustomplot.h:3654
QCPScatterStyle outlierStyle() const
Definition: qcustomplot.h:6371
double tickOrigin() const
Definition: qcustomplot.h:1786
virtual QCPPlottableInterface1D * interface1D()
Definition: qcustomplot.h:3753
bool contains(QCPBars *bars) const
Definition: qcustomplot.h:6135
ScatterShape shape() const
Definition: qcustomplot.h:2700
QSharedPointer< QCPGraphDataContainer > data() const
Definition: qcustomplot.h:5837
0x04 top margin
Definition: qcustomplot.h:105
const QCPRange operator+(const QCPRange &range, double value)
Definition: qcustomplot.h:675
QColor selectedTextColor() const
Definition: qcustomplot.h:5584
QRect mRect
Definition: qcustomplot.h:1304
virtual QSize minimumOuterSizeHint() const
QCPBarsGroup * barsGroup() const
Definition: qcustomplot.h:6232
Definition: qcustomplot.h:6162
InsetPlacement
Definition: qcustomplot.h:969
Qt::TimeSpec dateTimeSpec() const
Definition: qcustomplot.h:1842
QCPRange valueRange(bool &foundRange, QCP::SignDomain signDomain=QCP::sdBoth, const QCPRange &inKeyRange=QCPRange())
Definition: qcustomplot.h:3467
QCPLayerable * parentLayerable() const
Definition: qcustomplot.h:863
QPen selectedPen() const
Definition: qcustomplot.h:1624
Definition: qcustomplot.h:1276
ErrorType
Definition: qcustomplot.h:6824
QCPScatterStyle scatterStyle() const
Definition: qcustomplot.h:5839
QSharedPointer< QCPBarsDataContainer > data() const
Definition: qcustomplot.h:6237
int size() const
Definition: qcustomplot.h:1071
QColor selectedColor() const
Definition: qcustomplot.h:7161
SpacingType spacingType() const
Definition: qcustomplot.h:6122
QColor labelColor() const
Definition: qcustomplot.h:2327
QSize mSize
Definition: qcustomplot.h:695
bool tightBoundary() const
Definition: qcustomplot.h:6529
ScaleStrategy mScaleStrategy
Definition: qcustomplot.h:1975
QSharedPointer< QCPFinancialDataContainer > data() const
Definition: qcustomplot.h:6678
Definition: qcustomplot.h:2708
QPen pen() const
Definition: qcustomplot.h:7084
QPen whiskerBarPen() const
Definition: qcustomplot.h:6368
void setSelectedTextColor(const QColor &color)
QCPScatterStyle::ScatterProperties mUsedScatterProperties
Definition: qcustomplot.h:3685
QPixmap mBuffer
Definition: qcustomplot.h:717
bool selected() const
Definition: qcustomplot.h:5345
0x0000 No elements
Definition: qcustomplot.h:156
QPen subGridPen() const
Definition: qcustomplot.h:2143
Definition: qcustomplot.h:305
DateStrategy
Definition: qcustomplot.h:1863
QPainterPath customPath() const
Definition: qcustomplot.h:2704
QList< QCPRange > mDragStartVertRange
Definition: qcustomplot.h:5286
static QCPStatisticalBoxData fromSortKey(double sortKey)
Definition: qcustomplot.h:6310
virtual void mouseReleaseEvent(QMouseEvent *event, const QPointF &startPos)
void removeBefore(double sortKey)
Definition: qcustomplot.h:3146
double sortKey() const
Definition: qcustomplot.h:6309
int subTickCount() const
Definition: qcustomplot.h:1993
ColorInterpolation colorInterpolation() const
Definition: qcustomplot.h:5066
QVariant mMouseSignalLayerableDetails
Definition: qcustomplot.h:4297
QRect outerRect() const
Definition: qcustomplot.h:1412
QCustomPlot * mParentPlot
Definition: qcustomplot.h:562
void set(const QCPDataContainer< DataType > &data)
Definition: qcustomplot.h:3004
QCPMarginGroup * marginGroup(QCP::MarginSide side) const
Definition: qcustomplot.h:1419
Definition: qcustomplot.h:1836
QCPSelectionDecorator * mSelectionDecorator
Definition: qcustomplot.h:3789
QList< QCPLayoutElement * > elements(QCP::MarginSide side) const
Definition: qcustomplot.h:1336
double mTickStep
Definition: qcustomplot.h:1974
Defines an abstract interface for one-dimensional plottables.
Definition: qcustomplot.h:4362
ResolutionUnit
Definition: qcustomplot.h:176
QCPAxis::ScaleType dataScaleType() const
Definition: qcustomplot.h:5697
QPen selectedBorderPen() const
Definition: qcustomplot.h:5466
#define Q_DECL_OVERRIDE
Definition: qcustomplot.h:137
bool selected() const
Definition: qcustomplot.h:5586
double tickStep() const
Definition: qcustomplot.h:1965
QVector< QString > tickVectorLabels() const
Definition: qcustomplot.h:2317
virtual void drawLegendIcon(QCPPainter *painter, const QRectF &rect) const =0
QBrush bracketBrush() const
Definition: qcustomplot.h:5142
QString name() const
Definition: qcustomplot.h:3721
QBrush selectedBrush() const
Definition: qcustomplot.h:7260
Definition: qcustomplot.h:2091
Definition: qcustomplot.h:3337
SignDomain
Definition: qcustomplot.h:207
virtual void applyDefaultAntialiasingHint(QCPPainter *painter) const Q_DECL_OVERRIDE
Definition: qcustomplot.h:1463
bool backgroundScaled() const
Definition: qcustomplot.h:4098
double mLogBaseLnInv
Definition: qcustomplot.h:2109
QCPRange keyRange() const
Definition: qcustomplot.h:6460
bool ticks() const
Definition: qcustomplot.h:2307
bool mTangentToData
Definition: qcustomplot.h:5172
double whiskerWidth() const
Definition: qcustomplot.h:6841
QList< QPointer< QCPAxis > > mRangeZoomVertAxis
Definition: qcustomplot.h:5282
bool isEmpty() const
Definition: qcustomplot.h:1080
virtual QCPRange dataValueRange(int index) const Q_DECL_OVERRIDE
Definition: qcustomplot.h:4700
QPointer< QCPAbstractPlottable > mDataPlottable
Definition: qcustomplot.h:6886
double upper
Definition: qcustomplot.h:595
void drawPolyline(QCPPainter *painter, const QVector< QPointF > &lineData) const
Definition: qcustomplot.h:4934
QVector< QCPErrorBarsData > QCPErrorBarsDataContainer
Definition: qcustomplot.h:6802
Definition: qcustomplot.h:358
int mSubTickCount
Definition: qcustomplot.h:2106
RefreshPriority
Definition: qcustomplot.h:1963
Definition: qcustomplot.h:5554
QCPGraph * graph() const
Definition: qcustomplot.h:7438
double mTickOrigin
Definition: qcustomplot.h:1803
int mBracketHeight
Definition: qcustomplot.h:5170
QCPDataContainer< QCPGraphData > QCPGraphDataContainer
Definition: qcustomplot.h:5792
QCPItemAnchor * parentAnchorX() const
Definition: qcustomplot.h:3908
QBrush selectedBrush() const
Definition: qcustomplot.h:7435
int scatterSkip() const
Definition: qcustomplot.h:6008
bool visible() const
Definition: qcustomplot.h:810
AxisType axisType() const
Definition: qcustomplot.h:2301
const_iterator constEnd() const
Definition: qcustomplot.h:2790
QCPLayer * layer() const
Definition: qcustomplot.h:864
QCPItemAnchor * parentAnchorY() const
Definition: qcustomplot.h:3909
static bool sortKeyIsMainKey()
Definition: qcustomplot.h:5957
double lower
Definition: qcustomplot.h:595
void setY(double y)
Definition: qcustomplot.h:523
Definition: qcustomplot.h:480
QPoint bottomRight() const
Definition: qcustomplot.h:5264
0x000 No hints are set
Definition: qcustomplot.h:167
QPen whiskerPen() const
Definition: qcustomplot.h:6367
QVariant mMouseEventLayerableDetails
Definition: qcustomplot.h:4296
Definition: qcustomplot.h:204
double lengthSquared() const
Definition: qcustomplot.h:527
QPen selectedPen() const
Definition: qcustomplot.h:7163
double mainKey() const
Definition: qcustomplot.h:6315
int scatterSkip() const
Definition: qcustomplot.h:5840
QPen pen() const
Definition: qcustomplot.h:6938
Definition: qcustomplot.h:221
QBrush backgroundBrush() const
Definition: qcustomplot.h:5205
Definition: qcustomplot.h:1015
QRect viewport() const
Definition: qcustomplot.h:4095
QFont selectedFont() const
Definition: qcustomplot.h:5469
virtual ~QCPPlottableInterface1D()
Definition: qcustomplot.h:4364
The positive sign domain, i.e. numbers greater than zero.
Definition: qcustomplot.h:212
QString timeFormat() const
Definition: qcustomplot.h:1908
QMap< double, QString > & ticks()
Definition: qcustomplot.h:1992
void drawLine(const QPointF &p1, const QPointF &p2)
Definition: qcustomplot.h:647
Definition: qcustomplot.h:1087
double mainKey() const
Definition: qcustomplot.h:5959
TickStepStrategy
Definition: qcustomplot.h:1769
const_iterator findEnd(double sortKey, bool expandedRange=true) const
Definition: qcustomplot.h:3324
bool operator==(const QCPDataRange &other) const
Definition: qcustomplot.h:1063
virtual QCPItemPosition * toQCPItemPosition()
Definition: qcustomplot.h:3845
void setSelectedPen(const QPen &pen)
Definition: qcustomplot.h:1096
QCP::SelectionType mSelectable
Definition: qcustomplot.h:3787
void sort()
Definition: qcustomplot.h:3244
int mPeriodicity
Definition: qcustomplot.h:2065
0x0020 Main lines of plottables
Definition: qcustomplot.h:137
double value() const
Definition: qcustomplot.h:3911
void expand(const QCPRange &otherRange)
FillOrder fillOrder() const
Definition: qcustomplot.h:1565
double length() const
Definition: qcustomplot.h:526
QCPRange valueRange() const
Definition: qcustomplot.h:6610
TracerStyle style() const
Definition: qcustomplot.h:7437
int rowCount() const
Definition: qcustomplot.h:1556
ExportPen
Definition: qcustomplot.h:190
QBrush brushPositive() const
Definition: qcustomplot.h:6685
QString label() const
Definition: qcustomplot.h:2328
QCPDataRange adjusted(int changeBegin, int changeEnd) const
Definition: qcustomplot.h:1084
double length() const
Definition: qcustomplot.h:7519
QPoint bottomLeft() const
Definition: qcustomplot.h:5263
virtual int dataCount() const Q_DECL_OVERRIDE
Definition: qcustomplot.h:4653
QRect suffixBounds
Definition: qcustomplot.h:2572
Definition: qcustomplot.h:1523
QBrush brush() const
Definition: qcustomplot.h:3655
QPen penPositive() const
Definition: qcustomplot.h:6687
double mStackingGap
Definition: qcustomplot.h:6275
Definition: qcustomplot.h:2192
ScatterShape
Definition: qcustomplot.h:317
bool selectable() const
Definition: qcustomplot.h:1629
AntialiasedElement
Definition: qcustomplot.h:126
ErrorType mErrorType
Definition: qcustomplot.h:6887
Definition: qcustomplot.h:183
0x01 left margin
Definition: qcustomplot.h:101
bool qcpLessThanSortKey(const DataType &a, const DataType &b)
Definition: qcustomplot.h:2751
virtual void mouseMoveEvent(QMouseEvent *event, const QPointF &startPos)
int numberPrecision() const
Definition: qcustomplot.h:2315
QCPRange dataRange() const
Definition: qcustomplot.h:6526
QCPRange & operator-=(const double &value)
Definition: qcustomplot.h:947
QPen pen() const
Definition: qcustomplot.h:7517
Definition: qcustomplot.h:6302
QBrush brush() const
Definition: qcustomplot.h:2702
int left() const
Definition: qcustomplot.h:5254
AnchorIndex
Definition: qcustomplot.h:3855
double mainValue() const
Definition: qcustomplot.h:6174
QPen pen() const
Definition: qcustomplot.h:6984
LayerMode mMode
Definition: qcustomplot.h:827
bool mSelected
Definition: qcustomplot.h:5623
QPen pen() const
Definition: qcustomplot.h:7336
const QCPRange operator*(const QCPRange &range, double value)
Definition: qcustomplot.h:702
QCP::AntialiasedElements notAntialiasedElements() const
Definition: qcustomplot.h:4106
QSize size() const
Definition: qcustomplot.h:5260
Definition: qcustomplot.h:1925
QCPDataContainer< QCPStatisticalBoxData > QCPStatisticalBoxDataContainer
Definition: qcustomplot.h:6342
QCPAxis::AxisType type() const
Definition: qcustomplot.h:5695
One individual data point can be selected at a time.
Definition: qcustomplot.h:403
LabelSide
Definition: qcustomplot.h:1248
virtual double dataSortKey(int index) const Q_DECL_OVERRIDE
Definition: qcustomplot.h:4674
QCPScatterStyle scatterStyle() const
Definition: qcustomplot.h:3656
bool mActive
Definition: qcustomplot.h:1308
QCPDataMap * data() const
Definition: qcustomplot.h:2894
QSize iconSize() const
Definition: qcustomplot.h:5461
QRect mTextBoundingRect
Definition: qcustomplot.h:5622
QDebug operator<<(QDebug d, const QCPDataSelection &selection)
Definition: qcustomplot.h:1261
void removeAfter(double sortKey)
Definition: qcustomplot.h:3163
QBrush brush() const
Definition: qcustomplot.h:7259
QCPVector2D perpendicular() const
Definition: qcustomplot.h:534
Qt::AspectRatioMode aspectRatioMode() const
Definition: qcustomplot.h:7332
virtual double selectTest(const QPointF &pos, bool onlySelectable, QVariant *details=0) const Q_DECL_OVERRIDE
Definition: qcustomplot.h:4828
QCPGrid * grid() const
Definition: qcustomplot.h:2343
virtual void update(UpdatePhase phase)
double width() const
Definition: qcustomplot.h:1729
QString name() const
Definition: qcustomplot.h:807
void squeeze(bool preAllocation=true, bool postAllocation=true)
Definition: qcustomplot.h:3260
Definition: qcustomplot.h:508
virtual QCPPlottableInterface1D * interface1D() Q_DECL_OVERRIDE
Definition: qcustomplot.h:4409
QCPDataSelection inverse(const QCPDataRange &outerRange) const
QCPRange dataRange() const
Definition: qcustomplot.h:5696
void preallocateGrow(int minimumPreallocSize)
Definition: qcustomplot.h:3580
bool selectable() const
Definition: qcustomplot.h:3967
double value
Definition: qcustomplot.h:5777
QRect rect() const
Definition: qcustomplot.h:1411
#define QCP_LIB_DECL
Definition: qcustomplot.h:132
QPen selectedSubTickPen() const
Definition: qcustomplot.h:2340
Qt::Orientations rangeDrag() const
Definition: qcustomplot.h:5210
QMargins minimumMargins() const
Definition: qcustomplot.h:1414
int getMarginValue(const QMargins &margins, QCP::MarginSide side)
Definition: qcustomplot.h:282
QList< QCPItemAnchor * > anchors() const
Definition: qcustomplot.h:3982
SelectablePart
Definition: qcustomplot.h:1271
virtual void draw(QCPPainter *painter)=0
ScatterProperty
Definition: qcustomplot.h:2612
The generic data container for one-dimensional plottables.
Definition: qcustomplot.h:2756
BracketStyle
Definition: qcustomplot.h:5121
Definition: qcustomplot.h:2500
double mBufferDevicePixelRatio
Definition: qcustomplot.h:4266
QFont mSelectedFont
Definition: qcustomplot.h:5620
bool mSelectable
Definition: qcustomplot.h:1681
QList< QCPBars * > bars() const
Definition: qcustomplot.h:6130
QPointF toPointF() const
Definition: qcustomplot.h:529
QFont mFont
Definition: qcustomplot.h:2455
QCPColorScale * colorScale() const
Definition: qcustomplot.h:6531
void setMarginValue(QMargins &margins, QCP::MarginSide side, int value)
Definition: qcustomplot.h:253
Qt::Orientations rangeZoom() const
Definition: qcustomplot.h:5211
double mainKey() const
Definition: qcustomplot.h:6607
SelectableParts selectableParts() const
Definition: qcustomplot.h:2333
QCPDataRange bounded(const QCPDataRange &other) const
QCPLayoutGrid * plotLayout() const
Definition: qcustomplot.h:4102
Definition: qcustomplot.h:354
QCPAbstractPlottable * plottable()
Definition: qcustomplot.h:5396
double center() const
Definition: qcustomplot.h:970
FractionStyle fractionStyle() const
Definition: qcustomplot.h:2053
void setSelectedFont(const QFont &font)
Definition: qcustomplot.h:894
double sortKey() const
Definition: qcustomplot.h:6601
QCPAbstractPlottable * mPlottable
Definition: qcustomplot.h:3687
void setSelectedBrush(const QBrush &brush)
Qt::Orientation orientation() const
Definition: qcustomplot.h:2397
QList< QCPItemPosition * > positions() const
Definition: qcustomplot.h:3981
static QCPGraphData fromSortKey(double sortKey)
Definition: qcustomplot.h:5767
Definition: qcustomplot.h:414
Definition: qcustomplot.h:755
double width() const
Definition: qcustomplot.h:6365
bool isNone() const
Definition: qcustomplot.h:2716
QBrush mBrush
Definition: qcustomplot.h:3683
bool autoAddPlottableToLegend() const
Definition: qcustomplot.h:4109
Definition: qcustomplot.h:5761
PositionType typeY() const
Definition: qcustomplot.h:3906
void selectableChanged(bool selectable)
QBrush mBrush
Definition: qcustomplot.h:1679
const_iterator findBegin(double sortKey, bool expandedRange=true) const
Definition: qcustomplot.h:3291
EndingStyle style() const
Definition: qcustomplot.h:1728
QCPAxis * keyAxis() const
Definition: qcustomplot.h:3913
ChartStyle chartStyle() const
Definition: qcustomplot.h:6681
virtual void simplify() Q_DECL_OVERRIDE
Definition: qcustomplot.h:1657
bool mDragging
Definition: qcustomplot.h:2473
Definition: qcustomplot.h:405
Definition: qcustomplot.h:2297
AnchorIndex
Definition: qcustomplot.h:4251
QSharedPointer< QCPErrorBarsDataContainer > data() const
Definition: qcustomplot.h:6836
QPen pen() const
Definition: qcustomplot.h:7034
void setPen(const QPen &pen)
virtual QCPDataSelection selectTestRect(const QRectF &rect, bool onlySelectable) const Q_DECL_OVERRIDE
Definition: qcustomplot.h:4741
QString mPiSymbol
Definition: qcustomplot.h:2063
bool adaptiveSampling() const
Definition: qcustomplot.h:5842
virtual void mouseDoubleClickEvent(QMouseEvent *event, const QVariant &details)
QDebug operator<<(QDebug d, const QCPDataRange &dataRange)
Definition: qcustomplot.h:1251
virtual double dataMainValue(int index) const Q_DECL_OVERRIDE
Definition: qcustomplot.h:4687
double mainValue() const
Definition: qcustomplot.h:6608
Definition: qcustomplot.h:369
Both sign domains, including zero, i.e. all numbers.
Definition: qcustomplot.h:210
QVector< DataType >::iterator iterator
Definition: qcustomplot.h:2761
int subTickCount() const
Definition: qcustomplot.h:2097
QPointer< QCPLayerable > mMouseSignalLayerable
Definition: qcustomplot.h:4295
Definition: qcustomplot.h:2732
int keySize() const
Definition: qcustomplot.h:6458
int mWrap
Definition: qcustomplot.h:1608
QCPLineEnding head() const
Definition: qcustomplot.h:6986
bool selectable() const
Definition: qcustomplot.h:5585
virtual int findEnd(double sortKey, bool expandedRange=true) const Q_DECL_OVERRIDE
Definition: qcustomplot.h:4810
bool operator!=(const QCPRange &other) const
Definition: qcustomplot.h:940
void pixelsToCoords(double x, double y, double &key, double &value) const
int mTangentAverage
Definition: qcustomplot.h:5173
Definition: qcustomplot.h:3157
bool operator==(const QCPRange &other) const
Definition: qcustomplot.h:937
QCPLineEnding head() const
Definition: qcustomplot.h:7036
int mPreallocSize
Definition: qcustomplot.h:2812
double sortKey() const
Definition: qcustomplot.h:6167
QPen pen() const
Definition: qcustomplot.h:7257
TimeUnit mSmallestUnit
Definition: qcustomplot.h:1921
void clear()
Definition: qcustomplot.h:3225
int columnCount() const
Definition: qcustomplot.h:1557
int mScatterSkip
Definition: qcustomplot.h:6040
int pixelOrientation() const
Definition: qcustomplot.h:2398
QFont selectedFont() const
Definition: qcustomplot.h:5583
QList< double > columnStretchFactors() const
Definition: qcustomplot.h:1560
Qt::KeyboardModifier multiSelectModifier() const
Definition: qcustomplot.h:4114
LayerInsertMode
Definition: qcustomplot.h:1950
QList< QPointer< QCPAxis > > mRangeDragVertAxis
Definition: qcustomplot.h:5281
QPen selectedPen() const
Definition: qcustomplot.h:6939
Definition: qcustomplot.h:2410
SelectableParts selectableParts() const
Definition: qcustomplot.h:5464
SelectionRectMode
Definition: qcustomplot.h:353
virtual void mouseMoveEvent(QMouseEvent *event)
QCPBars * barBelow() const
Definition: qcustomplot.h:6235
double mDevicePixelRatio
Definition: qcustomplot.h:696
QCP::AntialiasedElements mOpenGlAntialiasedElementsBackup
Definition: qcustomplot.h:4301
WidthType
Definition: qcustomplot.h:6652
int bottom() const
Definition: qcustomplot.h:5257
unsigned char * mAlpha
Definition: qcustomplot.h:6498
QBrush selectedBrush() const
Definition: qcustomplot.h:7087
Definition: qcustomplot.h:1058
QVector< DataType >::const_iterator const_iterator
Definition: qcustomplot.h:2760
QCPRange & operator*=(const double &value)
Definition: qcustomplot.h:952
0x0010 Legend items
Definition: qcustomplot.h:135
QPen selectedPen() const
Definition: qcustomplot.h:7085
void normalize()
Definition: qcustomplot.h:971
virtual double dataMainKey(int index) const Q_DECL_OVERRIDE
Definition: qcustomplot.h:4661
UpdatePhase
Definition: qcustomplot.h:772
static QCPCurveData fromSortKey(double sortKey)
Definition: qcustomplot.h:5954
QCPRange & operator/=(const double &value)
Definition: qcustomplot.h:957
QCPDataContainer< QCPCurveData > QCPCurveDataContainer
Definition: qcustomplot.h:5980
bool mReplotQueued
Definition: qcustomplot.h:4299
QCPScatterStyle::ScatterProperties usedScatterProperties() const
Definition: qcustomplot.h:3657
bool mAutoSqueeze
Definition: qcustomplot.h:2808
PositionType
Definition: qcustomplot.h:1771
Definition: qcustomplot.h:672
double width() const
Definition: qcustomplot.h:6682
void setTextColor(const QColor &color)
static QCPFinancialData fromSortKey(double sortKey)
Definition: qcustomplot.h:6602
QCPRange & operator+=(const double &value)
Definition: qcustomplot.h:942
Definition: qcustomplot.h:3058
QColor mSelectedTextColor
Definition: qcustomplot.h:2458
int rowSpacing() const
Definition: qcustomplot.h:1563
void addDataRange(const QCPDataRange &dataRange, bool simplify=true)
QColor mTextColor
Definition: qcustomplot.h:5619
0xFFFF All elements
Definition: qcustomplot.h:154
QRect rect() const
Definition: qcustomplot.h:1283
Definition: qcustomplot.h:2478
bool operator!=(const QCPDataSelection &other) const
Definition: qcustomplot.h:1102
double y() const
Definition: qcustomplot.h:517
bool isPenDefined() const
Definition: qcustomplot.h:2717
bool mWhiskerAntialiased
Definition: qcustomplot.h:6415
QCustomPlot * parentPlot() const
Definition: qcustomplot.h:806
AnchorIndex
Definition: qcustomplot.h:3945
bool selected() const
Definition: qcustomplot.h:3729
const QCP::Interactions interactions() const
Definition: qcustomplot.h:4110
QPen selectedPen() const
Definition: qcustomplot.h:7337
QBrush brush() const
Definition: qcustomplot.h:1286
QCPRange valueRange() const
Definition: qcustomplot.h:6176
WidthType widthType() const
Definition: qcustomplot.h:6231
QCP::SelectionRectMode mSelectionRectMode
Definition: qcustomplot.h:4286
QMap< double, QString > mTicks
Definition: qcustomplot.h:2010
bool contains(double value) const
Definition: qcustomplot.h:981
QPen mBracketPen
Definition: qcustomplot.h:5167
QHash< TimeUnit, int > mFieldWidth
Definition: qcustomplot.h:1918
Q_SLOT void setSelectable(bool selectable)
Definition: qcustomplot.h:208
bool isInvalidData(double value)
Definition: qcustomplot.h:234
QCPRange valueRange() const
Definition: qcustomplot.h:6318
QPen medianPen() const
Definition: qcustomplot.h:6370
bool isEmpty() const
Definition: qcustomplot.h:2767
Definition: qcustomplot.h:1137
Definition: qcustomplot.h:295
virtual ~QCPAbstractPlottable1D()
Definition: qcustomplot.h:4647
FractionStyle
Definition: qcustomplot.h:2035
QPen borderPen() const
Definition: qcustomplot.h:5457
TracerStyle
Definition: qcustomplot.h:4141
QPen mPen
Definition: qcustomplot.h:1305
int tangentAverage() const
Definition: qcustomplot.h:5147
QMargins margins() const
Definition: qcustomplot.h:1413
ScaleStrategy scaleStrategy() const
Definition: qcustomplot.h:1966
A template base class for plottables with one-dimensional data.
Definition: qcustomplot.h:4380
0x0040 Main lines of items
Definition: qcustomplot.h:141
0x01 The pen property, see setPen
Definition: qcustomplot.h:2615
PositionType type() const
Definition: qcustomplot.h:3904
bool whiskerAntialiased() const
Definition: qcustomplot.h:6369
QRect tickLabelsSelectionBox() const
Definition: qcustomplot.h:2533
QPixmap background() const
Definition: qcustomplot.h:5204
SelectableParts selectedParts() const
Definition: qcustomplot.h:2332
bool subTicks() const
Definition: qcustomplot.h:2320
QCPLegend * parentLegend() const
Definition: qcustomplot.h:5339
PositionType typeX() const
Definition: qcustomplot.h:3905
bool invalidated() const
Definition: qcustomplot.h:679
GradientPreset
Definition: qcustomplot.h:2214
QCPAxis * keyAxis() const
Definition: qcustomplot.h:3726
double length() const
Definition: qcustomplot.h:1730
QPen pen() const
Definition: qcustomplot.h:7432
int size() const
Definition: qcustomplot.h:6132
QPen pen() const
Definition: qcustomplot.h:2701
int mTickCount
Definition: qcustomplot.h:1802
0x0400 Zero-lines, see QCPGrid::setZeroLinePen
Definition: qcustomplot.h:151
bool interpolating() const
Definition: qcustomplot.h:7440
Definition: qcustomplot.h:212
Definition: qcustomplot.h:196
LayerMode mode() const
Definition: qcustomplot.h:811
virtual void mouseReleaseEvent(QMouseEvent *event)
Definition: qcustomplot.h:726
QFont selectedFont() const
Definition: qcustomplot.h:5342
QCPDataSelection mSelection
Definition: qcustomplot.h:3788
Q_SLOT void setSelected(bool selected)
0x0008 Legend box
Definition: qcustomplot.h:133
QFont mFont
Definition: qcustomplot.h:5618
QSharedPointer< QCPAxisTicker > mTicker
Definition: qcustomplot.h:2467
double & ry()
Definition: qcustomplot.h:519
static bool sortKeyIsMainKey()
Definition: qcustomplot.h:6313
QString piSymbol() const
Definition: qcustomplot.h:2050
QCPRange keyRange(bool &foundRange, QCP::SignDomain signDomain=QCP::sdBoth)
Definition: qcustomplot.h:3351
Q_DECLARE_TYPEINFO(QCPScatterStyle, Q_MOVABLE_TYPE)
QRect labelSelectionBox() const
Definition: qcustomplot.h:2534
int bracketHeight() const
Definition: qcustomplot.h:5144
int mTextFlags
Definition: qcustomplot.h:5617
QString mDateTimeFormat
Definition: qcustomplot.h:1859
AnchorIndex
Definition: qcustomplot.h:4021
bool antialiasedZeroLine() const
Definition: qcustomplot.h:2141
QFont selectedLabelFont() const
Definition: qcustomplot.h:2335
QPen pen() const
Definition: qcustomplot.h:2142
bool interpolate() const
Definition: qcustomplot.h:6528
QColor mTextColor
Definition: qcustomplot.h:2456
Definition: qcustomplot.h:1724
double mainValue() const
Definition: qcustomplot.h:6316
Definition: qcustomplot.h:1847
virtual void wheelEvent(QWheelEvent *event)
QFont font() const
Definition: qcustomplot.h:5581
WidthType
Definition: qcustomplot.h:3258
QColor textColor() const
Definition: qcustomplot.h:5582
Definition: qcustomplot.h:399
QPoint toPoint() const
Definition: qcustomplot.h:528
0x0002 Grid lines
Definition: qcustomplot.h:129
QBrush brush() const
Definition: qcustomplot.h:7164
QPoint topLeft() const
Definition: qcustomplot.h:5261
bool mOpenGl
Definition: qcustomplot.h:4288
SelectionType
Definition: qcustomplot.h:396
Definition: qcustomplot.h:169
QCPRange valueRange() const
Definition: qcustomplot.h:5962
bool selectable() const
Definition: qcustomplot.h:5344
Definition: qcustomplot.h:1883
Definition: qcustomplot.h:143
QCPColorGradient gradient() const
Definition: qcustomplot.h:5698
int width() const
Definition: qcustomplot.h:5258
Definition: qcustomplot.h:705
0x0004 Sub grid lines
Definition: qcustomplot.h:131
double sortKey() const
Definition: qcustomplot.h:5953
ScaleStrategy
Definition: qcustomplot.h:1949
virtual void wheelEvent(QWheelEvent *event)
QList< QCPLayerable * > children() const
Definition: qcustomplot.h:809
bool operator!=(const QCPColorGradient &other) const
Definition: qcustomplot.h:5059
LineStyle lineStyle() const
Definition: qcustomplot.h:5838
QFont mSelectedFont
Definition: qcustomplot.h:2457
QCPAxisRect * axisRect() const
Definition: qcustomplot.h:2302
QCPItemAnchor * parentAnchor() const
Definition: qcustomplot.h:3907
BracketStyle style() const
Definition: qcustomplot.h:7520
static QCPBarsData fromSortKey(double sortKey)
Definition: qcustomplot.h:6168
TimeUnit
Definition: qcustomplot.h:1891
bool scaled() const
Definition: qcustomplot.h:7331
QSharedPointer< QCPAxisTicker > ticker() const
Definition: qcustomplot.h:2306
bool noAntialiasingOnDrag() const
Definition: qcustomplot.h:4112
TickStepStrategy mTickStepStrategy
Definition: qcustomplot.h:1801
Qt::AspectRatioMode backgroundScaledMode() const
Definition: qcustomplot.h:4099
Definition: qcustomplot.h:1987
virtual int elementCount() const Q_DECL_OVERRIDE
Definition: qcustomplot.h:1579
QString name() const
Definition: qcustomplot.h:3831
virtual void mousePressEvent(QMouseEvent *event, const QVariant &details)
Definition: qcustomplot.h:962
static bool sortKeyIsMainKey()
Definition: qcustomplot.h:5770
QCPScatterStyle scatterStyle() const
Definition: qcustomplot.h:6007
double key() const
Definition: qcustomplot.h:3910
QPen selectedBasePen() const
Definition: qcustomplot.h:2338
Definition: qcustomplot.h:218
QPen zeroLinePen() const
Definition: qcustomplot.h:2144
double mainKey() const
Definition: qcustomplot.h:5772
Definition: qcustomplot.h:4080
QCPBarDataMap * data() const
Definition: qcustomplot.h:3278
virtual void draw(QCPPainter *painter) Q_DECL_OVERRIDE
Definition: qcustomplot.h:1467
double baseValue() const
Definition: qcustomplot.h:6233
Definition: qcustomplot.h:430
void coordsToPixels(double key, double value, double &x, double &y) const
int padding() const
Definition: qcustomplot.h:2330
Qt::TimeSpec mDateTimeSpec
Definition: qcustomplot.h:1860
QPen iconBorderPen() const
Definition: qcustomplot.h:5463
QCPSelectionRect * selectionRect() const
Definition: qcustomplot.h:4120
Definition: qcustomplot.h:3241
QColor textColor() const
Definition: qcustomplot.h:5341
bool mSubTicks
Definition: qcustomplot.h:2454
bool isNull() const
Definition: qcustomplot.h:531
AxisType
Definition: qcustomplot.h:1211
double devicePixelRatio() const
Definition: qcustomplot.h:680
double symbolGap() const
Definition: qcustomplot.h:6842
bool operator!=(const QCPDataRange &other) const
Definition: qcustomplot.h:1066
void setFont(const QFont &font)
QFont tickLabelFont() const
Definition: qcustomplot.h:2310
double stackingGap() const
Definition: qcustomplot.h:6234
Definition: qcustomplot.h:270
QPen selectedIconBorderPen() const
Definition: qcustomplot.h:5467
QCPLayout * layout() const
Definition: qcustomplot.h:1410
bool autoSqueeze() const
Definition: qcustomplot.h:2768
QCPLineEnding tail() const
Definition: qcustomplot.h:6987
double mSymbolGap
Definition: qcustomplot.h:6889
QColor selectedTextColor() const
Definition: qcustomplot.h:5470
QDebug operator<<(QDebug d, const QCPVector2D &vec)
Definition: qcustomplot.h:590
double size() const
Definition: qcustomplot.h:969
QSharedPointer< QCPErrorBarsDataContainer > mDataContainer
Definition: qcustomplot.h:6885
QPixmap background() const
Definition: qcustomplot.h:4097
int levelCount() const
Definition: qcustomplot.h:5064
double mPiTickStep
Definition: qcustomplot.h:2069
virtual QRect clipRect() const
QBrush brush() const
Definition: qcustomplot.h:3725
void add(const QCPDataContainer< DataType > &data)
Definition: qcustomplot.h:3035
int valueSize() const
Definition: qcustomplot.h:6459
QPointF coords() const
Definition: qcustomplot.h:3912
iterator end()
Definition: qcustomplot.h:2792
QCPRange valueRange() const
Definition: qcustomplot.h:6461
Definition: qcustomplot.h:5112
QVector< double > outliers
Definition: qcustomplot.h:6327
QCP::PlottingHints plottingHints() const
Definition: qcustomplot.h:4113
virtual QPointF dataPixelPosition(int index) const Q_DECL_OVERRIDE
Definition: qcustomplot.h:4713
virtual void mousePressEvent(QMouseEvent *event)
Definition: qcustomplot.h:522
Definition: qcustomplot.h:1940
QCPDataSelection selection() const
Definition: qcustomplot.h:3730
bool mOpenGlCacheLabelsBackup
Definition: qcustomplot.h:4302
int begin() const
Definition: qcustomplot.h:1069
Definition: qcustomplot.h:1864
virtual QCPRange getValueRange(bool &foundRange, SignDomain inSignDomain=sdBoth) const =0
QBrush brush() const
Definition: qcustomplot.h:5458
virtual void deselectEvent(bool *selectionStateChanged)
QCPAbstractPlottable1D(QCPAxis *keyAxis, QCPAxis *valueAxis)
Definition: qcustomplot.h:4641
QCP::SelectionType selectable() const
Definition: qcustomplot.h:3728
QColor color() const
Definition: qcustomplot.h:7160
Definition: qcustomplot.h:426
QCP::AntialiasedElements mNotAADragBackup
Definition: qcustomplot.h:2475
SelectablePart
Definition: qcustomplot.h:2529
QCPSelectionDecorator * selectionDecorator() const
Definition: qcustomplot.h:3731
static bool sortKeyIsMainKey()
Definition: qcustomplot.h:6171
double bufferDevicePixelRatio() const
Definition: qcustomplot.h:4096
The plottable is not selectable.
Definition: qcustomplot.h:397
QPen selectedPen() const
Definition: qcustomplot.h:7035
Resolution is given in dots per centimeter (dpcm)
Definition: qcustomplot.h:179
QPoint topRight() const
Definition: qcustomplot.h:5262
ScaleType
Definition: qcustomplot.h:1259
bool antialiasedScatters() const
Definition: qcustomplot.h:3723
bool twoColored() const
Definition: qcustomplot.h:6684
double errorPlus
Definition: qcustomplot.h:6782
bool isValid() const
Definition: qcustomplot.h:1079
QPen selectedPen() const
Definition: qcustomplot.h:7258
QVector< DataType > mData
Definition: qcustomplot.h:2811
bool selected() const
Definition: qcustomplot.h:3968
QBrush selectedBrush() const
Definition: qcustomplot.h:5468
QPen tickPen() const
Definition: qcustomplot.h:2324
double logBase() const
Definition: qcustomplot.h:2096
void setEnd(int end)
Definition: qcustomplot.h:1076
QFont font() const
Definition: qcustomplot.h:5340
SizeConstraintRect
Definition: qcustomplot.h:1398
Definition: qcustomplot.h:2833
QString mTimeFormat
Definition: qcustomplot.h:1917
int selectionTolerance() const
Definition: qcustomplot.h:4111
QHash< TimeUnit, QString > mFormatPattern
Definition: qcustomplot.h:1922
virtual QSize maximumOuterSizeHint() const
int barWidth() const
Definition: qcustomplot.h:5700
QCPAxis * valueAxis() const
Definition: qcustomplot.h:3914
0x02 right margin
Definition: qcustomplot.h:103
FillOrder
Definition: qcustomplot.h:1542
The negative sign domain, i.e. numbers smaller than zero.
Definition: qcustomplot.h:208
const QCPRange operator/(const QCPRange &range, double value)
Definition: qcustomplot.h:720
QCPLayoutInset * insetLayout() const
Definition: qcustomplot.h:5244
QCPRange mDragStartRange
Definition: qcustomplot.h:2474
bool periodicity() const
Definition: qcustomplot.h:2052
QSize size() const
Definition: qcustomplot.h:678
QPointer< QCPLayerable > mMouseEventLayerable
Definition: qcustomplot.h:4294
Definition: qcustomplot.h:3423
int height() const
Definition: qcustomplot.h:5259
QColor selectedLabelColor() const
Definition: qcustomplot.h:2337
QString suffixPart
Definition: qcustomplot.h:2571
QSize minimumSize() const
Definition: qcustomplot.h:1416
Definition: qcustomplot.h:1595
QBrush brush() const
Definition: qcustomplot.h:7434
QPen penNegative() const
Definition: qcustomplot.h:6688
SpacingType
Definition: qcustomplot.h:3170
QCPDataContainer()
Definition: qcustomplot.h:2978
QCPDataRange dataRange(int index=0) const
iterator begin()
Definition: qcustomplot.h:2791
QPen bracketPen() const
Definition: qcustomplot.h:5141
QCPAxis * axis() const
Definition: qcustomplot.h:5694
bool mMouseHasMoved
Definition: qcustomplot.h:4293
QCPDataContainer< QCPBarsData > QCPBarsDataContainer
Definition: qcustomplot.h:6196
const_iterator constBegin() const
Definition: qcustomplot.h:2787
bool tickLabels() const
Definition: qcustomplot.h:2308
FillOrder mFillOrder
Definition: qcustomplot.h:1609
bool antialiased() const
Definition: qcustomplot.h:865
double value
Definition: qcustomplot.h:6181
void drawLine(const QLineF &line)
QSharedPointer< QCPDataContainer< DataType > > mDataContainer
Definition: qcustomplot.h:4415
QPen mPen
Definition: qcustomplot.h:1678
ChartStyle
Definition: qcustomplot.h:3593
PainterMode
Definition: qcustomplot.h:422
QColor textColor() const
Definition: qcustomplot.h:5460
const QMetaObject staticMetaObject
QBrush mBrush
Definition: qcustomplot.h:1306
static Qt::Orientation orientation(AxisType type)
Definition: qcustomplot.h:2414
QString dateTimeFormat() const
Definition: qcustomplot.h:1841
int mSubTickCount
Definition: qcustomplot.h:2011
int right() const
Definition: qcustomplot.h:5255
QPoint center() const
Definition: qcustomplot.h:5265
Definition: qcustomplot.h:200
friend class QCPAxisRect
Definition: qcustomplot.h:590
Definition: qcustomplot.h:6776
QString mText
Definition: qcustomplot.h:5616
SizeConstraintRect mSizeConstraintRect
Definition: qcustomplot.h:1452
LineStyle lineStyle() const
Definition: qcustomplot.h:6009
Definition: qcustomplot.h:1566
PlottingHint
Definition: qcustomplot.h:166
double piValue() const
Definition: qcustomplot.h:2051
Definition: qcustomplot.h:194
FractionStyle mFractionStyle
Definition: qcustomplot.h:2066
double mainKey() const
Definition: qcustomplot.h:6173
MarginSide
Definition: qcustomplot.h:100
QCPAxis::ScaleType dataScaleType() const
Definition: qcustomplot.h:6527
QMargins padding() const
Definition: qcustomplot.h:7172
QPen pen() const
Definition: qcustomplot.h:7162
Definition: qcustomplot.h:3576
double upperQuartile
Definition: qcustomplot.h:6326
void getDataSegments(QList< QCPDataRange > &selectedSegments, QList< QCPDataRange > &unselectedSegments) const
Definition: qcustomplot.h:4902
void setAutoSqueeze(bool enabled)
Definition: qcustomplot.h:2990
QPixmap pixmap() const
Definition: qcustomplot.h:2703
bool periodic() const
Definition: qcustomplot.h:5067
QCPScatterStyle mScatterStyle
Definition: qcustomplot.h:3684
Definition: qcustomplot.h:3473
int fieldWidth(TimeUnit unit) const
Definition: qcustomplot.h:1909
double sortKey() const
Definition: qcustomplot.h:5766
QBrush brushNegative() const
Definition: qcustomplot.h:6686
bool mSelected
Definition: qcustomplot.h:1681
double mWhiskerWidth
Definition: qcustomplot.h:6888
const QCPRange operator-(const QCPRange &range, double value)
Definition: qcustomplot.h:693
QCPColorMapData * data() const
Definition: qcustomplot.h:6525
QBrush selectedBrush() const
Definition: qcustomplot.h:1626
WidthType widthType() const
Definition: qcustomplot.h:6683
BracketStyle bracketStyle() const
Definition: qcustomplot.h:5145
bool rangeReversed() const
Definition: qcustomplot.h:2305
double spacing() const
Definition: qcustomplot.h:6123
QBrush brush() const
Definition: qcustomplot.h:7086
double size() const
Definition: qcustomplot.h:2699
QCPSelectionRect * mSelectionRect
Definition: qcustomplot.h:4287
virtual bool sortKeyIsMainKey() const Q_DECL_OVERRIDE
Definition: qcustomplot.h:4728
LineStyle
Definition: qcustomplot.h:3070
WidthType mWidthType
Definition: qcustomplot.h:6731
QFont font() const
Definition: qcustomplot.h:5459
QMap< double, QColor > colorStops() const
Definition: qcustomplot.h:5065
const QCPRange range() const
Definition: qcustomplot.h:2304
static bool sortKeyIsMainKey()
Definition: qcustomplot.h:6605
QColor tickLabelColor() const
Definition: qcustomplot.h:2311
int mPreallocIteration
Definition: qcustomplot.h:2813
Definition: qcustomplot.h:363
QCPRange dataBounds() const
Definition: qcustomplot.h:6462
Resolution is given in dots per meter (dpm)
Definition: qcustomplot.h:177
QPen subTickPen() const
Definition: qcustomplot.h:2325
double x() const
Definition: qcustomplot.h:516
QFont selectedFont() const
Definition: qcustomplot.h:7167
void limitIteratorsToDataRange(const_iterator &begin, const_iterator &end, const QCPDataRange &dataRange) const
Definition: qcustomplot.h:3560
Definition: qcustomplot.h:6804
double size() const
Definition: qcustomplot.h:7436
void applyDefaultAntialiasingHint(QCPPainter *painter) const
int wrap() const
Definition: qcustomplot.h:1564
double dot(const QCPVector2D &vec) const
Definition: qcustomplot.h:535
Interaction
Definition: qcustomplot.h:195
int mBracketWidth
Definition: qcustomplot.h:5169
QString text() const
Definition: qcustomplot.h:5579
QPen mSelectedPen
Definition: qcustomplot.h:1678
int end() const
Definition: qcustomplot.h:1070
int textFlags() const
Definition: qcustomplot.h:5580
bool isEmpty() const
Definition: qcustomplot.h:6133