SimCenterCommon
Common functionality used within different SimCenter projects
qcustomplot.h File Reference
#include <QtCore/qglobal.h>
#include <QtCore/QObject>
#include <QtCore/QPointer>
#include <QtCore/QSharedPointer>
#include <QtCore/QTimer>
#include <QtGui/QPainter>
#include <QtGui/QPaintEvent>
#include <QtGui/QMouseEvent>
#include <QtGui/QWheelEvent>
#include <QtGui/QPixmap>
#include <QtCore/QVector>
#include <QtCore/QString>
#include <QtCore/QDateTime>
#include <QtCore/QMultiMap>
#include <QtCore/QFlags>
#include <QtCore/QDebug>
#include <QtCore/QStack>
#include <QtCore/QCache>
#include <QtCore/QMargins>
#include <qmath.h>
#include <limits>
#include <algorithm>
#include <QtNumeric>
#include <QtWidgets/QWidget>
#include <QtPrintSupport/QtPrintSupport>
Include dependency graph for qcustomplot.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  QCPVector2D
 Represents two doubles as a mathematical 2D vector. More...
 
class  QCPPainter
 QPainter subclass used internally. More...
 
class  QCPAbstractPaintBuffer
 The abstract base class for paint buffers, which define the rendering backend. More...
 
class  QCPPaintBufferPixmap
 A paint buffer based on QPixmap, using software raster rendering. More...
 
class  QCPLayer
 A layer that may contain objects, to control the rendering order. More...
 
class  QCPLayerable
 Base class for all drawable objects. More...
 
class  QCPRange
 Represents the range an axis is encompassing. More...
 
class  QCPDataRange
 Describes a data range given by begin and end index. More...
 
class  QCPDataSelection
 Describes a data set by holding multiple QCPDataRange instances. More...
 
class  QCPSelectionRect
 Provides rect/rubber-band data selection and range zoom interaction. More...
 
class  QCPMarginGroup
 A margin group allows synchronization of margin sides if working with multiple layout elements. More...
 
class  QCPLayoutElement
 The abstract base class for all objects that form the layout system. More...
 
class  QCPLayout
 The abstract base class for layouts. More...
 
class  QCPLayoutGrid
 A layout that arranges child elements in a grid. More...
 
class  QCPLayoutInset
 A layout that places child elements aligned to the border or arbitrarily positioned. More...
 
class  QCPLineEnding
 Handles the different ending decorations for line-like items. More...
 
class  QCPAxisTicker
 The base class tick generator used by QCPAxis to create tick positions and tick labels. More...
 
class  QCPAxisTickerDateTime
 Specialized axis ticker for calendar dates and times as axis ticks. More...
 
class  QCPAxisTickerTime
 Specialized axis ticker for time spans in units of milliseconds to days. More...
 
class  QCPAxisTickerFixed
 Specialized axis ticker with a fixed tick step. More...
 
class  QCPAxisTickerText
 Specialized axis ticker which allows arbitrary labels at specified coordinates. More...
 
class  QCPAxisTickerPi
 Specialized axis ticker to display ticks in units of an arbitrary constant, for example pi. More...
 
class  QCPAxisTickerLog
 Specialized axis ticker suited for logarithmic axes. More...
 
class  QCPGrid
 Responsible for drawing the grid of a QCPAxis. More...
 
class  QCPAxis
 Manages a single axis inside a QCustomPlot. More...
 
class  QCPAxisPainterPrivate
 
struct  QCPAxisPainterPrivate::CachedLabel
 
struct  QCPAxisPainterPrivate::TickLabelData
 
class  QCPScatterStyle
 Represents the visual appearance of scatter points. More...
 
class  QCPDataContainer< DataType >
 The generic data container for one-dimensional plottables. More...
 
class  QCPSelectionDecorator
 Controls how a plottable's data selection is drawn. More...
 
class  QCPAbstractPlottable
 The abstract base class for all data representing objects in a plot. More...
 
class  QCPItemAnchor
 An anchor of an item to which positions can be attached to. More...
 
class  QCPItemPosition
 Manages the position of an item. More...
 
class  QCPAbstractItem
 The abstract base class for all items in a plot. More...
 
class  QCustomPlot
 The central class of the library. This is the QWidget which displays the plot and interacts with the user. More...
 
