11 #include <QtCore/qglobal.h>
15 #ifdef QCUSTOMPLOT_USE_OPENGL
16 #if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
17 #define QCP_OPENGL_PBUFFER
19 #define QCP_OPENGL_FBO
21 #if QT_VERSION >= QT_VERSION_CHECK(5, 3, 0)
22 #define QCP_OPENGL_OFFSCREENSURFACE
26 #if QT_VERSION >= QT_VERSION_CHECK(5, 4, 0)
27 #define QCP_DEVICEPIXELRATIO_SUPPORTED
28 #if QT_VERSION >= QT_VERSION_CHECK(5, 6, 0)
29 #define QCP_DEVICEPIXELRATIO_FLOAT
35 #include <QtCore/QCache>
36 #include <QtCore/QDateTime>
37 #include <QtCore/QDebug>
38 #include <QtCore/QFlags>
39 #include <QtCore/QMargins>
40 #include <QtCore/QMultiMap>
41 #include <QtCore/QObject>
42 #include <QtCore/QPointer>
43 #include <QtCore/QSharedPointer>
44 #include <QtCore/QStack>
45 #include <QtCore/QString>
46 #include <QtCore/QTimer>
47 #include <QtCore/QVector>
48 #include <QtGui/QMouseEvent>
49 #include <QtGui/QPaintEvent>
50 #include <QtGui/QPainter>
51 #include <QtGui/QPixmap>
52 #include <QtGui/QWheelEvent>
56 #include <QtGui/QOpenGLContext>
57 #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
58 #include <QtGui/QOpenGLFramebufferObject>
60 #include <QOpenGLFramebufferObject>
61 #include <QOpenGLPaintDevice>
63 #ifdef QCP_OPENGL_OFFSCREENSURFACE
64 #include <QtGui/QOffscreenSurface>
66 #include <QtGui/QWindow>
69 #ifdef QCP_OPENGL_PBUFFER
70 #include <QtOpenGL/QGLPixelBuffer>
72 #if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
75 #include <QtGui/QPrintEngine>
76 #include <QtGui/QPrinter>
77 #include <QtGui/QWidget>
80 #include <QtPrintSupport/QtPrintSupport>
81 #include <QtWidgets/QWidget>
83 #if QT_VERSION >= QT_VERSION_CHECK(4, 8, 0)
84 #include <QtCore/QElapsedTimer>
86 #if QT_VERSION >= QT_VERSION_CHECK(5, 2, 0)
87 #include <QtCore/QTimeZone>
97 class QCPAxisPainterPrivate;
114 #define QCUSTOMPLOT_VERSION_STR "2.0.1"
115 #define QCUSTOMPLOT_VERSION 0x020001
118 #if defined(QT_STATIC_BUILD)
120 #elif defined(QCUSTOMPLOT_COMPILE_LIBRARY)
121 #define QCP_LIB_DECL Q_DECL_EXPORT
122 #elif defined(QCUSTOMPLOT_USE_LIBRARY)
123 #define QCP_LIB_DECL Q_DECL_IMPORT
129 #ifndef Q_DECL_OVERRIDE
130 #define Q_DECL_OVERRIDE
142 #if QT_VERSION >= 0x060200
163 Q_FLAGS(AntialiasedElements)
164 Q_FLAGS(PlottingHints)
166 Q_FLAGS(Interactions)
426 return qIsNaN(value) || qIsInf(value);
447 margins.setLeft(value);
450 margins.setRight(value);
453 margins.setTop(value);
456 margins.setBottom(value);
459 margins = QMargins(value, value, value, value);
476 return margins.left();
478 return margins.right();
480 return margins.top();
482 return margins.bottom();
493 #if QT_VERSION >= 0x060200
504 Q_FLAG_NS(AntialiasedElements)
505 Q_FLAG_NS(PlottingHints)
506 Q_FLAG_NS(MarginSides)
507 Q_FLAG_NS(Interactions)
509 extern const QMetaObject
526 #if QT_VERSION < QT_VERSION_CHECK(6, 2, 0)
551 double x()
const {
return mX; }
552 double y()
const {
return mY; }
553 double &
rx() {
return mX; }
554 double &
ry() {
return mY; }
561 double length()
const {
return qSqrt(mX * mX + mY * mY); }
563 QPoint
toPoint()
const {
return QPoint(mX, mY); }
564 QPointF
toPointF()
const {
return QPointF(mX, mY); }
566 bool isNull()
const {
return qIsNull(mX) && qIsNull(mY); }
571 return mX * vec.mX + mY * vec.mY;
573 double distanceSquaredToLine(
const QCPVector2D &start,
575 double distanceSquaredToLine(
const QLineF &line)
const;
576 double distanceToStraightLine(
const QCPVector2D &base,
603 return QCPVector2D(vec.mX * factor, vec.mY * factor);
606 return QCPVector2D(vec.mX * factor, vec.mY * factor);
609 return QCPVector2D(vec.mX / divisor, vec.mY / divisor);
613 return QCPVector2D(vec1.mX + vec2.mX, vec1.mY + vec2.mY);
617 return QCPVector2D(vec1.mX - vec2.mX, vec1.mY - vec2.mY);
628 d.nospace() <<
"QCPVector2D(" << vec.
x() <<
", " << vec.
y() <<
")";
663 Q_FLAGS(PainterModes)
664 Q_DECLARE_FLAGS(PainterModes, PainterMode)
670 bool antialiasing()
const {
return testRenderHint(QPainter::Antialiasing); }
671 PainterModes
modes()
const {
return mModes; }
674 void setAntialiasing(
bool enabled);
675 void setMode(PainterMode mode,
bool enabled =
true);
680 bool begin(QPaintDevice *device);
681 void setPen(
const QPen &pen);
682 void setPen(
const QColor &
color);
683 void setPen(Qt::PenStyle penStyle);
684 void drawLine(
const QLineF &line);
685 void drawLine(
const QPointF &p1,
const QPointF &p2) {
686 drawLine(QLineF(p1, p2));
692 void makeNonCosmetic();
716 QSize
size()
const {
return mSize; }
721 void setSize(
const QSize &
size);
722 void setInvalidated(
bool invalidated =
true);
723 void setDevicePixelRatio(
double ratio);
761 #ifdef QCP_OPENGL_PBUFFER
764 explicit QCPPaintBufferGlPbuffer(
const QSize &
size,
765 double devicePixelRatio,
767 virtual ~QCPPaintBufferGlPbuffer();
776 QGLPixelBuffer *mGlPBuffer;
784 #ifdef QCP_OPENGL_FBO
787 explicit QCPPaintBufferGlFbo(
789 double devicePixelRatio,
790 QWeakPointer<QOpenGLContext> glContext,
791 QWeakPointer<QOpenGLPaintDevice> glPaintDevice);
792 virtual ~QCPPaintBufferGlFbo();
802 QWeakPointer<QOpenGLContext> mGlContext;
803 QWeakPointer<QOpenGLPaintDevice> mGlPaintDevice;
804 QOpenGLFramebufferObject *mGlFrameBuffer;
819 Q_PROPERTY(
QCustomPlot *parentPlot READ parentPlot)
821 Q_PROPERTY(
int index READ index)
822 Q_PROPERTY(QList<QCPLayerable *> children READ children)
823 Q_PROPERTY(
bool visible READ visible WRITE setVisible)
824 Q_PROPERTY(
LayerMode mode READ mode WRITE setMode)
848 QString
name()
const {
return mName; }
849 int index()
const {
return mIndex; }
850 QList<QCPLayerable *>
children()
const {
return mChildren; }
855 void setVisible(
bool visible);
856 void setMode(LayerMode mode);
875 void drawToPaintBuffer();
890 Q_PROPERTY(
bool visible READ visible WRITE setVisible)
891 Q_PROPERTY(
QCustomPlot *parentPlot READ parentPlot)
892 Q_PROPERTY(
QCPLayerable *parentLayerable READ parentLayerable)
893 Q_PROPERTY(
QCPLayer *layer READ layer WRITE setLayer NOTIFY layerChanged)
894 Q_PROPERTY(
bool antialiased READ antialiased WRITE setAntialiased)
898 QString targetLayer = QString(),
910 void setVisible(
bool on);
911 Q_SLOT
bool setLayer(
QCPLayer *layer);
912 bool setLayer(
const QString &layerName);
913 void setAntialiased(
bool enabled);
916 virtual double selectTest(
const QPointF &pos,
918 QVariant *details = 0)
const;
921 bool realVisibility()
const;
935 virtual void parentPlotInitialized(
QCustomPlot *parentPlot);
937 virtual QRect clipRect()
const;
941 virtual void selectEvent(QMouseEvent *
event,
943 const QVariant &details,
944 bool *selectionStateChanged);
945 virtual void deselectEvent(
bool *selectionStateChanged);
947 virtual void mousePressEvent(QMouseEvent *
event,
const QVariant &details);
948 virtual void mouseMoveEvent(QMouseEvent *
event,
const QPointF &startPos);
949 virtual void mouseReleaseEvent(QMouseEvent *
event,
const QPointF &startPos);
950 virtual void mouseDoubleClickEvent(QMouseEvent *
event,
951 const QVariant &details);
952 virtual void wheelEvent(QWheelEvent *
event);
955 void initializeParentPlot(
QCustomPlot *parentPlot);
957 bool moveToLayer(
QCPLayer *layer,
bool prepend);
958 void applyAntialiasingHint(
QCPPainter *painter,
959 bool localAntialiased,
980 QCPRange(
double lower,
double upper);
983 return lower == other.
lower && upper == other.
upper;
1014 double size()
const {
return upper - lower; }
1015 double center()
const {
return (upper + lower) * 0.5; }
1017 if (lower > upper) qSwap(lower, upper);
1019 void expand(
const QCPRange &otherRange);
1020 void expand(
double includeCoord);
1022 QCPRange expanded(
double includeCoord)
const;
1023 QCPRange bounded(
double lowerBound,
double upperBound)
const;
1024 QCPRange sanitizedForLogScale()
const;
1025 QCPRange sanitizedForLinScale()
const;
1027 return value >= lower && value <= upper;
1030 static bool validRange(
double lower,
double upper);
1031 static bool validRange(
const QCPRange &range);
1042 d.nospace() <<
"QCPRange(" << range.
lower <<
", " << range.
upper <<
")";
1111 return mBegin == other.mBegin && mEnd == other.mEnd;
1114 return !(*
this == other);
1119 int end()
const {
return mEnd; }
1120 int size()
const {
return mEnd - mBegin; }
1128 bool isValid()
const {
return (mEnd >= mBegin) && (mBegin >= 0); }
1134 return QCPDataRange(mBegin + changeBegin, mEnd + changeEnd);
1152 return !(*
this == other);
1177 int dataPointCount()
const;
1183 void addDataRange(
const QCPDataRange &dataRange,
bool simplify =
true);
1185 bool isEmpty()
const {
return mDataRanges.isEmpty(); }
1195 QList<QCPDataRange> mDataRanges;
1197 inline static bool lessThanDataRangeBegin(
const QCPDataRange &
a,
1199 return a.begin() < b.
begin();
1301 d.nospace() <<
"QCPDataRange(" << dataRange.
begin() <<
", "
1302 << dataRange.
end() <<
")";
1311 d.nospace() <<
"QCPDataSelection(";
1313 if (i != 0) d <<
", ";
1332 QRect
rect()
const {
return mRect; }
1334 QPen
pen()
const {
return mPen; }
1339 void setPen(
const QPen &pen);
1340 void setBrush(
const QBrush &brush);
1343 Q_SLOT
void cancel();
1360 virtual void startSelection(QMouseEvent *
event);
1361 virtual void moveSelection(QMouseEvent *
event);
1362 virtual void endSelection(QMouseEvent *
event);
1363 virtual void keyPressEvent(QKeyEvent *
event);
1366 virtual void applyDefaultAntialiasingHint(
QCPPainter *painter)
const
1386 return mChildren.value(side);
1388 bool isEmpty()
const;
1394 QHash<QCP::MarginSide, QList<QCPLayoutElement *>>
mChildren;
1412 Q_PROPERTY(
QCPLayout *layout READ layout)
1413 Q_PROPERTY(QRect rect READ rect)
1414 Q_PROPERTY(QRect outerRect READ outerRect WRITE setOuterRect)
1415 Q_PROPERTY(QMargins margins READ margins WRITE setMargins)
1417 QMargins minimumMargins READ minimumMargins WRITE setMinimumMargins)
1418 Q_PROPERTY(QSize minimumSize READ minimumSize WRITE setMinimumSize)
1419 Q_PROPERTY(QSize maximumSize READ maximumSize WRITE setMaximumSize)
1421 WRITE setSizeConstraintRect)
1438 Q_ENUMS(UpdatePhase)
1454 Q_ENUMS(SizeConstraintRect)
1461 QRect
rect()
const {
return mRect; }
1469 return mSizeConstraintRect;
1475 return mMarginGroups;
1479 void setOuterRect(
const QRect &rect);
1480 void setMargins(
const QMargins &margins);
1481 void setMinimumMargins(
const QMargins &margins);
1482 void setAutoMargins(QCP::MarginSides sides);
1483 void setMinimumSize(
const QSize &
size);
1485 void setMaximumSize(
const QSize &
size);
1487 void setSizeConstraintRect(SizeConstraintRect constraintRect);
1488 void setMarginGroup(QCP::MarginSides sides,
QCPMarginGroup *group);
1491 virtual void update(UpdatePhase phase);
1492 virtual QSize minimumOuterSizeHint()
const;
1493 virtual QSize maximumOuterSizeHint()
const;
1494 virtual QList<QCPLayoutElement *> elements(
bool recursive)
const;
1497 virtual double selectTest(
const QPointF &pos,
1498 bool onlySelectable,
1504 QSize mMinimumSize, mMaximumSize;
1506 QRect mRect, mOuterRect;
1507 QMargins mMargins, mMinimumMargins;
1508 QCP::MarginSides mAutoMargins;
1513 virtual
void layoutChanged();
1516 virtual
void applyDefaultAntialiasingHint(
QCPPainter *painter) const
1539 virtual QList<QCPLayoutElement *> elements(
bool recursive)
const
1547 virtual void simplify();
1550 bool removeAt(
int index);
1556 virtual void updateLayout();
1559 void sizeConstraintsChanged()
const;
1562 QVector<int> getSectionSizes(QVector<int> maxSizes,
1563 QVector<int> minSizes,
1564 QVector<double> stretchFactors,
1565 int totalSize)
const;
1577 Q_PROPERTY(
int rowCount READ rowCount)
1579 Q_PROPERTY(QList<double> columnStretchFactors READ columnStretchFactors
1580 WRITE setColumnStretchFactors)
1581 Q_PROPERTY(QList<double> rowStretchFactors READ rowStretchFactors WRITE
1582 setRowStretchFactors)
1583 Q_PROPERTY(
int columnSpacing READ columnSpacing WRITE setColumnSpacing)
1584 Q_PROPERTY(
int rowSpacing READ rowSpacing WRITE setRowSpacing)
1585 Q_PROPERTY(
FillOrder fillOrder READ fillOrder WRITE setFillOrder)
1586 Q_PROPERTY(
int wrap READ wrap WRITE setWrap)
1613 return mElements.size() > 0 ? mElements.first().size() : 0;
1623 void setColumnStretchFactor(
int column,
double factor);
1624 void setColumnStretchFactors(
const QList<double> &factors);
1625 void setRowStretchFactor(
int row,
double factor);
1626 void setRowStretchFactors(
const QList<double> &factors);
1627 void setColumnSpacing(
int pixels);
1628 void setRowSpacing(
int pixels);
1629 void setWrap(
int count);
1630 void setFillOrder(FillOrder order,
bool rearrange =
true);
1640 virtual QList<QCPLayoutElement *> elements(
bool recursive)
const
1650 bool hasElement(
int row,
int column);
1651 void expandTo(
int newRowCount,
int newColumnCount);
1652 void insertRow(
int newIndex);
1653 void insertColumn(
int newIndex);
1654 int rowColToIndex(
int row,
int column) const;
1655 void indexToRowCol(
int index,
int &row,
int &column) const;
1660 QList<
double> mColumnStretchFactors;
1661 QList<
double> mRowStretchFactors;
1662 int mColumnSpacing, mRowSpacing;
1667 void getMinimumRowColSizes(QVector<
int> *minColWidths,
1668 QVector<
int> *minRowHeights) const;
1669 void getMaximumRowColSizes(QVector<
int> *maxColWidths,
1670 QVector<
int> *maxRowHeights) const;
1691 Q_ENUMS(InsetPlacement)
1697 InsetPlacement insetPlacement(
int index)
const;
1699 QRectF insetRect(
int index)
const;
1702 void setInsetPlacement(
int index, InsetPlacement placement);
1704 void setInsetRect(
int index,
const QRectF &rect);
1713 virtual double selectTest(
const QPointF &pos,
1714 bool onlySelectable,
1726 QList<QRectF> mInsetRect;
1779 Q_ENUMS(EndingStyle)
1785 bool inverted =
false);
1794 void setStyle(EndingStyle style);
1795 void setWidth(
double width);
1796 void setLength(
double length);
1797 void setInverted(
bool inverted);
1800 double boundingDistance()
const;
1801 double realLength()
const;
1839 Q_ENUMS(TickStepStrategy)
1850 void setTickStepStrategy(TickStepStrategy strategy);
1851 void setTickCount(
int count);
1852 void setTickOrigin(
double origin);
1855 virtual void generate(
const QCPRange &range,
1856 const QLocale &locale,
1859 QVector<double> &ticks,
1860 QVector<double> *subTicks,
1861 QVector<QString> *tickLabels);
1870 virtual double getTickStep(
const QCPRange &range);
1871 virtual int getSubTickCount(
double tickStep);
1872 virtual QString getTickLabel(
double tick,
1873 const QLocale &locale,
1876 virtual QVector<double> createTickVector(
double tickStep,
1878 virtual QVector<double> createSubTickVector(
int subTickCount,
1879 const QVector<double> &ticks);
1880 virtual QVector<QString> createLabelVector(
const QVector<double> &ticks,
1881 const QLocale &locale,
1886 void trimTicks(
const QCPRange &range,
1887 QVector<double> &ticks,
1888 bool keepOneOutlier)
const;
1889 double pickClosest(
double target,
const QVector<double> &candidates)
const;
1890 double getMantissa(
double input,
double *magnitude = 0)
const;
1891 double cleanMantissa(
double input)
const;
1913 void setDateTimeFormat(
const QString &
format);
1914 void setDateTimeSpec(Qt::TimeSpec spec);
1915 void setTickOrigin(
double origin);
1918 void setTickOrigin(
const QDateTime &
origin);
1921 static QDateTime keyToDateTime(
double key);
1922 static double dateTimeToKey(
const QDateTime dateTime);
1923 static double dateTimeToKey(
const QDate date);
1940 virtual QString getTickLabel(
double tick,
1941 const QLocale &locale,
1944 virtual QVector<double> createTickVector(
1983 void setTimeFormat(
const QString &
format);
1984 void setFieldWidth(TimeUnit unit,
int width);
1998 virtual QString getTickLabel(
double tick,
1999 const QLocale &locale,
2004 void replaceUnit(QString &text,
TimeUnit unit,
int value)
const;
2034 Q_ENUMS(ScaleStrategy)
2043 void setTickStep(
double step);
2044 void setScaleStrategy(ScaleStrategy strategy);
2066 QMap<double, QString> &
ticks() {
return mTicks; }
2070 void setTicks(
const QMap<double, QString> &ticks);
2071 void setTicks(
const QVector<double> &positions,
2072 const QVector<QString> &labels);
2073 void setSubTickCount(
int subTicks);
2077 void addTick(
double position,
const QString &label);
2078 void addTicks(
const QMap<double, QString> &ticks);
2079 void addTicks(
const QVector<double> &positions,
2080 const QVector<QString> &labels);
2090 virtual QString getTickLabel(
double tick,
2091 const QLocale &locale,
2094 virtual QVector<double> createTickVector(
2122 Q_ENUMS(FractionStyle)
2133 void setPiSymbol(QString symbol);
2134 void setPiValue(
double pi);
2135 void setPeriodicity(
int multiplesOfPi);
2136 void setFractionStyle(FractionStyle style);
2151 virtual QString getTickLabel(
double tick,
2152 const QLocale &locale,
2157 void simplifyFraction(
int &numerator,
int &denominator)
const;
2158 QString fractionToString(
int numerator,
int denominator)
const;
2159 QString unicodeFraction(
int numerator,
int denominator)
const;
2160 QString unicodeSuperscript(
int number)
const;
2161 QString unicodeSubscript(
int number)
const;
2179 void setLogBase(
double base);
2180 void setSubTickCount(
int subTicks);
2193 virtual QVector<double> createTickVector(
2205 Q_PROPERTY(
bool subGridVisible READ subGridVisible WRITE setSubGridVisible)
2206 Q_PROPERTY(
bool antialiasedSubGrid READ antialiasedSubGrid WRITE
2207 setAntialiasedSubGrid)
2208 Q_PROPERTY(
bool antialiasedZeroLine READ antialiasedZeroLine WRITE
2209 setAntialiasedZeroLine)
2210 Q_PROPERTY(QPen pen READ pen WRITE setPen)
2211 Q_PROPERTY(QPen subGridPen READ subGridPen WRITE setSubGridPen)
2212 Q_PROPERTY(QPen zeroLinePen READ zeroLinePen WRITE setZeroLinePen)
2221 QPen
pen()
const {
return mPen; }
2226 void setSubGridVisible(
bool visible);
2227 void setAntialiasedSubGrid(
bool enabled);
2228 void setAntialiasedZeroLine(
bool enabled);
2229 void setPen(
const QPen &pen);
2230 void setSubGridPen(
const QPen &pen);
2231 void setZeroLinePen(
const QPen &pen);
2237 QPen
mPen, mSubGridPen, mZeroLinePen;
2243 virtual void applyDefaultAntialiasingHint(
QCPPainter *painter)
const
2248 void drawGridLines(
QCPPainter *painter)
const;
2249 void drawSubGridLines(
QCPPainter *painter)
const;
2257 Q_PROPERTY(
AxisType axisType READ axisType)
2259 Q_PROPERTY(
ScaleType scaleType READ scaleType WRITE setScaleType NOTIFY
2261 Q_PROPERTY(
QCPRange range READ range WRITE setRange NOTIFY rangeChanged)
2262 Q_PROPERTY(
bool rangeReversed READ rangeReversed WRITE setRangeReversed)
2263 Q_PROPERTY(QSharedPointer<QCPAxisTicker> ticker READ ticker WRITE setTicker)
2264 Q_PROPERTY(
bool ticks READ ticks WRITE setTicks)
2265 Q_PROPERTY(
bool tickLabels READ tickLabels WRITE setTickLabels)
2266 Q_PROPERTY(
int tickLabelPadding READ tickLabelPadding WRITE
2267 setTickLabelPadding)
2268 Q_PROPERTY(QFont tickLabelFont READ tickLabelFont WRITE setTickLabelFont)
2270 QColor tickLabelColor READ tickLabelColor WRITE setTickLabelColor)
2271 Q_PROPERTY(
double tickLabelRotation READ tickLabelRotation WRITE
2272 setTickLabelRotation)
2274 LabelSide tickLabelSide READ tickLabelSide WRITE setTickLabelSide)
2275 Q_PROPERTY(QString numberFormat READ numberFormat WRITE setNumberFormat)
2277 int numberPrecision READ numberPrecision WRITE setNumberPrecision)
2278 Q_PROPERTY(QVector<double> tickVector READ tickVector)
2279 Q_PROPERTY(QVector<QString> tickVectorLabels READ tickVectorLabels)
2280 Q_PROPERTY(
int tickLengthIn READ tickLengthIn WRITE setTickLengthIn)
2281 Q_PROPERTY(
int tickLengthOut READ tickLengthOut WRITE setTickLengthOut)
2282 Q_PROPERTY(
bool subTicks READ subTicks WRITE setSubTicks)
2284 int subTickLengthIn READ subTickLengthIn WRITE setSubTickLengthIn)
2285 Q_PROPERTY(
int subTickLengthOut READ subTickLengthOut WRITE
2286 setSubTickLengthOut)
2287 Q_PROPERTY(QPen basePen READ basePen WRITE setBasePen)
2288 Q_PROPERTY(QPen tickPen READ tickPen WRITE setTickPen)
2289 Q_PROPERTY(QPen subTickPen READ subTickPen WRITE setSubTickPen)
2290 Q_PROPERTY(QFont labelFont READ labelFont WRITE setLabelFont)
2291 Q_PROPERTY(QColor labelColor READ labelColor WRITE setLabelColor)
2292 Q_PROPERTY(QString label READ label WRITE setLabel)
2293 Q_PROPERTY(
int labelPadding READ labelPadding WRITE setLabelPadding)
2294 Q_PROPERTY(
int padding READ padding WRITE setPadding)
2296 Q_PROPERTY(SelectableParts selectedParts READ selectedParts WRITE
2297 setSelectedParts NOTIFY selectionChanged)
2298 Q_PROPERTY(SelectableParts selectableParts READ selectableParts WRITE
2299 setSelectableParts NOTIFY selectableChanged)
2300 Q_PROPERTY(QFont selectedTickLabelFont READ selectedTickLabelFont WRITE
2301 setSelectedTickLabelFont)
2302 Q_PROPERTY(QFont selectedLabelFont READ selectedLabelFont WRITE
2303 setSelectedLabelFont)
2304 Q_PROPERTY(QColor selectedTickLabelColor READ selectedTickLabelColor WRITE
2305 setSelectedTickLabelColor)
2306 Q_PROPERTY(QColor selectedLabelColor READ selectedLabelColor WRITE
2307 setSelectedLabelColor)
2309 QPen selectedBasePen READ selectedBasePen WRITE setSelectedBasePen)
2311 QPen selectedTickPen READ selectedTickPen WRITE setSelectedTickPen)
2312 Q_PROPERTY(QPen selectedSubTickPen READ selectedSubTickPen WRITE
2313 setSelectedSubTickPen)
2314 Q_PROPERTY(
QCPLineEnding lowerEnding READ lowerEnding WRITE setLowerEnding)
2315 Q_PROPERTY(
QCPLineEnding upperEnding READ upperEnding WRITE setUpperEnding)
2316 Q_PROPERTY(
QCPGrid *grid READ grid)
2339 Q_DECLARE_FLAGS(AxisTypes, AxisType)
2373 spTickLabels = 0x002
2378 Q_ENUMS(SelectablePart)
2379 Q_FLAGS(SelectableParts)
2380 Q_DECLARE_FLAGS(SelectableParts, SelectablePart)
2391 QSharedPointer<QCPAxisTicker>
ticker()
const {
return mTicker; }
2394 int tickLabelPadding()
const;
2397 double tickLabelRotation()
const;
2398 LabelSide tickLabelSide()
const;
2399 QString numberFormat()
const;
2403 int tickLengthIn()
const;
2404 int tickLengthOut()
const;
2406 int subTickLengthIn()
const;
2407 int subTickLengthOut()
const;
2413 QString
label()
const {
return mLabel; }
2414 int labelPadding()
const;
2432 Q_SLOT
void setRange(
const QCPRange &range);
2433 void setRange(
double lower,
double upper);
2434 void setRange(
double position,
double size, Qt::AlignmentFlag alignment);
2435 void setRangeLower(
double lower);
2436 void setRangeUpper(
double upper);
2437 void setRangeReversed(
bool reversed);
2438 void setTicker(QSharedPointer<QCPAxisTicker> ticker);
2439 void setTicks(
bool show);
2440 void setTickLabels(
bool show);
2441 void setTickLabelPadding(
int padding);
2442 void setTickLabelFont(
const QFont &font);
2443 void setTickLabelColor(
const QColor &
color);
2444 void setTickLabelRotation(
double degrees);
2445 void setTickLabelSide(LabelSide side);
2446 void setNumberFormat(
const QString &formatCode);
2447 void setNumberPrecision(
int precision);
2448 void setTickLength(
int inside,
int outside = 0);
2449 void setTickLengthIn(
int inside);
2450 void setTickLengthOut(
int outside);
2451 void setSubTicks(
bool show);
2452 void setSubTickLength(
int inside,
int outside = 0);
2453 void setSubTickLengthIn(
int inside);
2454 void setSubTickLengthOut(
int outside);
2455 void setBasePen(
const QPen &pen);
2456 void setTickPen(
const QPen &pen);
2457 void setSubTickPen(
const QPen &pen);
2458 void setLabelFont(
const QFont &font);
2459 void setLabelColor(
const QColor &
color);
2460 void setLabel(
const QString &str);
2461 void setLabelPadding(
int padding);
2462 void setPadding(
int padding);
2463 void setOffset(
int offset);
2464 void setSelectedTickLabelFont(
const QFont &font);
2465 void setSelectedLabelFont(
const QFont &font);
2466 void setSelectedTickLabelColor(
const QColor &
color);
2467 void setSelectedLabelColor(
const QColor &
color);
2468 void setSelectedBasePen(
const QPen &pen);
2469 void setSelectedTickPen(
const QPen &pen);
2470 void setSelectedSubTickPen(
const QPen &pen);
2472 const QCPAxis::SelectableParts &selectableParts);
2478 virtual double selectTest(
const QPointF &pos,
2479 bool onlySelectable,
2483 Qt::Orientation orientation()
const {
return mOrientation; }
2485 return rangeReversed() != (orientation() == Qt::Vertical) ? -1 : 1;
2487 void moveRange(
double diff);
2488 void scaleRange(
double factor);
2489 void scaleRange(
double factor,
double center);
2490 void setScaleRatio(
const QCPAxis *otherAxis,
double ratio = 1.0);
2491 void rescale(
bool onlyVisiblePlottables =
false);
2492 double pixelToCoord(
double value)
const;
2493 double coordToPixel(
double value)
const;
2494 SelectablePart getPartAt(
const QPointF &pos)
const;
2495 QList<QCPAbstractPlottable *> plottables()
const;
2496 QList<QCPGraph *> graphs()
const;
2497 QList<QCPAbstractItem *> items()
const;
2501 return type == atBottom ||
type == atTop ? Qt::Horizontal
2504 static AxisType opposite(AxisType
type);
2565 virtual int calculateMargin();
2568 virtual void applyDefaultAntialiasingHint(
QCPPainter *painter)
const
2573 virtual
void selectEvent(QMouseEvent *
event,
2575 const QVariant &details,
2577 virtual
void deselectEvent(
bool *selectionStateChanged)
Q_DECL_OVERRIDE;
2579 virtual
void mousePressEvent(QMouseEvent *
event,
2581 virtual
void mouseMoveEvent(QMouseEvent *
event,
2583 virtual
void mouseReleaseEvent(QMouseEvent *
event,
2588 void setupTickVectors();
2589 QPen getBasePen() const;
2590 QPen getTickPen() const;
2591 QPen getSubTickPen() const;
2592 QFont getTickLabelFont() const;
2593 QFont getLabelFont() const;
2594 QColor getTickLabelColor() const;
2595 QColor getLabelColor() const;
2611 class QCPAxisPainterPrivate {
2613 explicit QCPAxisPainterPrivate(
QCustomPlot *parentPlot);
2614 virtual ~QCPAxisPainterPrivate();
2617 virtual int size()
const;
2620 QRect axisSelectionBox()
const {
return mAxisSelectionBox; }
2621 QRect tickLabelsSelectionBox()
const {
return mTickLabelsSelectionBox; }
2622 QRect labelSelectionBox()
const {
return mLabelSelectionBox; }
2633 int tickLabelPadding;
2634 double tickLabelRotation;
2637 bool substituteExponent;
2638 bool numberMultiplyCross;
2639 int tickLengthIn, tickLengthOut, subTickLengthIn,
2641 QPen tickPen, subTickPen;
2642 QFont tickLabelFont;
2643 QColor tickLabelColor;
2644 QRect axisRect, viewportRect;
2646 bool abbreviateDecimalPowers;
2647 bool reversedEndings;
2649 QVector<double> subTickPositions;
2650 QVector<double> tickPositions;
2651 QVector<QString> tickLabels;
2654 struct CachedLabel {
2658 struct TickLabelData {
2659 QString basePart, expPart, suffixPart;
2660 QRect baseBounds, expBounds, suffixBounds, totalBounds,
2662 QFont baseFont, expFont;
2665 QByteArray mLabelParameterHash;
2667 QCache<QString, CachedLabel> mLabelCache;
2668 QRect mAxisSelectionBox, mTickLabelsSelectionBox, mLabelSelectionBox;
2670 virtual QByteArray generateLabelParameterHash()
const;
2672 virtual void placeTickLabel(
QCPPainter *painter,
2675 const QString &text,
2676 QSize *tickLabelsSize);
2677 virtual void drawTickLabel(
QCPPainter *painter,
2680 const TickLabelData &labelData)
const;
2681 virtual TickLabelData getTickLabelData(
const QFont &font,
2682 const QString &text)
const;
2683 virtual QPointF getTickLabelDrawOffset(
2684 const TickLabelData &labelData)
const;
2685 virtual void getMaxTickLabelSize(
const QFont &font,
2686 const QString &text,
2687 QSize *tickLabelsSize)
const;
2720 Q_ENUMS(ScatterProperty)
2721 Q_FLAGS(ScatterProperties)
2722 Q_DECLARE_FLAGS(ScatterProperties, ScatterProperty)
2783 Q_ENUMS(ScatterShape)
2789 const QColor &
color,
2794 const QBrush &brush,
2799 const QBrush &brush = Qt::NoBrush,
2803 double size()
const {
return mSize; }
2805 QPen
pen()
const {
return mPen; }
2812 ScatterProperties properties);
2813 void setSize(
double size);
2814 void setShape(ScatterShape shape);
2815 void setPen(
const QPen &pen);
2816 void setBrush(
const QBrush &brush);
2817 void setPixmap(
const QPixmap &pixmap);
2818 void setCustomPath(
const QPainterPath &customPath);
2821 bool isNone()
const {
return mShape == ssNone; }
2824 void applyTo(
QCPPainter *painter,
const QPen &defaultPen)
const;
2825 void drawShape(
QCPPainter *painter,
const QPointF &pos)
const;
2826 void drawShape(
QCPPainter *painter,
double x,
double y)
const;
2855 template <
class DataType>
2857 return a.sortKey() < b.sortKey();
2860 template <
class DataType>
2871 int size()
const {
return mData.size() - mPreallocSize; }
2876 void setAutoSqueeze(
bool enabled);
2880 void set(
const QVector<DataType> &
data,
bool alreadySorted =
false);
2882 void add(
const QVector<DataType> &
data,
bool alreadySorted =
false);
2883 void add(
const DataType &
data);
2884 void removeBefore(
double sortKey);
2885 void removeAfter(
double sortKey);
2886 void remove(
double sortKeyFrom,
double sortKeyTo);
2887 void remove(
double sortKey);
2890 void squeeze(
bool preAllocation =
true,
bool postAllocation =
true);
2893 return mData.constBegin() + mPreallocSize;
2898 const_iterator findBegin(
double sortKey,
bool expandedRange =
true)
const;
2899 const_iterator findEnd(
double sortKey,
bool expandedRange =
true)
const;
2901 return constBegin() + qBound(0, index,
size());
2903 QCPRange keyRange(
bool &foundRange,
2905 QCPRange valueRange(
bool &foundRange,
2909 void limitIteratorsToDataRange(const_iterator &begin,
2910 const_iterator &end,
2923 void preallocateGrow(
int minimumPreallocSize);
2924 void performAutoSqueeze();
3084 template <
class DataType>
3086 : mAutoSqueeze(true), mPreallocSize(0), mPreallocIteration(0) {}
3096 template <
class DataType>
3098 if (mAutoSqueeze != enabled) {
3099 mAutoSqueeze = enabled;
3100 if (mAutoSqueeze) performAutoSqueeze();
3110 template <
class DataType>
3126 template <
class DataType>
3128 bool alreadySorted) {
3131 mPreallocIteration = 0;
3132 if (!alreadySorted) sort();
3141 template <
class DataType>
3143 if (
data.isEmpty())
return;
3145 const int n =
data.size();
3146 const int oldSize =
size();
3149 !qcpLessThanSortKey<DataType>(
3150 *constBegin(), *(
data.constEnd() -
3154 if (mPreallocSize < n) preallocateGrow(n);
3159 mData.resize(mData.size() + n);
3162 !qcpLessThanSortKey<DataType>(
3163 *(constEnd() - n - 1),
3167 std::inplace_merge(begin(), end() - n, end(),
3168 qcpLessThanSortKey<DataType>);
3181 template <
class DataType>
3183 bool alreadySorted) {
3184 if (
data.isEmpty())
return;
3186 set(
data, alreadySorted);
3190 const int n =
data.size();
3191 const int oldSize =
size();
3193 if (alreadySorted && oldSize > 0 &&
3194 !qcpLessThanSortKey<DataType>(
3200 if (mPreallocSize < n) preallocateGrow(n);
3206 mData.resize(mData.size() + n);
3210 std::sort(end() - n, end(), qcpLessThanSortKey<DataType>);
3212 !qcpLessThanSortKey<DataType>(
3213 *(constEnd() - n - 1),
3217 std::inplace_merge(begin(), end() - n, end(),
3218 qcpLessThanSortKey<DataType>);
3228 template <
class DataType>
3231 !qcpLessThanSortKey<DataType>(
3237 }
else if (qcpLessThanSortKey<DataType>(
3238 data, *constBegin()))
3241 if (mPreallocSize < 1) preallocateGrow(1);
3247 begin(), end(),
data, qcpLessThanSortKey<DataType>);
3248 mData.insert(insertionPoint,
data);
3257 template <
class DataType>
3261 std::lower_bound(begin(), end(), DataType::fromSortKey(sortKey),
3262 qcpLessThanSortKey<DataType>);
3267 if (mAutoSqueeze) performAutoSqueeze();
3275 template <
class DataType>
3278 std::upper_bound(begin(), end(), DataType::fromSortKey(sortKey),
3279 qcpLessThanSortKey<DataType>);
3281 mData.erase(it, itEnd);
3282 if (mAutoSqueeze) performAutoSqueeze();
3293 template <
class DataType>
3295 if (sortKeyFrom >= sortKeyTo || isEmpty())
return;
3298 std::lower_bound(begin(), end(), DataType::fromSortKey(sortKeyFrom),
3299 qcpLessThanSortKey<DataType>);
3301 std::upper_bound(it, end(), DataType::fromSortKey(sortKeyTo),
3302 qcpLessThanSortKey<DataType>);
3303 mData.erase(it, itEnd);
3304 if (mAutoSqueeze) performAutoSqueeze();
3316 template <
class DataType>
3319 std::lower_bound(begin(), end(), DataType::fromSortKey(sortKey),
3320 qcpLessThanSortKey<DataType>);
3321 if (it != end() && it->sortKey() == sortKey) {
3329 if (mAutoSqueeze) performAutoSqueeze();
3337 template <
class DataType>
3340 mPreallocIteration = 0;
3356 template <
class DataType>
3358 std::sort(begin(), end(), qcpLessThanSortKey<DataType>);
3372 template <
class DataType>
3374 bool postAllocation) {
3375 if (preAllocation) {
3376 if (mPreallocSize > 0) {
3377 std::copy(begin(), end(), mData.begin());
3378 mData.resize(
size());
3381 mPreallocIteration = 0;
3383 if (postAllocation) mData.squeeze();
3402 template <
class DataType>
3405 bool expandedRange)
const {
3406 if (isEmpty())
return constEnd();
3409 constBegin(), constEnd(), DataType::fromSortKey(sortKey),
3410 qcpLessThanSortKey<DataType>);
3411 if (expandedRange &&
3435 template <
class DataType>
3438 if (isEmpty())
return constEnd();
3441 constBegin(), constEnd(), DataType::fromSortKey(sortKey),
3442 qcpLessThanSortKey<DataType>);
3443 if (expandedRange && it != constEnd()) ++it;
3463 template <
class DataType>
3471 bool haveLower =
false;
3472 bool haveUpper =
false;
3479 if (DataType::sortKeyIsMainKey())
3487 if (!qIsNaN(it->mainValue())) {
3488 range.
lower = it->mainKey();
3499 if (!qIsNaN(it->mainValue())) {
3500 range.
upper = it->mainKey();
3508 while (it != itEnd) {
3509 if (!qIsNaN(it->mainValue())) {
3510 current = it->mainKey();
3511 if (current < range.
lower || !haveLower) {
3512 range.
lower = current;
3515 if (current > range.
upper || !haveUpper) {
3516 range.
upper = current;
3526 while (it != itEnd) {
3527 if (!qIsNaN(it->mainValue())) {
3528 current = it->mainKey();
3529 if ((current < range.
lower || !haveLower) && current < 0) {
3530 range.
lower = current;
3533 if ((current > range.
upper || !haveUpper) && current < 0) {
3534 range.
upper = current;
3543 while (it != itEnd) {
3544 if (!qIsNaN(it->mainValue())) {
3545 current = it->mainKey();
3546 if ((current < range.
lower || !haveLower) && current > 0) {
3547 range.
lower = current;
3550 if ((current > range.
upper || !haveUpper) && current > 0) {
3551 range.
upper = current;
3559 foundRange = haveLower && haveUpper;
3581 template <
class DataType>
3590 const bool restrictKeyRange = inKeyRange !=
QCPRange();
3591 bool haveLower =
false;
3592 bool haveUpper =
false;
3596 if (DataType::sortKeyIsMainKey() && restrictKeyRange) {
3597 itBegin = findBegin(inKeyRange.
lower);
3598 itEnd = findEnd(inKeyRange.
upper);
3603 it != itEnd; ++it) {
3604 if (restrictKeyRange && (it->mainKey() < inKeyRange.
lower ||
3605 it->mainKey() > inKeyRange.
upper))
3607 current = it->valueRange();
3608 if ((current.
lower < range.
lower || !haveLower) &&
3609 !qIsNaN(current.
lower)) {
3613 if ((current.
upper > range.
upper || !haveUpper) &&
3614 !qIsNaN(current.
upper)) {
3623 it != itEnd; ++it) {
3624 if (restrictKeyRange && (it->mainKey() < inKeyRange.
lower ||
3625 it->mainKey() > inKeyRange.
upper))
3627 current = it->valueRange();
3628 if ((current.
lower < range.
lower || !haveLower) &&
3629 current.
lower < 0 && !qIsNaN(current.
lower)) {
3633 if ((current.
upper > range.
upper || !haveUpper) &&
3634 current.
upper < 0 && !qIsNaN(current.
upper)) {
3643 it != itEnd; ++it) {
3644 if (restrictKeyRange && (it->mainKey() < inKeyRange.
lower ||
3645 it->mainKey() > inKeyRange.
upper))
3647 current = it->valueRange();
3648 if ((current.
lower < range.
lower || !haveLower) &&
3649 current.
lower > 0 && !qIsNaN(current.
lower)) {
3653 if ((current.
upper > range.
upper || !haveUpper) &&
3654 current.
upper > 0 && !qIsNaN(current.
upper)) {
3661 foundRange = haveLower && haveUpper;
3674 template <
class DataType>
3679 QCPDataRange iteratorRange(begin - constBegin(), end - constBegin());
3680 iteratorRange = iteratorRange.
bounded(dataRange.
bounded(this->dataRange()));
3681 begin = constBegin() + iteratorRange.
begin();
3682 end = constBegin() + iteratorRange.
end();
3695 template <
class DataType>
3697 if (minimumPreallocSize <= mPreallocSize)
return;
3699 int newPreallocSize = minimumPreallocSize;
3700 newPreallocSize += (1u << qBound(4, mPreallocIteration + 4, 15)) -
3703 ++mPreallocIteration;
3705 int sizeDifference = newPreallocSize - mPreallocSize;
3706 mData.resize(mData.size() + sizeDifference);
3707 std::copy_backward(mData.begin() + mPreallocSize,
3708 mData.end() - sizeDifference, mData.end());
3709 mPreallocSize = newPreallocSize;
3728 template <
class DataType>
3730 const int totalAlloc = mData.capacity();
3731 const int postAllocSize = totalAlloc - mData.size();
3732 const int usedSize =
size();
3733 bool shrinkPostAllocation =
false;
3734 bool shrinkPreAllocation =
false;
3735 if (totalAlloc > 650000)
3738 shrinkPostAllocation =
3742 shrinkPreAllocation = mPreallocSize * 10 > usedSize;
3743 }
else if (totalAlloc >
3747 shrinkPostAllocation = postAllocSize > usedSize * 5;
3748 shrinkPreAllocation =
3754 if (shrinkPreAllocation || shrinkPostAllocation)
3755 squeeze(shrinkPreAllocation, shrinkPostAllocation);
3771 QPen
pen()
const {
return mPen; }
3775 return mUsedScatterProperties;
3779 void setPen(
const QPen &pen);
3780 void setBrush(
const QBrush &brush);
3782 QCPScatterStyle::ScatterProperties usedProperties =
3784 void setUsedScatterProperties(
3785 const QCPScatterStyle::ScatterProperties &properties);
3795 virtual void drawDecoration(
QCPPainter *painter,
3819 Q_PROPERTY(QString
name READ
name WRITE setName)
3821 bool antialiasedFill READ antialiasedFill WRITE setAntialiasedFill)
3822 Q_PROPERTY(
bool antialiasedScatters READ antialiasedScatters WRITE
3823 setAntialiasedScatters)
3824 Q_PROPERTY(QPen pen READ pen WRITE setPen)
3825 Q_PROPERTY(QBrush brush READ brush WRITE setBrush)
3826 Q_PROPERTY(
QCPAxis *keyAxis READ keyAxis WRITE setKeyAxis)
3827 Q_PROPERTY(
QCPAxis *valueAxis READ valueAxis WRITE setValueAxis)
3829 NOTIFY selectableChanged)
3831 NOTIFY selectionChanged)
3833 WRITE setSelectionDecorator)
3840 QString
name()
const {
return mName; }
3843 QPen
pen()
const {
return mPen; }
3848 bool selected()
const {
return !mSelection.isEmpty(); }
3851 return mSelectionDecorator;
3855 void setName(
const QString &
name);
3856 void setAntialiasedFill(
bool enabled);
3857 void setAntialiasedScatters(
bool enabled);
3858 void setPen(
const QPen &pen);
3859 void setBrush(
const QBrush &brush);
3860 void setKeyAxis(
QCPAxis *axis);
3861 void setValueAxis(
QCPAxis *axis);
3868 bool onlySelectable,
3869 QVariant *details = 0) const
3883 void coordsToPixels(
double key,
double value,
double &
x,
double &
y)
const;
3884 const QPointF coordsToPixels(
double key,
double value)
const;
3885 void pixelsToCoords(
double x,
double y,
double &key,
double &value)
const;
3886 void pixelsToCoords(
const QPointF &pixelPos,
3888 double &value)
const;
3889 void rescaleAxes(
bool onlyEnlarge =
false)
const;
3890 void rescaleKeyAxis(
bool onlyEnlarge =
false)
const;
3891 void rescaleValueAxis(
bool onlyEnlarge =
false,
3892 bool inKeyRange =
false)
const;
3895 bool removeFromLegend(
QCPLegend *legend)
const;
3896 bool removeFromLegend()
const;
3918 void applyDefaultAntialiasingHint(
QCPPainter *painter) const
3921 virtual
void selectEvent(QMouseEvent *
event,
3923 const QVariant &details,
3925 virtual
void deselectEvent(
bool *selectionStateChanged)
Q_DECL_OVERRIDE;
3929 const QRectF &rect) const = 0;
3932 void applyFillAntialiasingHint(
QCPPainter *painter) const;
3933 void applyScattersAntialiasingHint(
QCPPainter *painter) const;
3953 const QString &
name,
3958 QString
name()
const {
return mName; }
3959 virtual QPointF pixelPosition()
const;
4025 Q_ENUMS(PositionType)
4029 const QString &
name);
4039 double key()
const {
return mKey; }
4041 QPointF
coords()
const {
return QPointF(mKey, mValue); }
4048 void setType(PositionType
type);
4049 void setTypeX(PositionType
type);
4050 void setTypeY(PositionType
type);
4052 bool keepPixelPosition = false);
4054 bool keepPixelPosition = false);
4056 bool keepPixelPosition = false);
4057 void setCoords(
double key,
double value);
4058 void setCoords(const QPointF &coords);
4061 void setPixelPosition(const QPointF &pixelPosition);
4068 double mKey, mValue;
4084 Q_PROPERTY(
bool clipToAxisRect READ clipToAxisRect WRITE setClipToAxisRect)
4086 QCPAxisRect *clipAxisRect READ clipAxisRect WRITE setClipAxisRect)
4087 Q_PROPERTY(
bool selectable READ selectable WRITE setSelectable NOTIFY
4089 Q_PROPERTY(
bool selected READ selected WRITE setSelected NOTIFY
4103 void setClipToAxisRect(
bool clip);
4105 Q_SLOT
void setSelectable(
bool selectable);
4106 Q_SLOT
void setSelected(
bool selected);
4110 bool onlySelectable,
4115 QList<QCPItemAnchor *>
anchors()
const {
return mAnchors; }
4118 bool hasAnchor(
const QString &
name)
const;
4135 virtual
void applyDefaultAntialiasingHint(
QCPPainter *painter) const
4139 virtual
void selectEvent(QMouseEvent *
event,
4141 const QVariant &details,
4143 virtual
void deselectEvent(
bool *selectionStateChanged)
Q_DECL_OVERRIDE;
4146 virtual QPointF anchorPixelPosition(
int anchorId) const;
4149 double rectDistance(const QRectF &rect,
4151 bool filledRect) const;
4170 Q_PROPERTY(QRect viewport READ viewport WRITE setViewport)
4171 Q_PROPERTY(QPixmap background READ background WRITE setBackground)
4172 Q_PROPERTY(
bool backgroundScaled READ backgroundScaled WRITE
4173 setBackgroundScaled)
4174 Q_PROPERTY(Qt::AspectRatioMode backgroundScaledMode READ
4175 backgroundScaledMode WRITE setBackgroundScaledMode)
4177 Q_PROPERTY(
bool autoAddPlottableToLegend READ autoAddPlottableToLegend WRITE
4178 setAutoAddPlottableToLegend)
4179 Q_PROPERTY(
int selectionTolerance READ selectionTolerance WRITE
4180 setSelectionTolerance)
4181 Q_PROPERTY(
bool noAntialiasingOnDrag READ noAntialiasingOnDrag WRITE
4182 setNoAntialiasingOnDrag)
4183 Q_PROPERTY(Qt::KeyboardModifier multiSelectModifier READ multiSelectModifier
4184 WRITE setMultiSelectModifier)
4185 Q_PROPERTY(
bool openGl READ openGl WRITE setOpenGl)
4198 Q_ENUMS(LayerInsertMode)
4226 Q_ENUMS(RefreshPriority)
4237 return mBackgroundScaledMode;
4241 return mAntialiasedElements;
4244 return mNotAntialiasedElements;
4252 return mMultiSelectModifier;
4255 return mSelectionRectMode;
4261 void setViewport(
const QRect &rect);
4262 void setBufferDevicePixelRatio(
double ratio);
4263 void setBackground(
const QPixmap &pm);
4267 Qt::AspectRatioMode mode = Qt::KeepAspectRatioByExpanding);
4268 void setBackground(
const QBrush &brush);
4269 void setBackgroundScaled(
bool scaled);
4270 void setBackgroundScaledMode(Qt::AspectRatioMode mode);
4271 void setAntialiasedElements(
4272 const QCP::AntialiasedElements &antialiasedElements);
4274 bool enabled =
true);
4275 void setNotAntialiasedElements(
4276 const QCP::AntialiasedElements ¬AntialiasedElements);
4278 bool enabled =
true);
4279 void setAutoAddPlottableToLegend(
bool on);
4280 void setInteractions(
const QCP::Interactions &interactions);
4282 bool enabled =
true);
4283 void setSelectionTolerance(
int pixels);
4284 void setNoAntialiasingOnDrag(
bool enabled);
4285 void setPlottingHints(
const QCP::PlottingHints &hints);
4287 void setMultiSelectModifier(Qt::KeyboardModifier modifier);
4290 void setOpenGl(
bool enabled,
int multisampling = 16);
4297 bool removePlottable(
int index);
4298 int clearPlottables();
4299 int plottableCount()
const;
4300 QList<QCPAbstractPlottable *> selectedPlottables()
const;
4302 bool onlySelectable =
false)
const;
4310 bool removeGraph(
int index);
4312 int graphCount()
const;
4313 QList<QCPGraph *> selectedGraphs()
const;
4319 bool removeItem(
int index);
4321 int itemCount()
const;
4322 QList<QCPAbstractItem *> selectedItems()
const;
4324 bool onlySelectable =
false)
const;
4331 bool setCurrentLayer(
const QString &
name);
4332 bool setCurrentLayer(
QCPLayer *layer);
4333 int layerCount()
const;
4334 bool addLayer(
const QString &
name,
4336 LayerInsertMode insertMode = limAbove);
4340 LayerInsertMode insertMode = limAbove);
4343 int axisRectCount()
const;
4345 QList<QCPAxisRect *> axisRects()
const;
4347 QCPAxisRect *axisRectAt(
const QPointF &pos)
const;
4348 Q_SLOT
void rescaleAxes(
bool onlyVisiblePlottables =
false);
4350 QList<QCPAxis *> selectedAxes()
const;
4351 QList<QCPLegend *> selectedLegends()
const;
4352 Q_SLOT
void deselectAll();
4354 bool savePdf(
const QString &fileName,
4358 const QString &pdfCreator = QString(),
4359 const QString &pdfTitle = QString());
4360 bool savePng(
const QString &fileName,
4365 int resolution = 96,
4367 bool saveJpg(
const QString &fileName,
4372 int resolution = 96,
4374 bool saveBmp(
const QString &fileName,
4378 int resolution = 96,
4380 bool saveRastered(
const QString &fileName,
4386 int resolution = 96,
4388 QPixmap toPixmap(
int width = 0,
int height = 0,
double scale = 1.0);
4405 QMouseEvent *
event);
4408 QMouseEvent *
event);
4413 QMouseEvent *
event);
4416 QMouseEvent *
event);
4419 QMouseEvent *
event);
4422 QMouseEvent *
event);
4468 #ifdef QCP_OPENGL_FBO
4469 QSharedPointer<QOpenGLContext> mGlContext;
4470 QSharedPointer<QSurface> mGlSurface;
4471 QSharedPointer<QOpenGLPaintDevice> mGlPaintDevice;
4487 virtual
void updateLayout();
4488 virtual
void axisRemoved(
QCPAxis *axis);
4489 virtual
void legendRemoved(
QCPLegend *legend);
4490 Q_SLOT virtual
void processRectSelection(QRect rect, QMouseEvent *
event);
4491 Q_SLOT virtual
void processRectZoom(QRect rect, QMouseEvent *
event);
4492 Q_SLOT virtual
void processPointSelection(QMouseEvent *
event);
4496 bool registerGraph(
QCPGraph *graph);
4498 void updateLayerIndices() const;
4500 bool onlySelectable,
4501 QVariant *selectionDetails = 0) const;
4504 bool onlySelectable,
4505 QList<QVariant> *selectionDetails = 0) const;
4507 void setupPaintBuffers();
4509 bool hasInvalidatedPaintBuffers();
4541 bool onlySelectable)
const = 0;
4542 virtual int findBegin(
double sortKey,
bool expandedRange =
true)
const = 0;
4543 virtual int findEnd(
double sortKey,
bool expandedRange =
true)
const = 0;
4546 template <
class DataType>
4568 virtual
int findBegin(
double sortKey,
4570 virtual
int findEnd(
double sortKey,
4574 virtual
double selectTest(const QPointF &pos,
4575 bool onlySelectable,
4587 QList<QCPDataRange> &unselectedSegments)
const;
4589 const QVector<QPointF> &lineData)
const;
4808 template <
class DataType>
4814 template <
class DataType>
4820 template <
class DataType>
4822 return mDataContainer->size();
4828 template <
class DataType>
4830 if (index >= 0 && index < mDataContainer->
size()) {
4831 return (mDataContainer->constBegin() + index)->mainKey();
4833 qDebug() << Q_FUNC_INFO <<
"Index out of bounds" << index;
4841 template <
class DataType>
4843 if (index >= 0 && index < mDataContainer->
size()) {
4844 return (mDataContainer->constBegin() + index)->sortKey();
4846 qDebug() << Q_FUNC_INFO <<
"Index out of bounds" << index;
4854 template <
class DataType>
4856 if (index >= 0 && index < mDataContainer->
size()) {
4857 return (mDataContainer->constBegin() + index)->mainValue();
4859 qDebug() << Q_FUNC_INFO <<
"Index out of bounds" << index;
4867 template <
class DataType>
4869 if (index >= 0 && index < mDataContainer->
size()) {
4870 return (mDataContainer->constBegin() + index)->valueRange();
4872 qDebug() << Q_FUNC_INFO <<
"Index out of bounds" << index;
4880 template <
class DataType>
4882 if (index >= 0 && index < mDataContainer->
size()) {
4884 mDataContainer->constBegin() + index;
4885 return coordsToPixels(it->mainKey(), it->mainValue());
4887 qDebug() << Q_FUNC_INFO <<
"Index out of bounds" << index;
4895 template <
class DataType>
4897 return DataType::sortKeyIsMainKey();
4908 template <
class DataType>
4910 const QRectF &rect,
bool onlySelectable)
const {
4912 if ((onlySelectable && mSelectable ==
QCP::stNone) ||
4913 mDataContainer->isEmpty())
4915 if (!mKeyAxis || !mValueAxis)
return result;
4918 double key1, value1, key2, value2;
4919 pixelsToCoords(rect.topLeft(), key1, value1);
4920 pixelsToCoords(rect.bottomRight(), key2, value2);
4924 QCPRange valueRange(value1, value2);
4926 mDataContainer->constBegin();
4928 mDataContainer->constEnd();
4929 if (DataType::sortKeyIsMainKey())
4936 if (begin == end)
return result;
4938 int currentSegmentBegin = -1;
4942 if (currentSegmentBegin == -1) {
4943 if (valueRange.
contains(it->mainValue()) &&
4945 currentSegmentBegin = it - mDataContainer->constBegin();
4946 }
else if (!valueRange.
contains(it->mainValue()) ||
4950 it - mDataContainer->constBegin()),
4952 currentSegmentBegin = -1;
4956 if (currentSegmentBegin != -1)
4968 template <
class DataType>
4970 bool expandedRange)
const {
4971 return mDataContainer->findBegin(sortKey, expandedRange) -
4972 mDataContainer->constBegin();
4978 template <
class DataType>
4980 bool expandedRange)
const {
4981 return mDataContainer->findEnd(sortKey, expandedRange) -
4982 mDataContainer->constBegin();
4996 template <
class DataType>
4998 bool onlySelectable,
4999 QVariant *details)
const {
5000 if ((onlySelectable && mSelectable ==
QCP::stNone) ||
5001 mDataContainer->isEmpty())
5003 if (!mKeyAxis || !mValueAxis)
return -1;
5006 double minDistSqr = (std::numeric_limits<double>::max)();
5007 int minDistIndex = mDataContainer->size();
5010 mDataContainer->constBegin();
5012 mDataContainer->constEnd();
5013 if (DataType::sortKeyIsMainKey())
5019 double posKeyMin, posKeyMax, dummy;
5026 if (posKeyMin > posKeyMax) qSwap(posKeyMin, posKeyMax);
5027 begin = mDataContainer->
findBegin(posKeyMin,
true);
5028 end = mDataContainer->
findEnd(posKeyMax,
true);
5030 if (begin == end)
return -1;
5031 QCPRange keyRange(mKeyAxis->range());
5032 QCPRange valueRange(mValueAxis->range());
5035 const double mainKey = it->mainKey();
5036 const double mainValue = it->mainValue();
5044 const double currentDistSqr =
5045 QCPVector2D(coordsToPixels(mainKey, mainValue) - pos)
5047 if (currentDistSqr < minDistSqr) {
5048 minDistSqr = currentDistSqr;
5049 minDistIndex = it - mDataContainer->constBegin();
5053 if (minDistIndex != mDataContainer->size())
5058 if (details) details->setValue(selectionResult);
5059 return qSqrt(minDistSqr);
5072 template <
class DataType>
5074 QList<QCPDataRange> &selectedSegments,
5075 QList<QCPDataRange> &unselectedSegments)
const {
5076 selectedSegments.clear();
5077 unselectedSegments.clear();
5090 unselectedSegments =
5105 template <
class DataType>
5107 QCPPainter *painter,
const QVector<QPointF> &lineData)
const {
5111 painter->pen().style() == Qt::SolidLine &&
5115 bool lastIsNan =
false;
5116 const int lineDataSize = lineData.size();
5117 while (i < lineDataSize &&
5118 (qIsNaN(lineData.at(i).y()) ||
5119 qIsNaN(lineData.at(i)
5123 while (i < lineDataSize) {
5124 if (!qIsNaN(lineData.at(i).y()) &&
5125 !qIsNaN(lineData.at(i).x()))
5128 painter->
drawLine(lineData.at(i - 1), lineData.at(i));
5136 int segmentStart = 0;
5138 const int lineDataSize = lineData.size();
5139 while (i < lineDataSize) {
5140 if (qIsNaN(lineData.at(i).y()) || qIsNaN(lineData.at(i).x()) ||
5141 qIsInf(lineData.at(i).y()))
5145 painter->drawPolyline(
5146 lineData.constData() + segmentStart,
5149 segmentStart = i + 1;
5154 painter->drawPolyline(lineData.constData() + segmentStart,
5155 lineDataSize - segmentStart);
5181 Q_ENUMS(ColorInterpolation)
5228 Q_ENUMS(GradientPreset)
5234 return !(*
this == other);
5241 return mColorInterpolation;
5246 void setLevelCount(
int n);
5247 void setColorStops(
const QMap<double, QColor> &colorStops);
5249 void setColorInterpolation(ColorInterpolation interpolation);
5250 void setPeriodic(
bool enabled);
5253 void colorize(
const double *
data,
5257 int dataIndexFactor = 1,
5258 bool logarithmic =
false);
5259 void colorize(
const double *
data,
5260 const unsigned char *alpha,
5264 int dataIndexFactor = 1,
5265 bool logarithmic =
false);
5268 bool logarithmic =
false);
5269 void loadPreset(GradientPreset preset);
5270 void clearColorStops();
5287 bool stopsUseAlpha()
const;
5288 void updateColorBuffer();
5321 Q_ENUMS(BracketStyle)
5336 void setBracketPen(
const QPen &pen);
5337 void setBracketBrush(
const QBrush &brush);
5338 void setBracketWidth(
int width);
5339 void setBracketHeight(
int height);
5340 void setBracketStyle(BracketStyle style);
5341 void setTangentToData(
bool enabled);
5342 void setTangentAverage(
int pointCount);
5345 virtual void drawBracket(
QCPPainter *painter,
int direction)
const;
5348 virtual void drawDecoration(
QCPPainter *painter,
5364 int direction)
const;
5366 int dataIndex)
const;
5378 Q_PROPERTY(QPixmap background READ background WRITE setBackground)
5379 Q_PROPERTY(
bool backgroundScaled READ backgroundScaled WRITE
5380 setBackgroundScaled)
5381 Q_PROPERTY(Qt::AspectRatioMode backgroundScaledMode READ
5382 backgroundScaledMode WRITE setBackgroundScaledMode)
5383 Q_PROPERTY(Qt::Orientations rangeDrag READ rangeDrag WRITE setRangeDrag)
5384 Q_PROPERTY(Qt::Orientations rangeZoom READ rangeZoom WRITE setRangeZoom)
5395 return mBackgroundScaledMode;
5399 QCPAxis *rangeDragAxis(Qt::Orientation orientation);
5400 QCPAxis *rangeZoomAxis(Qt::Orientation orientation);
5401 QList<QCPAxis *> rangeDragAxes(Qt::Orientation orientation);
5402 QList<QCPAxis *> rangeZoomAxes(Qt::Orientation orientation);
5403 double rangeZoomFactor(Qt::Orientation orientation);
5406 void setBackground(
const QPixmap &pm);
5410 Qt::AspectRatioMode mode = Qt::KeepAspectRatioByExpanding);
5411 void setBackground(
const QBrush &brush);
5412 void setBackgroundScaled(
bool scaled);
5413 void setBackgroundScaledMode(Qt::AspectRatioMode mode);
5414 void setRangeDrag(Qt::Orientations orientations);
5415 void setRangeZoom(Qt::Orientations orientations);
5417 void setRangeDragAxes(QList<QCPAxis *> axes);
5418 void setRangeDragAxes(QList<QCPAxis *> horizontal,
5419 QList<QCPAxis *> vertical);
5421 void setRangeZoomAxes(QList<QCPAxis *> axes);
5422 void setRangeZoomAxes(QList<QCPAxis *> horizontal,
5423 QList<QCPAxis *> vertical);
5424 void setRangeZoomFactor(
double horizontalFactor,
double verticalFactor);
5425 void setRangeZoomFactor(
double factor);
5430 QList<QCPAxis *> axes(QCPAxis::AxisTypes types)
const;
5431 QList<QCPAxis *> axes()
const;
5433 QList<QCPAxis *> addAxes(QCPAxis::AxisTypes types);
5434 bool removeAxis(
QCPAxis *axis);
5437 void zoom(
const QRectF &pixelRect);
5438 void zoom(
const QRectF &pixelRect,
const QList<QCPAxis *> &affectedAxes);
5439 void setupFullAxesBox(
bool connectRanges =
false);
5440 QList<QCPAbstractPlottable *> plottables()
const;
5441 QList<QCPGraph *> graphs()
const;
5442 QList<QCPAbstractItem *> items()
const;
5445 int left()
const {
return mRect.left(); }
5446 int right()
const {
return mRect.right(); }
5447 int top()
const {
return mRect.top(); }
5448 int bottom()
const {
return mRect.bottom(); }
5449 int width()
const {
return mRect.width(); }
5450 int height()
const {
return mRect.height(); }
5451 QSize
size()
const {
return mRect.size(); }
5452 QPoint
topLeft()
const {
return mRect.topLeft(); }
5456 QPoint
center()
const {
return mRect.center(); }
5460 virtual QList<QCPLayoutElement *> elements(
bool recursive)
const
5480 QHash<QCPAxis::AxisType, QList<QCPAxis *>>
mAxes;
5483 virtual void applyDefaultAntialiasingHint(
QCPPainter *painter)
const
5489 virtual
void mousePressEvent(QMouseEvent *
event,
5491 virtual
void mouseMoveEvent(QMouseEvent *
event,
5493 virtual
void mouseReleaseEvent(QMouseEvent *
event,
5515 Q_PROPERTY(
QCPLegend *parentLegend READ parentLegend)
5516 Q_PROPERTY(QFont font READ font WRITE setFont)
5517 Q_PROPERTY(QColor textColor READ textColor WRITE setTextColor)
5518 Q_PROPERTY(QFont selectedFont READ selectedFont WRITE setSelectedFont)
5519 Q_PROPERTY(QColor selectedTextColor READ selectedTextColor WRITE
5520 setSelectedTextColor)
5521 Q_PROPERTY(
bool selectable READ selectable WRITE setSelectable NOTIFY
5523 Q_PROPERTY(
bool selected READ selected WRITE setSelected NOTIFY
5531 QFont
font()
const {
return mFont; }
5539 void setFont(
const QFont &font);
5540 void setTextColor(
const QColor &
color);
5541 void setSelectedFont(
const QFont &font);
5542 void setSelectedTextColor(
const QColor &
color);
5543 Q_SLOT
void setSelectable(
bool selectable);
5544 Q_SLOT
void setSelected(
bool selected);
5547 virtual double selectTest(
const QPointF &pos,
5548 bool onlySelectable,
5552 void selectionChanged(
bool selected);
5553 void selectableChanged(
bool selectable);
5560 QFont mSelectedFont;
5561 QColor mSelectedTextColor;
5562 bool mSelectable, mSelected;
5566 virtual
void applyDefaultAntialiasingHint(
QCPPainter *painter) const
5571 virtual
void selectEvent(QMouseEvent *
event,
5573 const QVariant &details,
5575 virtual
void deselectEvent(
bool *selectionStateChanged)
Q_DECL_OVERRIDE;
5600 QPen getIconBorderPen() const;
5601 QColor getTextColor() const;
5602 QFont getFont() const;
5608 Q_PROPERTY(QPen borderPen READ borderPen WRITE setBorderPen)
5609 Q_PROPERTY(QBrush brush READ brush WRITE setBrush)
5610 Q_PROPERTY(QFont font READ font WRITE setFont)
5611 Q_PROPERTY(QColor textColor READ textColor WRITE setTextColor)
5612 Q_PROPERTY(QSize iconSize READ iconSize WRITE setIconSize)
5614 int iconTextPadding READ iconTextPadding WRITE setIconTextPadding)
5615 Q_PROPERTY(QPen iconBorderPen READ iconBorderPen WRITE setIconBorderPen)
5616 Q_PROPERTY(SelectableParts selectableParts READ selectableParts WRITE
5617 setSelectableParts NOTIFY selectionChanged)
5618 Q_PROPERTY(SelectableParts selectedParts READ selectedParts WRITE
5619 setSelectedParts NOTIFY selectableChanged)
5620 Q_PROPERTY(QPen selectedBorderPen READ selectedBorderPen WRITE
5621 setSelectedBorderPen)
5622 Q_PROPERTY(QPen selectedIconBorderPen READ selectedIconBorderPen WRITE
5623 setSelectedIconBorderPen)
5624 Q_PROPERTY(QBrush selectedBrush READ selectedBrush WRITE setSelectedBrush)
5625 Q_PROPERTY(QFont selectedFont READ selectedFont WRITE setSelectedFont)
5626 Q_PROPERTY(QColor selectedTextColor READ selectedTextColor WRITE
5627 setSelectedTextColor)
5643 Q_ENUMS(SelectablePart)
5644 Q_FLAGS(SelectableParts)
5645 Q_DECLARE_FLAGS(SelectableParts, SelectablePart)
5653 QFont
font()
const {
return mFont; }
5659 SelectableParts selectedParts()
const;
5667 void setBorderPen(
const QPen &pen);
5668 void setBrush(
const QBrush &brush);
5669 void setFont(
const QFont &font);
5670 void setTextColor(
const QColor &
color);
5671 void setIconSize(
const QSize &
size);
5673 void setIconTextPadding(
int padding);
5674 void setIconBorderPen(
const QPen &pen);
5675 Q_SLOT
void setSelectableParts(
const SelectableParts &selectableParts);
5676 Q_SLOT
void setSelectedParts(
const SelectableParts &selectedParts);
5677 void setSelectedBorderPen(
const QPen &pen);
5678 void setSelectedIconBorderPen(
const QPen &pen);
5679 void setSelectedBrush(
const QBrush &brush);
5680 void setSelectedFont(
const QFont &font);
5681 void setSelectedTextColor(
const QColor &
color);
5684 virtual double selectTest(
const QPointF &pos,
5685 bool onlySelectable,
5692 int itemCount() const;
5696 bool removeItem(
int index);
5707 QPen mBorderPen, mIconBorderPen;
5712 int mIconTextPadding;
5713 SelectableParts mSelectedParts, mSelectableParts;
5714 QPen mSelectedBorderPen, mSelectedIconBorderPen;
5715 QBrush mSelectedBrush;
5716 QFont mSelectedFont;
5717 QColor mSelectedTextColor;
5722 virtual
void applyDefaultAntialiasingHint(
QCPPainter *painter) const
5726 virtual
void selectEvent(QMouseEvent *
event,
5728 const QVariant &details,
5730 virtual
void deselectEvent(
bool *selectionStateChanged)
Q_DECL_OVERRIDE;
5733 QPen getBorderPen() const;
5734 QBrush getBrush() const;
5753 Q_PROPERTY(QString text READ text WRITE setText)
5754 Q_PROPERTY(QFont font READ font WRITE setFont)
5755 Q_PROPERTY(QColor textColor READ textColor WRITE setTextColor)
5756 Q_PROPERTY(QFont selectedFont READ selectedFont WRITE setSelectedFont)
5757 Q_PROPERTY(QColor selectedTextColor READ selectedTextColor WRITE
5758 setSelectedTextColor)
5759 Q_PROPERTY(
bool selectable READ selectable WRITE setSelectable NOTIFY
5761 Q_PROPERTY(
bool selected READ selected WRITE setSelected NOTIFY
5768 const QString &text,
5771 const QString &text,
5772 const QString &fontFamily,
5775 const QString &text,
5779 QString
text()
const {
return mText; }
5781 QFont
font()
const {
return mFont; }
5789 void setText(
const QString &text);
5790 void setTextFlags(
int flags);
5791 void setFont(
const QFont &font);
5792 void setTextColor(
const QColor &
color);
5793 void setSelectedFont(
const QFont &font);
5794 void setSelectedTextColor(
const QColor &
color);
5795 Q_SLOT
void setSelectable(
bool selectable);
5796 Q_SLOT
void setSelected(
bool selected);
5799 virtual double selectTest(
const QPointF &pos,
5800 bool onlySelectable,
5802 virtual
void mousePressEvent(QMouseEvent *
event,
5804 virtual
void mouseReleaseEvent(QMouseEvent *
event,
5806 virtual
void mouseDoubleClickEvent(QMouseEvent *
event,
5810 void selectionChanged(
bool selected);
5811 void selectableChanged(
bool selectable);
5821 QFont mSelectedFont;
5822 QColor mSelectedTextColor;
5823 QRect mTextBoundingRect;
5824 bool mSelectable, mSelected;
5827 virtual
void applyDefaultAntialiasingHint(
QCPPainter *painter) const
5833 virtual
void selectEvent(QMouseEvent *
event,
5835 const QVariant &details,
5837 virtual
void deselectEvent(
bool *selectionStateChanged)
Q_DECL_OVERRIDE;
5840 QFont mainFont() const;
5841 QColor mainTextColor() const;
5852 class QCPColorScaleAxisRectPrivate : public
QCPAxisRect {
5855 explicit QCPColorScaleAxisRectPrivate(
QCPColorScale *parentColorScale);
5859 QImage mGradientImage;
5860 bool mGradientImageInvalidated;
5870 void updateGradientImage();
5871 Q_SLOT
void axisSelectionChanged(QCPAxis::SelectableParts selectedParts);
5872 Q_SLOT
void axisSelectableChanged(QCPAxis::SelectableParts selectableParts);
5880 Q_PROPERTY(
QCPRange dataRange READ dataRange WRITE setDataRange NOTIFY
5883 setDataScaleType NOTIFY dataScaleTypeChanged)
5884 Q_PROPERTY(
QCPColorGradient gradient READ gradient WRITE setGradient NOTIFY
5886 Q_PROPERTY(QString label READ label WRITE setLabel)
5887 Q_PROPERTY(
int barWidth READ barWidth WRITE setBarWidth)
5888 Q_PROPERTY(
bool rangeDrag READ rangeDrag WRITE setRangeDrag)
5889 Q_PROPERTY(
bool rangeZoom READ rangeZoom WRITE setRangeZoom)
5901 QString label()
const;
5903 bool rangeDrag()
const;
5904 bool rangeZoom()
const;
5908 Q_SLOT
void setDataRange(
const QCPRange &dataRange);
5911 void setLabel(
const QString &str);
5912 void setBarWidth(
int width);
5913 void setRangeDrag(
bool enabled);
5914 void setRangeZoom(
bool enabled);
5917 QList<QCPColorMap *> colorMaps()
const;
5918 void rescaleDataRange(
bool onlyVisibleMaps);
5941 virtual void applyDefaultAntialiasingHint(
QCPPainter *painter)
const
5944 virtual void mousePressEvent(QMouseEvent *
event,
5946 virtual void mouseMoveEvent(QMouseEvent *
event,
5948 virtual void mouseReleaseEvent(QMouseEvent *
event,
5955 friend class QCPColorScaleAxisRectPrivate;
5999 Q_PROPERTY(
LineStyle lineStyle READ lineStyle WRITE setLineStyle)
6002 Q_PROPERTY(
int scatterSkip READ scatterSkip WRITE setScatterSkip)
6003 Q_PROPERTY(
QCPGraph *channelFillGraph READ channelFillGraph WRITE
6004 setChannelFillGraph)
6005 Q_PROPERTY(
bool adaptiveSampling READ adaptiveSampling WRITE
6006 setAdaptiveSampling)
6040 QSharedPointer<QCPGraphDataContainer>
data()
const {
6041 return mDataContainer;
6050 void setData(QSharedPointer<QCPGraphDataContainer>
data);
6051 void setData(
const QVector<double> &keys,
6052 const QVector<double> &values,
6053 bool alreadySorted =
false);
6054 void setLineStyle(LineStyle ls);
6056 void setScatterSkip(
int skip);
6057 void setChannelFillGraph(
QCPGraph *targetGraph);
6058 void setAdaptiveSampling(
bool enabled);
6061 void addData(
const QVector<double> &keys,
6062 const QVector<double> &values,
6063 bool alreadySorted =
false);
6064 void addData(
double key,
double value);
6067 virtual double selectTest(
const QPointF &pos,
6068 bool onlySelectable,
6084 bool mAdaptiveSampling;
6088 virtual
void drawLegendIcon(
QCPPainter *painter,
6092 virtual
void drawFill(
QCPPainter *painter, QVector<QPointF> *lines) const;
6093 virtual
void drawScatterPlot(
QCPPainter *painter,
6094 const QVector<QPointF> &scatters,
6096 virtual
void drawLinePlot(
QCPPainter *painter,
6097 const QVector<QPointF> &lines) const;
6098 virtual
void drawImpulsePlot(
QCPPainter *painter,
6099 const QVector<QPointF> &lines) const;
6101 virtual
void getOptimizedLineData(
6105 virtual
void getOptimizedScatterData(
6114 void getLines(QVector<QPointF> *lines, const
QCPDataRange &dataRange) const;
6115 void getScatters(QVector<QPointF> *scatters,
6118 QVector<QPointF> dataToStepLeftLines(
6120 QVector<QPointF> dataToStepRightLines(
6122 QVector<QPointF> dataToStepCenterLines(
6124 QVector<QPointF> dataToImpulseLines(
6127 const QVector<QPointF> *lineData,
6128 Qt::Orientation keyOrientation) const;
6131 const QVector<QPointF> *thisData,
6133 const QVector<QPointF> *otherData) const;
6134 bool segmentsIntersect(
double aLower,
6138 int &bPrecedence) const;
6139 QPointF getFillBasePoint(QPointF matchingDataPoint) const;
6140 const QPolygonF getFillPolygon(const QVector<QPointF> *lineData,
6142 const QPolygonF getChannelFillPolygon(const QVector<QPointF> *lineData,
6144 const QVector<QPointF> *otherData,
6146 int findIndexBelowX(const QVector<QPointF> *
data,
double x) const;
6147 int findIndexAboveX(const QVector<QPointF> *
data,
double x) const;
6148 int findIndexBelowY(const QVector<QPointF> *
data,
double y) const;
6149 int findIndexAboveY(const QVector<QPointF> *
data,
double y) const;
6150 double pointDistance(
6151 const QPointF &pixelPoint,
6203 Q_PROPERTY(
int scatterSkip READ scatterSkip WRITE setScatterSkip)
6204 Q_PROPERTY(
LineStyle lineStyle READ lineStyle WRITE setLineStyle)
6223 QSharedPointer<QCPCurveDataContainer>
data()
const {
6224 return mDataContainer;
6231 void setData(QSharedPointer<QCPCurveDataContainer>
data);
6232 void setData(
const QVector<double> &t,
6233 const QVector<double> &keys,
6234 const QVector<double> &values,
6235 bool alreadySorted =
false);
6236 void setData(
const QVector<double> &keys,
const QVector<double> &values);
6238 void setScatterSkip(
int skip);
6239 void setLineStyle(LineStyle style);
6242 void addData(
const QVector<double> &t,
6243 const QVector<double> &keys,
6244 const QVector<double> &values,
6245 bool alreadySorted =
false);
6246 void addData(
const QVector<double> &keys,
const QVector<double> &values);
6247 void addData(
double t,
double key,
double value);
6248 void addData(
double key,
double value);
6251 virtual double selectTest(
const QPointF &pos,
6252 bool onlySelectable,
6270 virtual
void drawLegendIcon(
QCPPainter *painter,
6274 virtual
void drawCurveLine(
QCPPainter *painter,
6275 const QVector<QPointF> &lines) const;
6276 virtual
void drawScatterPlot(
QCPPainter *painter,
6277 const QVector<QPointF> &
points,
6281 void getCurveLines(QVector<QPointF> *lines,
6283 double penWidth) const;
6284 void getScatters(QVector<QPointF> *scatters,
6286 double scatterWidth) const;
6287 int getRegion(
double key,
6292 double valueMin) const;
6293 QPointF getOptimizedPoint(
int prevRegion,
6301 double valueMin) const;
6302 QVector<QPointF> getOptimizedCornerPoints(
int prevRegion,
6311 double valueMin) const;
6312 bool mayTraverse(
int prevRegion,
int currentRegion) const;
6313 bool getTraverse(
double prevKey,
6322 QPointF &crossB) const;
6323 void getTraverseCornerPoints(
int prevRegion,
6329 QVector<QPointF> &beforeTraverse,
6330 QVector<QPointF> &afterTraverse) const;
6331 double pointDistance(
6332 const QPointF &pixelPoint,
6348 Q_PROPERTY(
SpacingType spacingType READ spacingType WRITE setSpacingType)
6349 Q_PROPERTY(
double spacing READ spacing WRITE setSpacing)
6367 Q_ENUMS(SpacingType)
6377 void setSpacingType(SpacingType spacingType);
6378 void setSpacing(
double spacing);
6381 QList<QCPBars *>
bars()
const {
return mBars; }
6382 QCPBars *bars(
int index)
const;
6383 int size()
const {
return mBars.size(); }
6388 void insert(
int i,
QCPBars *bars);
6399 void registerBars(
QCPBars *bars);
6400 void unregisterBars(
QCPBars *bars);
6403 double keyPixelOffset(
const QCPBars *bars,
double keyCoord);
6404 double getPixelSpacing(
const QCPBars *bars,
double keyCoord);
6452 Q_PROPERTY(
double width READ
width WRITE setWidth)
6453 Q_PROPERTY(
WidthType widthType READ widthType WRITE setWidthType)
6454 Q_PROPERTY(
QCPBarsGroup *barsGroup READ barsGroup WRITE setBarsGroup)
6455 Q_PROPERTY(
double baseValue READ baseValue WRITE setBaseValue)
6456 Q_PROPERTY(
double stackingGap READ stackingGap WRITE setStackingGap)
6457 Q_PROPERTY(
QCPBars *barBelow READ barBelow)
6458 Q_PROPERTY(
QCPBars *barAbove READ barAbove)
6489 QSharedPointer<QCPBarsDataContainer>
data()
const {
return mDataContainer; }
6492 void setData(QSharedPointer<QCPBarsDataContainer>
data);
6493 void setData(
const QVector<double> &keys,
6494 const QVector<double> &values,
6495 bool alreadySorted =
false);
6496 void setWidth(
double width);
6497 void setWidthType(WidthType widthType);
6499 void setBaseValue(
double baseValue);
6500 void setStackingGap(
double pixels);
6503 void addData(
const QVector<double> &keys,
6504 const QVector<double> &values,
6505 bool alreadySorted =
false);
6506 void addData(
double key,
double value);
6507 void moveBelow(
QCPBars *bars);
6508 void moveAbove(
QCPBars *bars);
6513 virtual double selectTest(
const QPointF &pos,
6514 bool onlySelectable,
6531 double mStackingGap;
6536 virtual
void drawLegendIcon(
QCPPainter *painter,
6542 QRectF getBarRect(
double key,
double value) const;
6543 void getPixelWidth(
double key,
double &lower,
double &upper) const;
6544 double getStackedBaseValue(
double key,
bool positive) const;
6563 double lowerQuartile,
6565 double upperQuartile,
6567 const QVector<double> &outliers = QVector<double>());
6580 for (QVector<double>::const_iterator it = outliers.constBegin();
6581 it != outliers.constEnd(); ++it)
6586 double key, minimum, lowerQuartile, median, upperQuartile, maximum;
6608 Q_PROPERTY(
double width READ
width WRITE setWidth)
6609 Q_PROPERTY(
double whiskerWidth READ whiskerWidth WRITE setWhiskerWidth)
6610 Q_PROPERTY(QPen whiskerPen READ whiskerPen WRITE setWhiskerPen)
6611 Q_PROPERTY(QPen whiskerBarPen READ whiskerBarPen WRITE setWhiskerBarPen)
6612 Q_PROPERTY(
bool whiskerAntialiased READ whiskerAntialiased WRITE
6613 setWhiskerAntialiased)
6614 Q_PROPERTY(QPen medianPen READ medianPen WRITE setMedianPen)
6622 QSharedPointer<QCPStatisticalBoxDataContainer>
data()
const {
6623 return mDataContainer;
6634 void setData(QSharedPointer<QCPStatisticalBoxDataContainer>
data);
6635 void setData(
const QVector<double> &keys,
6636 const QVector<double> &minimum,
6637 const QVector<double> &lowerQuartile,
6638 const QVector<double> &median,
6639 const QVector<double> &upperQuartile,
6640 const QVector<double> &maximum,
6641 bool alreadySorted =
false);
6642 void setWidth(
double width);
6643 void setWhiskerWidth(
double width);
6644 void setWhiskerPen(
const QPen &pen);
6645 void setWhiskerBarPen(
const QPen &pen);
6646 void setWhiskerAntialiased(
bool enabled);
6647 void setMedianPen(
const QPen &pen);
6651 void addData(
const QVector<double> &keys,
6652 const QVector<double> &minimum,
6653 const QVector<double> &lowerQuartile,
6654 const QVector<double> &median,
6655 const QVector<double> &upperQuartile,
6656 const QVector<double> &maximum,
6657 bool alreadySorted =
false);
6658 void addData(
double key,
6660 double lowerQuartile,
6662 double upperQuartile,
6664 const QVector<double> &outliers = QVector<double>());
6669 virtual double selectTest(
const QPointF &pos,
6670 bool onlySelectable,
6683 double mWhiskerWidth;
6684 QPen mWhiskerPen, mWhiskerBarPen;
6685 bool mWhiskerAntialiased;
6691 virtual
void drawLegendIcon(
QCPPainter *painter,
6695 virtual
void drawStatisticalBox(
6701 void getVisibleDataBounds(
6704 QRectF getQuartileBox(
6706 QVector<QLineF> getWhiskerBackboneLines(
6708 QVector<QLineF> getWhiskerBarLines(
6736 double data(
double key,
double value);
6737 double cell(
int keyIndex,
int valueIndex);
6738 unsigned char alpha(
int keyIndex,
int valueIndex);
6741 void setSize(
int keySize,
int valueSize);
6742 void setKeySize(
int keySize);
6743 void setValueSize(
int valueSize);
6745 void setKeyRange(
const QCPRange &keyRange);
6746 void setValueRange(
const QCPRange &valueRange);
6747 void setData(
double key,
double value,
double z);
6748 void setCell(
int keyIndex,
int valueIndex,
double z);
6749 void setAlpha(
int keyIndex,
int valueIndex,
unsigned char alpha);
6752 void recalculateDataBounds();
6755 void fill(
double z);
6756 void fillAlpha(
unsigned char alpha);
6758 void coordToCell(
double key,
6761 int *valueIndex)
const;
6762 void cellToCoord(
int keyIndex,
6765 double *value)
const;
6779 bool createAlpha(
bool initializeOpaque =
true);
6787 Q_PROPERTY(
QCPRange dataRange READ dataRange WRITE setDataRange NOTIFY
6790 setDataScaleType NOTIFY dataScaleTypeChanged)
6791 Q_PROPERTY(
QCPColorGradient gradient READ gradient WRITE setGradient NOTIFY
6793 Q_PROPERTY(
bool interpolate READ interpolate WRITE setInterpolate)
6794 Q_PROPERTY(
bool tightBoundary READ tightBoundary WRITE setTightBoundary)
6795 Q_PROPERTY(
QCPColorScale *colorScale READ colorScale WRITE setColorScale)
6812 Q_SLOT
void setDataRange(
const QCPRange &dataRange);
6815 void setInterpolate(
bool enabled);
6816 void setTightBoundary(
bool enabled);
6820 void rescaleDataRange(
bool recalculateDataBounds =
false);
6821 Q_SLOT
void updateLegendIcon(
6822 Qt::TransformationMode transformMode = Qt::SmoothTransformation,
6823 const QSize &thumbSize = QSize(32, 18));
6826 virtual double selectTest(
const QPointF &pos,
6827 bool onlySelectable,
6839 void dataScaleTypeChanged(
QCPAxis::ScaleType scaleType);
6849 bool mTightBoundary;
6853 QImage mMapImage, mUndersampledMapImage;
6854 QPixmap mLegendIcon;
6855 bool mMapImageInvalidated;
6858 virtual
void updateMapImage();
6862 virtual
void drawLegendIcon(
QCPPainter *painter,
6878 double key,
double open,
double high,
double low,
double close);
6915 Q_PROPERTY(
ChartStyle chartStyle READ chartStyle WRITE setChartStyle)
6916 Q_PROPERTY(
double width READ
width WRITE setWidth)
6917 Q_PROPERTY(
WidthType widthType READ widthType WRITE setWidthType)
6918 Q_PROPERTY(
bool twoColored READ twoColored WRITE setTwoColored)
6919 Q_PROPERTY(QBrush brushPositive READ brushPositive WRITE setBrushPositive)
6920 Q_PROPERTY(QBrush brushNegative READ brushNegative WRITE setBrushNegative)
6921 Q_PROPERTY(QPen penPositive READ penPositive WRITE setPenPositive)
6922 Q_PROPERTY(QPen penNegative READ penNegative WRITE setPenNegative)
6957 QSharedPointer<QCPFinancialDataContainer>
data()
const {
6958 return mDataContainer;
6970 void setData(QSharedPointer<QCPFinancialDataContainer>
data);
6971 void setData(
const QVector<double> &keys,
6972 const QVector<double> &open,
6973 const QVector<double> &high,
6974 const QVector<double> &low,
6975 const QVector<double> &close,
6976 bool alreadySorted =
false);
6977 void setChartStyle(ChartStyle style);
6978 void setWidth(
double width);
6979 void setWidthType(WidthType widthType);
6980 void setTwoColored(
bool twoColored);
6981 void setBrushPositive(
const QBrush &brush);
6982 void setBrushNegative(
const QBrush &brush);
6983 void setPenPositive(
const QPen &pen);
6984 void setPenNegative(
const QPen &pen);
6987 void addData(
const QVector<double> &keys,
6988 const QVector<double> &open,
6989 const QVector<double> &high,
6990 const QVector<double> &low,
6991 const QVector<double> &close,
6992 bool alreadySorted =
false);
6994 double key,
double open,
double high,
double low,
double close);
6999 virtual double selectTest(
const QPointF &pos,
7000 bool onlySelectable,
7012 const QVector<
double> &time,
7013 const QVector<
double> &value,
7015 double timeBinOffset = 0);
7023 QBrush mBrushPositive, mBrushNegative;
7024 QPen mPenPositive, mPenNegative;
7028 virtual
void drawLegendIcon(
QCPPainter *painter,
7036 void drawCandlestickPlot(
7041 double getPixelWidth(
double key,
double keyPixel) const;
7042 double ohlcSelectTest(
7047 double candlestickSelectTest(
7052 void getVisibleDataBounds(
7099 Q_PROPERTY(QSharedPointer<QCPErrorBarsDataContainer>
data READ
data WRITE
7103 Q_PROPERTY(
ErrorType errorType READ errorType WRITE setErrorType)
7104 Q_PROPERTY(
double whiskerWidth READ whiskerWidth WRITE setWhiskerWidth)
7105 Q_PROPERTY(
double symbolGap READ symbolGap WRITE setSymbolGap)
7127 QSharedPointer<QCPErrorBarsDataContainer>
data()
const {
7128 return mDataContainer;
7131 return mDataPlottable.data();
7138 void setData(QSharedPointer<QCPErrorBarsDataContainer>
data);
7139 void setData(
const QVector<double> &error);
7140 void setData(
const QVector<double> &errorMinus,
7141 const QVector<double> &errorPlus);
7143 void setErrorType(ErrorType
type);
7144 void setWhiskerWidth(
double pixels);
7145 void setSymbolGap(
double pixels);
7148 void addData(
const QVector<double> &error);
7149 void addData(
const QVector<double> &errorMinus,
7150 const QVector<double> &errorPlus);
7151 void addData(
double error);
7152 void addData(
double errorMinus,
double errorPlus);
7164 virtual
int findBegin(
double sortKey,
7166 virtual
int findEnd(
double sortKey,
7170 virtual
double selectTest(const QPointF &pos,
7171 bool onlySelectable,
7187 virtual void drawLegendIcon(
QCPPainter *painter,
7199 QVector<QLineF> &backbones,
7200 QVector<QLineF> &whiskers) const;
7204 double pointDistance(
7205 const QPointF &pixelPoint,
7208 void getDataSegments(QList<
QCPDataRange> &selectedSegments,
7210 bool errorBarVisible(
int index) const;
7211 bool rectIntersectsLine(const QRectF &pixelRect, const QLineF &line) const;
7225 Q_PROPERTY(QPen pen READ pen WRITE setPen)
7226 Q_PROPERTY(QPen selectedPen READ selectedPen WRITE setSelectedPen)
7233 QPen
pen()
const {
return mPen; }
7237 void setPen(
const QPen &pen);
7238 void setSelectedPen(
const QPen &pen);
7241 virtual double selectTest(
const QPointF &pos,
7242 bool onlySelectable,
7250 QPen mPen, mSelectedPen;
7256 QLineF getRectClippedStraightLine(const
QCPVector2D &point1,
7258 const QRect &rect) const;
7259 QPen mainPen() const;
7270 Q_PROPERTY(QPen pen READ pen WRITE setPen)
7271 Q_PROPERTY(QPen selectedPen READ selectedPen WRITE setSelectedPen)
7280 QPen
pen()
const {
return mPen; }
7286 void setPen(
const QPen &pen);
7287 void setSelectedPen(
const QPen &pen);
7292 virtual double selectTest(
const QPointF &pos,
7293 bool onlySelectable,
7301 QPen mPen, mSelectedPen;
7308 QLineF getRectClippedLine(const
QCPVector2D &start,
7310 const QRect &rect) const;
7311 QPen mainPen() const;
7322 Q_PROPERTY(QPen pen READ pen WRITE setPen)
7323 Q_PROPERTY(QPen selectedPen READ selectedPen WRITE setSelectedPen)
7332 QPen
pen()
const {
return mPen; }
7338 void setPen(
const QPen &pen);
7339 void setSelectedPen(
const QPen &pen);
7344 virtual double selectTest(
const QPointF &pos,
7345 bool onlySelectable,
7355 QPen mPen, mSelectedPen;
7362 QPen mainPen() const;
7373 Q_PROPERTY(QPen pen READ pen WRITE setPen)
7374 Q_PROPERTY(QPen selectedPen READ selectedPen WRITE setSelectedPen)
7375 Q_PROPERTY(QBrush brush READ brush WRITE setBrush)
7376 Q_PROPERTY(QBrush selectedBrush READ selectedBrush WRITE setSelectedBrush)
7383 QPen
pen()
const {
return mPen; }
7389 void setPen(
const QPen &pen);
7390 void setSelectedPen(
const QPen &pen);
7391 void setBrush(
const QBrush &brush);
7392 void setSelectedBrush(
const QBrush &brush);
7395 virtual double selectTest(
const QPointF &pos,
7396 bool onlySelectable,
7424 virtual QPointF anchorPixelPosition(
int anchorId)
const Q_DECL_OVERRIDE;
7427 QPen mainPen()
const;
7428 QBrush mainBrush()
const;
7440 Q_PROPERTY(QColor selectedColor READ selectedColor WRITE setSelectedColor)
7441 Q_PROPERTY(QPen pen READ pen WRITE setPen)
7442 Q_PROPERTY(QPen selectedPen READ selectedPen WRITE setSelectedPen)
7443 Q_PROPERTY(QBrush brush READ brush WRITE setBrush)
7444 Q_PROPERTY(QBrush selectedBrush READ selectedBrush WRITE setSelectedBrush)
7445 Q_PROPERTY(QFont font READ font WRITE setFont)
7446 Q_PROPERTY(QFont selectedFont READ selectedFont WRITE setSelectedFont)
7447 Q_PROPERTY(QString text READ text WRITE setText)
7448 Q_PROPERTY(
Qt::Alignment positionAlignment READ positionAlignment WRITE
7449 setPositionAlignment)
7450 Q_PROPERTY(
Qt::Alignment textAlignment READ textAlignment WRITE
7453 Q_PROPERTY(QMargins padding READ padding WRITE setPadding)
7462 QPen
pen()
const {
return mPen; }
7466 QFont
font()
const {
return mFont; }
7468 QString
text()
const {
return mText; }
7476 void setSelectedColor(
const QColor &
color);
7477 void setPen(
const QPen &pen);
7478 void setSelectedPen(
const QPen &pen);
7479 void setBrush(
const QBrush &brush);
7480 void setSelectedBrush(
const QBrush &brush);
7481 void setFont(
const QFont &font);
7482 void setSelectedFont(
const QFont &font);
7483 void setText(
const QString &text);
7486 void setRotation(
double degrees);
7487 void setPadding(
const QMargins &padding);
7490 virtual double selectTest(
const QPointF &pos,
7491 bool onlySelectable,
7529 virtual QPointF anchorPixelPosition(
int anchorId)
const Q_DECL_OVERRIDE;
7532 QPointF getTextDrawPoint(
const QPointF &pos,
7535 QFont mainFont()
const;
7536 QColor mainColor()
const;
7537 QPen mainPen()
const;
7538 QBrush mainBrush()
const;
7549 Q_PROPERTY(QPen pen READ pen WRITE setPen)
7550 Q_PROPERTY(QPen selectedPen READ selectedPen WRITE setSelectedPen)
7551 Q_PROPERTY(QBrush brush READ brush WRITE setBrush)
7552 Q_PROPERTY(QBrush selectedBrush READ selectedBrush WRITE setSelectedBrush)
7559 QPen
pen()
const {
return mPen; }
7565 void setPen(
const QPen &pen);
7566 void setSelectedPen(
const QPen &pen);
7567 void setBrush(
const QBrush &brush);
7568 void setSelectedBrush(
const QBrush &brush);
7571 virtual double selectTest(
const QPointF &pos,
7572 bool onlySelectable,
7606 virtual QPointF anchorPixelPosition(
int anchorId)
const Q_DECL_OVERRIDE;
7609 QPen mainPen()
const;
7610 QBrush mainBrush()
const;
7621 Q_PROPERTY(QPixmap pixmap READ pixmap WRITE setPixmap)
7622 Q_PROPERTY(
bool scaled READ scaled WRITE setScaled)
7623 Q_PROPERTY(Qt::AspectRatioMode aspectRatioMode READ aspectRatioMode)
7625 Qt::TransformationMode transformationMode READ transformationMode)
7626 Q_PROPERTY(QPen pen READ pen WRITE setPen)
7627 Q_PROPERTY(QPen selectedPen READ selectedPen WRITE setSelectedPen)
7638 return mTransformationMode;
7640 QPen
pen()
const {
return mPen; }
7644 void setPixmap(
const QPixmap &pixmap);
7645 void setScaled(
bool scaled,
7646 Qt::AspectRatioMode aspectRatioMode = Qt::KeepAspectRatio,
7647 Qt::TransformationMode transformationMode =
7648 Qt::SmoothTransformation);
7649 void setPen(
const QPen &pen);
7650 void setSelectedPen(
const QPen &pen);
7653 virtual double selectTest(
const QPointF &pos,
7654 bool onlySelectable,
7687 virtual QPointF anchorPixelPosition(
int anchorId)
const Q_DECL_OVERRIDE;
7690 void updateScaledPixmap(QRect finalRect = QRect(),
7691 bool flipHorz =
false,
7692 bool flipVert =
false);
7693 QRect getFinalRect(
bool *flippedHorz = 0,
bool *flippedVert = 0)
const;
7694 QPen mainPen()
const;
7705 Q_PROPERTY(QPen pen READ pen WRITE setPen)
7706 Q_PROPERTY(QPen selectedPen READ selectedPen WRITE setSelectedPen)
7707 Q_PROPERTY(QBrush brush READ brush WRITE setBrush)
7708 Q_PROPERTY(QBrush selectedBrush READ selectedBrush WRITE setSelectedBrush)
7709 Q_PROPERTY(
double size READ
size WRITE setSize)
7710 Q_PROPERTY(
TracerStyle style READ style WRITE setStyle)
7711 Q_PROPERTY(
QCPGraph *graph READ graph WRITE setGraph)
7712 Q_PROPERTY(
double graphKey READ graphKey WRITE setGraphKey)
7713 Q_PROPERTY(
bool interpolating READ interpolating WRITE setInterpolating)
7734 Q_ENUMS(TracerStyle)
7740 QPen
pen()
const {
return mPen; }
7744 double size()
const {
return mSize; }
7751 void setPen(
const QPen &pen);
7752 void setSelectedPen(
const QPen &pen);
7753 void setBrush(
const QBrush &brush);
7754 void setSelectedBrush(
const QBrush &brush);
7755 void setSize(
double size);
7756 void setStyle(TracerStyle style);
7758 void setGraphKey(
double key);
7759 void setInterpolating(
bool enabled);
7762 virtual double selectTest(
const QPointF &pos,
7763 bool onlySelectable,
7767 void updatePosition();
7773 QPen mPen, mSelectedPen;
7774 QBrush mBrush, mSelectedBrush;
7779 bool mInterpolating;
7785 QPen mainPen() const;
7786 QBrush mainBrush() const;
7798 Q_PROPERTY(QPen pen READ pen WRITE setPen)
7799 Q_PROPERTY(QPen selectedPen READ selectedPen WRITE setSelectedPen)
7800 Q_PROPERTY(
double length READ length WRITE setLength)
7801 Q_PROPERTY(
BracketStyle style READ style WRITE setStyle)
7820 Q_ENUMS(BracketStyle)
7826 QPen
pen()
const {
return mPen; }
7832 void setPen(
const QPen &pen);
7833 void setSelectedPen(
const QPen &pen);
7834 void setLength(
double length);
7835 void setStyle(BracketStyle style);
7838 virtual double selectTest(
const QPointF &pos,
7839 bool onlySelectable,
7855 virtual QPointF anchorPixelPosition(
int anchorId)
const Q_DECL_OVERRIDE;
7858 QPen mainPen()
const;
filament::Texture::InternalFormat format
const QCPVector2D operator+(const QCPVector2D &vec1, const QCPVector2D &vec2)
QCPDataContainer< QCPGraphData > QCPGraphDataContainer
QCPDataContainer< QCPBarsData > QCPBarsDataContainer
QCPDataContainer< QCPStatisticalBoxData > QCPStatisticalBoxDataContainer
QVector< QCPErrorBarsData > QCPErrorBarsDataContainer
const QCPVector2D operator-(const QCPVector2D &vec1, const QCPVector2D &vec2)
const QCPVector2D operator/(const QCPVector2D &vec, double divisor)
const QCPVector2D operator*(double factor, const QCPVector2D &vec)
QCPDataContainer< QCPCurveData > QCPCurveDataContainer
Q_DECLARE_TYPEINFO(QCPVector2D, Q_MOVABLE_TYPE)
QCPDataContainer< QCPFinancialData > QCPFinancialDataContainer
The abstract base class for all items in a plot.
QList< QCPItemAnchor * > mAnchors
QPointer< QCPAxisRect > mClipAxisRect
QList< QCPItemPosition * > mPositions
bool clipToAxisRect() const
void selectableChanged(bool selectable)
QList< QCPItemAnchor * > anchors() const
virtual double selectTest(const QPointF &pos, bool onlySelectable, QVariant *details=0) const =0
void selectionChanged(bool selected)
The abstract base class for all entries in a QCPLegend.
QColor selectedTextColor() const
QCPLegend * parentLegend() const
QFont selectedFont() const
The abstract base class for paint buffers, which define the rendering backend.
virtual void donePainting()
virtual void clear(const QColor &color)=0
virtual QCPPainter * startPainting()=0
double devicePixelRatio() const
virtual void reallocateBuffer()=0
virtual void draw(QCPPainter *painter) const =0
A template base class for plottables with one-dimensional data.
virtual bool sortKeyIsMainKey() const
virtual double selectTest(const QPointF &pos, bool onlySelectable, QVariant *details=0) const
virtual double dataMainValue(int index) const
virtual QPointF dataPixelPosition(int index) const
QCPAbstractPlottable1D(QCPAxis *keyAxis, QCPAxis *valueAxis)
virtual int dataCount() const
virtual double dataSortKey(int index) const
void drawPolyline(QCPPainter *painter, const QVector< QPointF > &lineData) const
virtual double dataMainKey(int index) const
QSharedPointer< QCPDataContainer< DataType > > mDataContainer
virtual QCPDataSelection selectTestRect(const QRectF &rect, bool onlySelectable) const
virtual QCPRange dataValueRange(int index) const
virtual int findEnd(double sortKey, bool expandedRange=true) const
virtual int findBegin(double sortKey, bool expandedRange=true) const
void getDataSegments(QList< QCPDataRange > &selectedSegments, QList< QCPDataRange > &unselectedSegments) const
virtual ~QCPAbstractPlottable1D()
The abstract base class for all data representing objects in a plot.
QCP::SelectionType selectable() const
bool antialiasedFill() const
QCPDataSelection selection() const
QCPSelectionDecorator * mSelectionDecorator
QCPDataSelection mSelection
QCPAxis * keyAxis() const
virtual double selectTest(const QPointF &pos, bool onlySelectable, QVariant *details=0) const =0
QCP::SelectionType mSelectable
void selectionChanged(bool selected)
virtual QCPRange getKeyRange(bool &foundRange, QCP::SignDomain inSignDomain=QCP::sdBoth) const =0
virtual QCPRange getValueRange(bool &foundRange, QCP::SignDomain inSignDomain=QCP::sdBoth, const QCPRange &inKeyRange=QCPRange()) const =0
void selectableChanged(QCP::SelectionType selectable)
QCPSelectionDecorator * selectionDecorator() const
void selectionChanged(const QCPDataSelection &selection)
bool antialiasedScatters() const
QPointer< QCPAxis > mKeyAxis
QCPAxis * valueAxis() const
Holds multiple axes and arranges them in a rectangular shape.
bool backgroundScaled() const
Qt::AspectRatioMode backgroundScaledMode() const
virtual void update(UpdatePhase phase)
QList< QCPRange > mDragStartHorzRange
QPoint bottomRight() const
QPixmap mBackgroundPixmap
virtual void mouseMoveEvent(QMouseEvent *event, const QPointF &startPos)
virtual void mousePressEvent(QMouseEvent *event, const QVariant &details)
QPixmap background() const
virtual void wheelEvent(QWheelEvent *event)
QBrush backgroundBrush() const
Qt::AspectRatioMode mBackgroundScaledMode
QCPLayoutInset * insetLayout() const
virtual void mouseReleaseEvent(QMouseEvent *event, const QPointF &startPos)
Qt::Orientations rangeZoom() const
QList< QPointer< QCPAxis > > mRangeZoomHorzAxis
Qt::Orientations rangeDrag() const
QCP::AntialiasedElements mAADragBackup
QPixmap mScaledBackgroundPixmap
Qt::Orientations mRangeDrag
QPoint bottomLeft() const
QList< QPointer< QCPAxis > > mRangeDragHorzAxis
double mRangeZoomFactorHorz
QHash< QCPAxis::AxisType, QList< QCPAxis * > > mAxes
virtual int calculateAutoMargin(QCP::MarginSide side)
QCPLayoutInset * mInsetLayout
Specialized axis ticker for calendar dates and times as axis ticks.
Qt::TimeSpec mDateTimeSpec
QString dateTimeFormat() const
Qt::TimeSpec dateTimeSpec() const
Specialized axis ticker with a fixed tick step.
ScaleStrategy scaleStrategy() const
ScaleStrategy mScaleStrategy
Specialized axis ticker suited for logarithmic axes.
Specialized axis ticker to display ticks in units of an arbitrary constant, for example pi.
FractionStyle mFractionStyle
FractionStyle fractionStyle() const
Specialized axis ticker which allows arbitrary labels at specified coordinates.
QMap< double, QString > mTicks
QMap< double, QString > & ticks()
Specialized axis ticker for time spans in units of milliseconds to days.
QHash< TimeUnit, int > mFieldWidth
int fieldWidth(TimeUnit unit) const
QString timeFormat() const
QHash< TimeUnit, QString > mFormatPattern
The base class tick generator used by QCPAxis to create tick positions and tick labels.
TickStepStrategy tickStepStrategy() const
TickStepStrategy mTickStepStrategy
double tickOrigin() const
Manages a single axis inside a QCustomPlot.
Qt::Orientation mOrientation
QColor labelColor() const
void rangeChanged(const QCPRange &newRange)
QFont selectedTickLabelFont() const
QFont tickLabelFont() const
QPen selectedBasePen() const
QFont selectedLabelFont() const
QVector< double > mSubTickVector
QVector< QString > tickVectorLabels() const
SelectableParts selectableParts() const
int numberPrecision() const
void scaleTypeChanged(QCPAxis::ScaleType scaleType)
QLatin1Char mNumberFormatChar
QColor mSelectedTickLabelColor
int pixelOrientation() const
QFont mSelectedTickLabelFont
QVector< double > tickVector() const
void selectionChanged(const QCPAxis::SelectableParts &parts)
QVector< double > mTickVector
QCPAxisPainterPrivate * mAxisPainter
QPen selectedSubTickPen() const
QColor selectedTickLabelColor() const
QPen selectedTickPen() const
QColor selectedLabelColor() const
QSharedPointer< QCPAxisTicker > ticker() const
Q_SLOT void setSelectedParts(const QCPAxis::SelectableParts &selectedParts)
SelectableParts selectedParts() const
static Qt::Orientation orientation(AxisType type)
QCP::AntialiasedElements mAADragBackup
QColor tickLabelColor() const
AxisType axisType() const
void selectableChanged(const QCPAxis::SelectableParts &parts)
void rangeChanged(const QCPRange &newRange, const QCPRange &oldRange)
Q_SLOT void setSelectableParts(const QCPAxis::SelectableParts &selectableParts)
SelectableParts mSelectableParts
bool rangeReversed() const
const QCPRange range() const
QVector< QString > mTickVectorLabels
ScaleType scaleType() const
QSharedPointer< QCPAxisTicker > mTicker
bool mNumberBeautifulPowers
QCPAxisRect * axisRect() const
Holds the data of one single data point (one bar) for QCPBars.
QCPRange valueRange() const
static QCPBarsData fromSortKey(double sortKey)
static bool sortKeyIsMainKey()
Groups multiple QCPBars together so they appear side by side.
QCustomPlot * mParentPlot
QList< QCPBars * > bars() const
SpacingType spacingType() const
bool contains(QCPBars *bars) const
A plottable representing a bar chart in a plot.
QCPBars * barBelow() const
double stackingGap() const
WidthType widthType() const
QCPBarsGroup * barsGroup() const
QSharedPointer< QCPBarsDataContainer > data() const
QCPBars * barAbove() const
Defines a color gradient for use with e.g. QCPColorMap.
ColorInterpolation mColorInterpolation
QMap< double, QColor > mColorStops
QMap< double, QColor > colorStops() const
bool mColorBufferInvalidated
ColorInterpolation colorInterpolation() const
bool operator!=(const QCPColorGradient &other) const
QVector< QRgb > mColorBuffer
Holds the two-dimensional data of a QCPColorMap plottable.
QCPRange keyRange() const
QCPRange valueRange() const
QCPRange dataBounds() const
A plottable representing a two-dimensional color map in a plot.
QCPColorMapData * data() const
bool tightBoundary() const
QCPColorScale * colorScale() const
QCPAxis::ScaleType dataScaleType() const
QCPColorGradient gradient() const
QCPRange dataRange() const
A color scale for use with color coding data such as QCPColorMap.
QCPAxis::ScaleType mDataScaleType
QCPColorGradient gradient() const
QCPRange dataRange() const
QPointer< QCPColorScaleAxisRectPrivate > mAxisRect
void gradientChanged(const QCPColorGradient &newGradient)
void dataScaleTypeChanged(QCPAxis::ScaleType scaleType)
void dataRangeChanged(const QCPRange &newRange)
QCPAxis::AxisType type() const
QPointer< QCPAxis > mColorAxis
QCPAxis::ScaleType dataScaleType() const
QCPColorGradient mGradient
Holds the data of one single data point for QCPCurve.
static bool sortKeyIsMainKey()
static QCPCurveData fromSortKey(double sortKey)
QCPRange valueRange() const
A plottable representing a parametric curve in a plot.
LineStyle lineStyle() const
QSharedPointer< QCPCurveDataContainer > data() const
QCPScatterStyle scatterStyle() const
The generic data container for one-dimensional plottables.
QVector< DataType >::iterator iterator
QVector< DataType >::const_iterator const_iterator
void setAutoSqueeze(bool enabled)
const_iterator findBegin(double sortKey, bool expandedRange=true) const
QCPRange valueRange(bool &foundRange, QCP::SignDomain signDomain=QCP::sdBoth, const QCPRange &inKeyRange=QCPRange())
void add(const QCPDataContainer< DataType > &data)
QVector< DataType > mData
bool qcpLessThanSortKey(const DataType &a, const DataType &b)
void squeeze(bool preAllocation=true, bool postAllocation=true)
void performAutoSqueeze()
void limitIteratorsToDataRange(const_iterator &begin, const_iterator &end, const QCPDataRange &dataRange) const
void removeBefore(double sortKey)
const_iterator constEnd() const
void preallocateGrow(int minimumPreallocSize)
QCPRange keyRange(bool &foundRange, QCP::SignDomain signDomain=QCP::sdBoth)
void removeAfter(double sortKey)
void remove(double sortKeyFrom, double sortKeyTo)
void set(const QCPDataContainer< DataType > &data)
const_iterator at(int index) const
QCPDataRange dataRange() const
const_iterator findEnd(double sortKey, bool expandedRange=true) const
const_iterator constBegin() const
Describes a data range given by begin and end index.
QCPDataRange adjusted(int changeBegin, int changeEnd) const
QDebug operator<<(QDebug d, const QCPDataRange &dataRange)
bool operator!=(const QCPDataRange &other) const
bool operator==(const QCPDataRange &other) const
QCPDataRange bounded(const QCPDataRange &other) const
Describes a data set by holding multiple QCPDataRange instances.
void addDataRange(const QCPDataRange &dataRange, bool simplify=true)
QCPDataRange dataRange(int index=0) const
bool operator!=(const QCPDataSelection &other) const
int dataRangeCount() const
QList< QCPDataRange > dataRanges() const
QCPDataSelection inverse(const QCPDataRange &outerRange) const
QDebug operator<<(QDebug d, const QCPDataSelection &selection)
Holds the data of one single error bar for QCPErrorBars.
A plottable that adds a set of error bars to other plottables.
QPointer< QCPAbstractPlottable > mDataPlottable
ErrorType errorType() const
QSharedPointer< QCPErrorBarsDataContainer > mDataContainer
QCPAbstractPlottable * dataPlottable() const
double whiskerWidth() const
QSharedPointer< QCPErrorBarsDataContainer > data() const
Holds the data of one single data point for QCPFinancial.
static bool sortKeyIsMainKey()
QCPRange valueRange() const
static QCPFinancialData fromSortKey(double sortKey)
A plottable representing a financial stock chart.
ChartStyle chartStyle() const
QSharedPointer< QCPFinancialDataContainer > data() const
WidthType widthType() const
QBrush brushNegative() const
QBrush brushPositive() const
Holds the data of one single data point for QCPGraph.
static bool sortKeyIsMainKey()
QCPRange valueRange() const
static QCPGraphData fromSortKey(double sortKey)
A plottable representing a graph in a plot.
bool adaptiveSampling() const
QCPScatterStyle scatterStyle() const
QCPGraph * channelFillGraph() const
LineStyle lineStyle() const
QSharedPointer< QCPGraphDataContainer > data() const
Responsible for drawing the grid of a QCPAxis.
bool antialiasedZeroLine() const
bool antialiasedSubGrid() const
bool subGridVisible() const
An anchor of an item to which positions can be attached to.
QCPAbstractItem * mParentItem
QCustomPlot * mParentPlot
virtual QCPItemPosition * toQCPItemPosition()
QSet< QCPItemPosition * > mChildrenX
A bracket for referencing/highlighting certain parts in the plot.
BracketStyle style() const
A curved line from one point to another.
QCPLineEnding head() const
QCPLineEnding tail() const
QBrush selectedBrush() const
A line from one point to another.
QCPLineEnding head() const
QCPLineEnding tail() const
bool mScaledPixmapInvalidated
Qt::AspectRatioMode aspectRatioMode() const
Qt::AspectRatioMode mAspectRatioMode
Qt::TransformationMode transformationMode() const
Qt::TransformationMode mTransformationMode
Manages the position of an item.
QCPItemAnchor * parentAnchor() const
PositionType typeX() const
QCPAxis * valueAxis() const
QCPItemAnchor * parentAnchorX() const
QCPAxis * keyAxis() const
QCPItemAnchor * parentAnchorY() const
PositionType type() const
PositionType typeY() const
QBrush selectedBrush() const
A straight line that spans infinitely in both directions.
Qt::Alignment positionAlignment() const
QBrush selectedBrush() const
Qt::Alignment mPositionAlignment
QColor selectedColor() const
QFont selectedFont() const
Qt::Alignment textAlignment() const
Qt::Alignment mTextAlignment
Item that sticks to QCPGraph data points.
QBrush selectedBrush() const
bool interpolating() const
TracerStyle style() const
A layer that may contain objects, to control the rendering order.
QList< QCPLayerable * > mChildren
QList< QCPLayerable * > children() const
QCustomPlot * parentPlot() const
QCustomPlot * mParentPlot
QWeakPointer< QCPAbstractPaintBuffer > mPaintBuffer
Base class for all drawable objects.
virtual void applyDefaultAntialiasingHint(QCPPainter *painter) const =0
QCustomPlot * mParentPlot
QCustomPlot * parentPlot() const
QCPLayerable * parentLayerable() const
void layerChanged(QCPLayer *newLayer)
virtual void draw(QCPPainter *painter)=0
QPointer< QCPLayerable > mParentLayerable
The abstract base class for all objects that form the layout system.
QCP::MarginSides autoMargins() const
QCPLayout * layout() const
virtual void draw(QCPPainter *painter)
QMargins minimumMargins() const
QSize minimumSize() const
SizeConstraintRect sizeConstraintRect() const
QHash< QCP::MarginSide, QCPMarginGroup * > marginGroups() const
QCPMarginGroup * marginGroup(QCP::MarginSide side) const
QSize maximumSize() const
A layout that arranges child elements in a grid.
FillOrder fillOrder() const
QList< double > columnStretchFactors() const
QList< double > rowStretchFactors() const
int columnSpacing() const
A layout that places child elements aligned to the border or arbitrarily positioned.
The abstract base class for layouts.
virtual int elementCount() const =0
virtual QCPLayoutElement * takeAt(int index)=0
virtual bool take(QCPLayoutElement *element)=0
virtual QCPLayoutElement * elementAt(int index) const =0
Manages a legend inside a QCustomPlot.
int iconTextPadding() const
QFont selectedFont() const
QPen iconBorderPen() const
QBrush selectedBrush() const
QColor selectedTextColor() const
SelectableParts selectableParts() const
QPen selectedIconBorderPen() const
QPen selectedBorderPen() const
Handles the different ending decorations for line-like items.
EndingStyle style() const
A margin group allows synchronization of margin sides if working with multiple layout elements.
QList< QCPLayoutElement * > elements(QCP::MarginSide side) const
QCustomPlot * mParentPlot
QHash< QCP::MarginSide, QList< QCPLayoutElement * > > mChildren
A paint buffer based on QPixmap, using software raster rendering.
QPainter subclass used internally.
void drawLine(const QLineF &line)
QStack< bool > mAntialiasingStack
bool antialiasing() const
void setModes(PainterModes modes)
void drawLine(const QPointF &p1, const QPointF &p2)
PainterModes modes() const
Defines an abstract interface for one-dimensional plottables.
virtual int dataCount() const =0
virtual bool sortKeyIsMainKey() const =0
virtual double dataMainKey(int index) const =0
virtual int findBegin(double sortKey, bool expandedRange=true) const =0
virtual int findEnd(double sortKey, bool expandedRange=true) const =0
virtual QCPDataSelection selectTestRect(const QRectF &rect, bool onlySelectable) const =0
virtual QPointF dataPixelPosition(int index) const =0
virtual ~QCPPlottableInterface1D()
virtual QCPRange dataValueRange(int index) const =0
virtual double dataMainValue(int index) const =0
virtual double dataSortKey(int index) const =0
A legend item representing a plottable with an icon and the plottable name.
QCPAbstractPlottable * mPlottable
QCPAbstractPlottable * plottable()
Represents the range an axis is encompassing.
static const double maxRange
bool operator!=(const QCPRange &other) const
QCPRange & operator/=(const double &value)
QCPRange & operator*=(const double &value)
QCPRange & operator-=(const double &value)
static const double minRange
bool operator==(const QCPRange &other) const
QDebug operator<<(QDebug d, const QCPRange &range)
bool contains(double value) const
QCPRange & operator+=(const double &value)
Represents the visual appearance of scatter points.
bool isPenDefined() const
@ spPen
0x01 The pen property, see setPen
QPainterPath customPath() const
ScatterShape shape() const
A selection decorator which draws brackets around each selected data segment.
BracketStyle bracketStyle() const
bool tangentToData() const
int tangentAverage() const
int bracketHeight() const
BracketStyle mBracketStyle
QBrush bracketBrush() const
Controls how a plottable's data selection is drawn.
QCPAbstractPlottable * mPlottable
QCPScatterStyle mScatterStyle
QCPScatterStyle scatterStyle() const
QCPScatterStyle::ScatterProperties usedScatterProperties() const
QCPScatterStyle::ScatterProperties mUsedScatterProperties
Provides rect/rubber-band data selection and range zoom interaction.
void accepted(const QRect &rect, QMouseEvent *event)
void changed(const QRect &rect, QMouseEvent *event)
void started(QMouseEvent *event)
void canceled(const QRect &rect, QInputEvent *event)
Holds the data of one single data point for QCPStatisticalBox.
QCPRange valueRange() const
static bool sortKeyIsMainKey()
static QCPStatisticalBoxData fromSortKey(double sortKey)
QVector< double > outliers
A plottable representing a single statistical box in a plot.
bool whiskerAntialiased() const
QPen whiskerBarPen() const
QSharedPointer< QCPStatisticalBoxDataContainer > data() const
double whiskerWidth() const
QCPScatterStyle outlierStyle() const
A layout element displaying a text.
QFont selectedFont() const
QColor selectedTextColor() const
Represents two doubles as a mathematical 2D vector.
QCPVector2D perpendicular() const
double dot(const QCPVector2D &vec) const
QDebug operator<<(QDebug d, const QCPVector2D &vec)
double lengthSquared() const
The central class of the library. This is the QWidget which displays the plot and interacts with the ...
void legendDoubleClick(QCPLegend *legend, QCPAbstractLegendItem *item, QMouseEvent *event)
QPixmap mScaledBackgroundPixmap
Qt::KeyboardModifier mMultiSelectModifier
QList< QCPGraph * > mGraphs
QPointer< QCPLayerable > mMouseEventLayerable
Qt::KeyboardModifier multiSelectModifier() const
const QCP::Interactions interactions() const
QVariant mMouseSignalLayerableDetails
QCPSelectionRect * mSelectionRect
void selectionChangedByUser()
double bufferDevicePixelRatio() const
int selectionTolerance() const
QList< QSharedPointer< QCPAbstractPaintBuffer > > mPaintBuffers
QPixmap background() const
QCP::AntialiasedElements antialiasedElements() const
double mBufferDevicePixelRatio
void axisDoubleClick(QCPAxis *axis, QCPAxis::SelectablePart part, QMouseEvent *event)
QCP::SelectionRectMode selectionRectMode() const
void mouseMove(QMouseEvent *event)
QCP::AntialiasedElements notAntialiasedElements() const
QList< QCPAbstractItem * > mItems
void legendClick(QCPLegend *legend, QCPAbstractLegendItem *item, QMouseEvent *event)
void plottableDoubleClick(QCPAbstractPlottable *plottable, int dataIndex, QMouseEvent *event)
void mouseDoubleClick(QMouseEvent *event)
QCP::PlottingHints mPlottingHints
QCP::AntialiasedElements mAntialiasedElements
bool backgroundScaled() const
QList< QCPAbstractPlottable * > mPlottables
bool mAutoAddPlottableToLegend
bool mOpenGlCacheLabelsBackup
Qt::AspectRatioMode mBackgroundScaledMode
QCPLayoutGrid * mPlotLayout
QCP::SelectionRectMode mSelectionRectMode
void axisClick(QCPAxis *axis, QCPAxis::SelectablePart part, QMouseEvent *event)
bool autoAddPlottableToLegend() const
QCP::PlottingHints plottingHints() const
void mouseWheel(QWheelEvent *event)
void itemDoubleClick(QCPAbstractItem *item, QMouseEvent *event)
bool mNoAntialiasingOnDrag
void mouseRelease(QMouseEvent *event)
bool noAntialiasingOnDrag() const
void mousePress(QMouseEvent *event)
QList< QCPLayer * > mLayers
QVariant mMouseEventLayerableDetails
QCP::Interactions mInteractions
QCPSelectionRect * selectionRect() const
QCP::AntialiasedElements mOpenGlAntialiasedElementsBackup
QPointer< QCPLayerable > mMouseSignalLayerable
void itemClick(QCPAbstractItem *item, QMouseEvent *event)
QPixmap mBackgroundPixmap
QCPLayoutGrid * plotLayout() const
void plottableClick(QCPAbstractPlottable *plottable, int dataIndex, QMouseEvent *event)
Qt::AspectRatioMode backgroundScaledMode() const
Q_DECLARE_METATYPE(ccPclPluginInterface *)
bool isInvalidData(double value)
const QMetaObject staticMetaObject
int getMarginValue(const QMargins &margins, QCP::MarginSide side)
@ phNone
0x000 No hints are set
@ ruDotsPerMeter
Resolution is given in dots per meter (dpm)
@ ruDotsPerInch
Resolution is given in dots per inch (DPI/PPI)
@ msRight
0x02 right margin
@ msBottom
0x08 bottom margin
@ stNone
The plottable is not selectable.
@ stSingleData
One individual data point can be selected at a time.
@ aeAxes
0x0001 Axis base line and tick marks
@ aeItems
0x0040 Main lines of items
@ aeLegendItems
0x0010 Legend items
@ aePlottables
0x0020 Main lines of plottables
@ aeNone
0x0000 No elements
@ aeSubGrid
0x0004 Sub grid lines
@ aeAll
0xFFFF All elements
@ aeGrid
0x0002 Grid lines
@ aeLegend
0x0008 Legend box
void setMarginValue(QMargins &margins, QCP::MarginSide side, int value)
@ sdNegative
The negative sign domain, i.e. numbers smaller than zero.
@ sdPositive
The positive sign domain, i.e. numbers greater than zero.
@ sdBoth
Both sign domains, including zero, i.e. all numbers.
bool setColor(ccHObject::Container selectedEntities, bool colorize, QWidget *parent)
void operator/=(MiniVec< T, N > &a, const MiniVec< T, N > &b)
void operator*=(MiniVec< T, N > &a, const MiniVec< T, N > &b)
void operator+=(MiniVec< T, N > &a, const MiniVec< T, N > &b)
void operator-=(MiniVec< T, N > &a, const MiniVec< T, N > &b)
constexpr bool operator==(const optional< T > &x, const optional< T > &y)