class  QCPPlottableInterface1D
 Defines an abstract interface for one-dimensional plottables. More...
 
class  QCPAbstractPlottable1D< DataType >
 A template base class for plottables with one-dimensional data. More...
 
class  QCPColorGradient
 Defines a color gradient for use with e.g. QCPColorMap. More...
 
class  QCPSelectionDecoratorBracket
 A selection decorator which draws brackets around each selected data segment. More...
 
class  QCPAxisRect
 Holds multiple axes and arranges them in a rectangular shape. More...
 
class  QCPAbstractLegendItem
 The abstract base class for all entries in a QCPLegend. More...
 
class  QCPPlottableLegendItem
 A legend item representing a plottable with an icon and the plottable name. More...
 
class  QCPLegend
 Manages a legend inside a QCustomPlot. More...
 
class  QCPTextElement
 A layout element displaying a text. More...
 
class  QCPColorScaleAxisRectPrivate
 
class  QCPColorScale
 A color scale for use with color coding data such as QCPColorMap. More...
 
class  QCPGraphData
 Holds the data of one single data point for QCPGraph. More...
 
class  QCPGraph
 A plottable representing a graph in a plot. More...
 
class  QCPCurveData
 Holds the data of one single data point for QCPCurve. More...
 
class  QCPCurve
 A plottable representing a parametric curve in a plot. More...
 
class  QCPBarsGroup
 Groups multiple QCPBars together so they appear side by side. More...
 
class  QCPBarsData
 Holds the data of one single data point (one bar) for QCPBars. More...
 
class  QCPBars
 A plottable representing a bar chart in a plot. More...
 
class  QCPStatisticalBoxData
 Holds the data of one single data point for QCPStatisticalBox. More...
 
class  QCPStatisticalBox
 A plottable representing a single statistical box in a plot. More...
 
class  QCPColorMapData
 Holds the two-dimensional data of a QCPColorMap plottable. More...
 
class  QCPColorMap
 A plottable representing a two-dimensional color map in a plot. More...
 
class  QCPFinancialData
 Holds the data of one single data point for QCPFinancial. More...
 
class  QCPFinancial
 A plottable representing a financial stock chart. More...
 
class  QCPErrorBarsData
 Holds the data of one single error bar for QCPErrorBars. More...
 
class  QCPErrorBars
 A plottable that adds a set of error bars to other plottables. More...
 
class  QCPItemStraightLine
 A straight line that spans infinitely in both directions. More...
 
class  QCPItemLine
 A line from one point to another. More...
 
class  QCPItemCurve
 A curved line from one point to another. More...
 
class  QCPItemRect
 A rectangle. More...
 
class  QCPItemText
 A text label. More...
 
class  QCPItemEllipse
 An ellipse. More...
 
class  QCPItemPixmap
 An arbitrary pixmap. More...
 
class  QCPItemTracer
 Item that sticks to QCPGraph data points. More...
 
class  QCPItemBracket
 A bracket for referencing/highlighting certain parts in the plot. More...
 

Namespaces

 QCP
 

Macros

#define QCP_DEVICEPIXELRATIO_SUPPORTED
 
#define QCP_LIB_DECL
 
#define Q_DECL_OVERRIDE
 

Typedefs

typedef QCPDataContainer< QCPGraphDataQCPGraphDataContainer
 
typedef QCPDataContainer< QCPCurveDataQCPCurveDataContainer
 
typedef QCPDataContainer< QCPBarsDataQCPBarsDataContainer
 
typedef QCPDataContainer< QCPStatisticalBoxDataQCPStatisticalBoxDataContainer
 
typedef QCPDataContainer< QCPFinancialDataQCPFinancialDataContainer
 
typedef QVector< QCPErrorBarsDataQCPErrorBarsDataContainer
 

Enumerations

enum  QCP::ResolutionUnit { QCP::ruDotsPerMeter, QCP::ruDotsPerCentimeter, QCP::ruDotsPerInch }
 
enum  QCP::ExportPen { QCP::epNoCosmetic, QCP::epAllowCosmetic }
 
enum  QCP::SignDomain { QCP::sdNegative, QCP::sdBoth, QCP::sdPositive }
 
enum  QCP::MarginSide {
  QCP::msLeft = 0x01, QCP::msRight = 0x02, QCP::msTop = 0x04, QCP::msBottom = 0x08,
  QCP::msAll = 0xFF, QCP::msNone = 0x00
}
 
enum  QCP::AntialiasedElement {
  QCP::aeAxes = 0x0001, QCP::aeGrid = 0x0002, QCP::aeSubGrid = 0x0004, QCP::aeLegend = 0x0008,
  QCP::aeLegendItems = 0x0010, QCP::aePlottables = 0x0020, QCP::aeItems = 0x0040, QCP::aeScatters = 0x0080,
  QCP::aeFills = 0x0100, QCP::aeZeroLine = 0x0200, QCP::aeOther = 0x8000, QCP::aeAll = 0xFFFF,
  QCP::aeNone = 0x0000
}
 
enum  QCP::PlottingHint { QCP::phNone = 0x000, QCP::phFastPolylines = 0x001, QCP::phImmediateRefresh = 0x002, QCP::phCacheLabels = 0x004 }
 
enum  QCP::Interaction {
  QCP::iRangeDrag = 0x001, QCP::iRangeZoom = 0x002, QCP::iMultiSelect = 0x004, QCP::iSelectPlottables = 0x008,
  QCP::iSelectAxes = 0x010, QCP::iSelectLegend = 0x020, QCP::iSelectItems = 0x040, QCP::iSelectOther = 0x080
}
 
enum  QCP::SelectionRectMode { QCP::srmNone, QCP::srmZoom, QCP::srmSelect, QCP::srmCustom }
 
enum  QCP::SelectionType {
  QCP::stNone, QCP::stWhole, QCP::stSingleData, QCP::stDataRange,
  QCP::stMultipleDataRanges
}
 

Functions

bool QCP::isInvalidData (double value)
 
bool QCP::isInvalidData (double value1, double value2)
 
void QCP::setMarginValue (QMargins &margins, QCP::MarginSide side, int value)
 
int QCP::getMarginValue (const QMargins &margins, QCP::MarginSide side)
 
 Q_DECLARE_TYPEINFO (QCPVector2D, Q_MOVABLE_TYPE)
 
const QCPVector2D operator* (double factor, const QCPVector2D &vec)
 
const QCPVector2D operator* (const QCPVector2D &vec, double factor)
 
const QCPVector2D operator/ (const QCPVector2D &vec, double divisor)
 
const QCPVector2D operator+ (const QCPVector2D &vec1, const QCPVector2D &vec2)
 
const QCPVector2D operator- (const QCPVector2D &vec1, const QCPVector2D &vec2)
 
const QCPVector2D operator- (const QCPVector2D &vec)
 
 Q_DECLARE_TYPEINFO (QCPRange, Q_MOVABLE_TYPE)
 
const QCPRange operator+ (const QCPRange &range, double value)
 
const QCPRange operator+ (double value, const QCPRange &range)
 
const QCPRange operator- (const QCPRange &range, double value)
 
const QCPRange operator* (const QCPRange &range, double value)
 
const QCPRange operator* (double value, const QCPRange &range)
 
const QCPRange operator/ (const QCPRange &range, double value)
 
 Q_DECLARE_TYPEINFO (QCPDataRange, Q_MOVABLE_TYPE)
 
const QCPDataSelection operator+ (const QCPDataSelection &a, const QCPDataSelection &b)
 
const QCPDataSelection operator+ (const QCPDataRange &a, const QCPDataSelection &b)
 
const QCPDataSelection operator+ (const QCPDataSelection &a, const QCPDataRange &b)
 
const QCPDataSelection operator+ (const QCPDataRange &a, const QCPDataRange &b)
 
const QCPDataSelection operator- (const QCPDataSelection &a, const QCPDataSelection &b)
 
const QCPDataSelection operator- (const QCPDataRange &a, const QCPDataSelection &b)
 
const QCPDataSelection operator- (const QCPDataSelection &a, const QCPDataRange &b)
 
const QCPDataSelection operator- (const QCPDataRange &a, const QCPDataRange &b)
 
 Q_DECLARE_TYPEINFO (QCPLineEnding, Q_MOVABLE_TYPE)
 
 Q_DECLARE_TYPEINFO (QCPScatterStyle, Q_MOVABLE_TYPE)
 
 Q_DECLARE_TYPEINFO (QCPGraphData, Q_PRIMITIVE_TYPE)
 
 Q_DECLARE_TYPEINFO (QCPCurveData, Q_PRIMITIVE_TYPE)
 
 Q_DECLARE_TYPEINFO (QCPBarsData, Q_PRIMITIVE_TYPE)
 
 Q_DECLARE_TYPEINFO (QCPStatisticalBoxData, Q_MOVABLE_TYPE)
 
 Q_DECLARE_TYPEINFO (QCPFinancialData, Q_PRIMITIVE_TYPE)
 
 Q_DECLARE_TYPEINFO (QCPErrorBarsData, Q_PRIMITIVE_TYPE)
 

Variables

const QMetaObject QCP::staticMetaObject
 

Macro Definition Documentation

#define Q_DECL_OVERRIDE

Definition at line 126 of file qcustomplot.h.

#define QCP_DEVICEPIXELRATIO_SUPPORTED

Definition at line 44 of file qcustomplot.h.

#define QCP_LIB_DECL

Definition at line 121 of file qcustomplot.h.

Typedef Documentation

Container for storing QCPBarsData points. The data is stored sorted by key.

This template instantiation is the container in which QCPBars holds its data. For details about the generic container, see the documentation of the class template QCPDataContainer.

See also
QCPBarsData, QCPBars::setData

Definition at line 5435 of file qcustomplot.h.

Container for storing QCPCurveData points. The data is stored sorted by t, so the sortKey() (returning t) is different from mainKey() (returning key).

This template instantiation is the container in which QCPCurve holds its data. For details about the generic container, see the documentation of the class template QCPDataContainer.

See also
QCPCurveData, QCPCurve::setData

Definition at line 5256 of file qcustomplot.h.

Container for storing QCPErrorBarsData points. It is a typedef for QVector<QCPErrorBarsData>.

This is the container in which QCPErrorBars holds its data. Unlike most other data containers for plottables, it is not based on QCPDataContainer. This is because the error bars plottable is special in that it doesn't store its own key and value coordinate per error bar. It adopts the key and value from the plottable to which the error bars shall be applied (QCPErrorBars::setDataPlottable). So the stored QCPErrorBarsData doesn't need a sortable key, but merely an index (as QVector provides), which maps one-to-one to the indices of the other plottable's data.

See also
QCPErrorBarsData, QCPErrorBars::setData

Definition at line 5948 of file qcustomplot.h.

Container for storing QCPFinancialData points. The data is stored sorted by key.

This template instantiation is the container in which QCPFinancial holds its data. For details about the generic container, see the documentation of the class template QCPDataContainer.

See also
QCPFinancialData, QCPFinancial::setData

Definition at line 5811 of file qcustomplot.h.

Container for storing QCPGraphData points. The data is stored sorted by key.

This template instantiation is the container in which QCPGraph holds its data. For details about the generic container, see the documentation of the class template QCPDataContainer.

See also
QCPGraphData, QCPGraph::setData

Definition at line 5117 of file qcustomplot.h.

Container for storing QCPStatisticalBoxData points. The data is stored sorted by key.

This template instantiation is the container in which QCPStatisticalBox holds its data. For details about the generic container, see the documentation of the class template QCPDataContainer.

See also
QCPStatisticalBoxData, QCPStatisticalBox::setData

Definition at line 5566 of file qcustomplot.h.

Function Documentation

const QCPVector2D operator* ( double  factor,
const QCPVector2D vec 
)
inline

Definition at line 430 of file qcustomplot.h.

const QCPVector2D operator* ( const QCPVector2D vec,
double  factor 
)
inline

Definition at line 431 of file qcustomplot.h.

const QCPRange operator* ( const QCPRange range,
double  value 
)
inline

Multiplies both boundaries of the range by value.

Definition at line 854 of file qcustomplot.h.

const QCPRange operator* ( double  value,
const QCPRange range 
)
inline

Multiplies both boundaries of the range by value.

Definition at line 864 of file qcustomplot.h.

const QCPVector2D operator+ ( const QCPVector2D vec1,
const QCPVector2D vec2 
)
inline

Definition at line 433 of file qcustomplot.h.

const QCPRange operator+ ( const QCPRange range,
double  value 
)
inline

Adds value to both boundaries of the range.

Definition at line 824 of file qcustomplot.h.

const QCPRange operator+ ( double  value,
const QCPRange range 
)
inline

Adds value to both boundaries of the range.

Definition at line 834 of file qcustomplot.h.

const QCPDataSelection operator+ ( const QCPDataSelection a,
const QCPDataSelection b 
)
inline

Return a QCPDataSelection with the data points in a joined with the data points in b. The resulting data selection is already simplified (see QCPDataSelection::simplify).

Definition at line 976 of file qcustomplot.h.

const QCPDataSelection operator+ ( const QCPDataRange a,
const QCPDataSelection b 
)
inline

Return a QCPDataSelection with the data points in a joined with the data points in b. The resulting data selection is already simplified (see QCPDataSelection::simplify).

Definition at line 987 of file qcustomplot.h.

const QCPDataSelection operator+ ( const QCPDataSelection a,
const QCPDataRange b 
)
inline

Return a QCPDataSelection with the data points in a joined with the data points in b. The resulting data selection is already simplified (see QCPDataSelection::simplify).

Definition at line 998 of file qcustomplot.h.

const QCPDataSelection operator+ ( const QCPDataRange a,
const QCPDataRange b 
)
inline

Return a QCPDataSelection with the data points in a joined with the data points in b. The resulting data selection is already simplified (see QCPDataSelection::simplify).

Definition at line 1009 of file qcustomplot.h.

const QCPVector2D operator- ( const QCPVector2D vec1,
const QCPVector2D vec2 
)
inline

Definition at line 434 of file qcustomplot.h.

const QCPVector2D operator- ( const QCPVector2D vec)
inline

Definition at line 435 of file qcustomplot.h.

const QCPRange operator- ( const QCPRange range,
double  value 
)
inline

Subtracts value from both boundaries of the range.

Definition at line 844 of file qcustomplot.h.

const QCPDataSelection operator- ( const QCPDataSelection a,
const QCPDataSelection b 
)
inline

Return a QCPDataSelection with the data points which are in a but not in b.

Definition at line 1019 of file qcustomplot.h.

const QCPDataSelection operator- ( const QCPDataRange a,
const QCPDataSelection b 
)
inline

Return a QCPDataSelection with the data points which are in a but not in b.

Definition at line 1029 of file qcustomplot.h.

const QCPDataSelection operator- ( const QCPDataSelection a,
const QCPDataRange b 
)
inline

Return a QCPDataSelection with the data points which are in a but not in b.

Definition at line 1039 of file qcustomplot.h.

const QCPDataSelection operator- ( const QCPDataRange a,
const QCPDataRange b 
)
inline

Return a QCPDataSelection with the data points which are in a but not in b.

Definition at line 1049 of file qcustomplot.h.

const QCPVector2D operator/ ( const QCPVector2D vec,
double  divisor 
)
inline

Definition at line 432 of file qcustomplot.h.

const QCPRange operator/ ( const QCPRange range,
double  value 
)
inline

Divides both boundaries of the range by value.

Definition at line 874 of file qcustomplot.h.

Q_DECLARE_TYPEINFO ( QCPVector2D  ,
Q_MOVABLE_TYPE   
)
Q_DECLARE_TYPEINFO ( QCPRange  ,
Q_MOVABLE_TYPE   
)
Q_DECLARE_TYPEINFO ( QCPDataRange  ,
Q_MOVABLE_TYPE   
)
Q_DECLARE_TYPEINFO ( QCPLineEnding  ,
Q_MOVABLE_TYPE   
)
Q_DECLARE_TYPEINFO ( QCPScatterStyle  ,
Q_MOVABLE_TYPE   
)
Q_DECLARE_TYPEINFO ( QCPGraphData  ,
Q_PRIMITIVE_TYPE   
)
Q_DECLARE_TYPEINFO ( QCPCurveData  ,
Q_PRIMITIVE_TYPE   
)
Q_DECLARE_TYPEINFO ( QCPBarsData  ,
Q_PRIMITIVE_TYPE   
)
Q_DECLARE_TYPEINFO ( QCPStatisticalBoxData  ,
Q_MOVABLE_TYPE   
)
Q_DECLARE_TYPEINFO ( QCPFinancialData  ,
Q_PRIMITIVE_TYPE   
)
Q_DECLARE_TYPEINFO ( QCPErrorBarsData  ,
Q_PRIMITIVE_TYPE   
)