46 Q_PROPERTY(QRect viewport READ viewport WRITE setViewport)
47 Q_PROPERTY(QPixmap background READ background WRITE setBackground)
48 Q_PROPERTY(
bool backgroundScaled READ backgroundScaled WRITE setBackgroundScaled)
49 Q_PROPERTY(Qt::AspectRatioMode backgroundScaledMode READ backgroundScaledMode WRITE setBackgroundScaledMode)
51 Q_PROPERTY(
bool autoAddPlottableToLegend READ autoAddPlottableToLegend WRITE setAutoAddPlottableToLegend)
52 Q_PROPERTY(
int selectionTolerance READ selectionTolerance WRITE setSelectionTolerance)
53 Q_PROPERTY(
bool noAntialiasingOnDrag READ noAntialiasingOnDrag WRITE setNoAntialiasingOnDrag)
54 Q_PROPERTY(Qt::KeyboardModifier multiSelectModifier READ multiSelectModifier WRITE setMultiSelectModifier)
65 Q_ENUMS(LayerInsertMode)
82 QPixmap background()
const {
return mBackgroundPixmap; }
83 bool backgroundScaled()
const {
return mBackgroundScaled; }
84 Qt::AspectRatioMode backgroundScaledMode()
const {
return mBackgroundScaledMode; }
86 QCP::AntialiasedElements antialiasedElements()
const {
return mAntialiasedElements; }
87 QCP::AntialiasedElements notAntialiasedElements()
const {
return mNotAntialiasedElements; }
88 bool autoAddPlottableToLegend()
const {
return mAutoAddPlottableToLegend; }
89 const QCP::Interactions interactions()
const {
return mInteractions; }
90 int selectionTolerance()
const {
return mSelectionTolerance; }
91 bool noAntialiasingOnDrag()
const {
return mNoAntialiasingOnDrag; }
92 QCP::PlottingHints plottingHints()
const {
return mPlottingHints; }
93 Qt::KeyboardModifier multiSelectModifier()
const {
return mMultiSelectModifier; }
96 void setViewport(
const QRect &rect);
97 void setBackground(
const QPixmap &pm);
98 void setBackground(
const QPixmap &pm,
bool scaled, Qt::AspectRatioMode mode=Qt::KeepAspectRatioByExpanding);
99 void setBackground(
const QBrush &brush);
100 void setBackgroundScaled(
bool scaled);
101 void setBackgroundScaledMode(Qt::AspectRatioMode mode);
102 void setAntialiasedElements(
const QCP::AntialiasedElements &antialiasedElements);
104 void setNotAntialiasedElements(
const QCP::AntialiasedElements ¬AntialiasedElements);
106 void setAutoAddPlottableToLegend(
bool on);
107 void setInteractions(
const QCP::Interactions &interactions);
108 void setInteraction(
const QCP::Interaction &interaction,
bool enabled=
true);
109 void setSelectionTolerance(
int pixels);
110 void setNoAntialiasingOnDrag(
bool enabled);
111 void setPlottingHints(
const QCP::PlottingHints &hints);
113 void setMultiSelectModifier(Qt::KeyboardModifier modifier);
121 bool removePlottable(
int index);
122 int clearPlottables();
123 int plottableCount()
const;
124 QList<QCPAbstractPlottable*> selectedPlottables()
const;
133 bool removeGraph(
int index);
135 int graphCount()
const;
136 QList<QCPGraph*> selectedGraphs()
const;
143 bool removeItem(
int index);
145 int itemCount()
const;
146 QList<QCPAbstractItem*> selectedItems()
const;
147 QCPAbstractItem *itemAt(
const QPointF &pos,
bool onlySelectable=
false)
const;
151 QCPLayer *layer(
const QString &name)
const;
154 bool setCurrentLayer(
const QString &name);
155 bool setCurrentLayer(
QCPLayer *layer);
156 int layerCount()
const;
157 bool addLayer(
const QString &name,
QCPLayer *otherLayer=0, LayerInsertMode insertMode=limAbove);
159 bool moveLayer(
QCPLayer *layer,
QCPLayer *otherLayer, LayerInsertMode insertMode=limAbove);
162 int axisRectCount()
const;
164 QList<QCPAxisRect*> axisRects()
const;
166 Q_SLOT
void rescaleAxes(
bool onlyVisiblePlottables=
false);
168 QList<QCPAxis*> selectedAxes()
const;
169 QList<QCPLegend*> selectedLegends()
const;
170 Q_SLOT
void deselectAll();
172 bool savePdf(
const QString &fileName,
bool noCosmeticPen=
false,
int width=0,
int height=0,
const QString &pdfCreator=QString(),
const QString &pdfTitle=QString());
173 bool savePng(
const QString &fileName,
int width=0,
int height=0,
double scale=1.0,
int quality=-1);
174 bool saveJpg(
const QString &fileName,
int width=0,
int height=0,
double scale=1.0,
int quality=-1);
175 bool saveBmp(
const QString &fileName,
int width=0,
int height=0,
double scale=1.0);
176 bool saveRastered(
const QString &fileName,
int width,
int height,
double scale,
const char *format,
int quality=-1);
177 QPixmap toPixmap(
int width=0,
int height=0,
double scale=1.0);
178 void toPainter(
QCPPainter *painter,
int width=0,
int height=0);
185 void mouseDoubleClick(QMouseEvent *event);
186 void mousePress(QMouseEvent *event);
187 void mouseMove(QMouseEvent *event);
188 void mouseRelease(QMouseEvent *event);
189 void mouseWheel(QWheelEvent *event);
199 void titleClick(QMouseEvent *event,
QCPPlotTitle *title);
200 void titleDoubleClick(QMouseEvent *event,
QCPPlotTitle *title);
202 void selectionChangedByUser();
210 bool mAutoAddPlottableToLegend;
211 QList<QCPAbstractPlottable*> mPlottables;
212 QList<QCPGraph*> mGraphs;
213 QList<QCPAbstractItem*> mItems;
214 QList<QCPLayer*> mLayers;
215 QCP::AntialiasedElements mAntialiasedElements, mNotAntialiasedElements;
216 QCP::Interactions mInteractions;
217 int mSelectionTolerance;
218 bool mNoAntialiasingOnDrag;
219 QBrush mBackgroundBrush;
220 QPixmap mBackgroundPixmap;
221 QPixmap mScaledBackgroundPixmap;
222 bool mBackgroundScaled;
223 Qt::AspectRatioMode mBackgroundScaledMode;
225 QCP::PlottingHints mPlottingHints;
226 Qt::KeyboardModifier mMultiSelectModifier;
229 QPixmap mPaintBuffer;
230 QPoint mMousePressPos;
231 QPointer<QCPLayoutElement> mMouseEventElement;
235 virtual QSize minimumSizeHint()
const;
236 virtual QSize sizeHint()
const;
237 virtual void paintEvent(QPaintEvent *event);
238 virtual void resizeEvent(QResizeEvent *event);
239 virtual void mouseDoubleClickEvent(QMouseEvent *event);
240 virtual void mousePressEvent(QMouseEvent *event);
241 virtual void mouseMoveEvent(QMouseEvent *event);
242 virtual void mouseReleaseEvent(QMouseEvent *event);
243 virtual void wheelEvent(QWheelEvent *event);
247 virtual void axisRemoved(
QCPAxis *axis);
248 virtual void legendRemoved(
QCPLegend *legend);
251 void updateLayerIndices()
const;
252 QCPLayerable *layerableAt(
const QPointF &pos,
bool onlySelectable, QVariant *selectionDetails=0)
const;
A layout element displaying a plot title text.
Definition: layoutelement-plottitle.h:36
QRect viewport() const
Definition: core.h:81
RefreshPriority
Definition: core.h:72
A layer that may contain objects, to control the rendering order.
Definition: layer.h:37
AntialiasedElement
Definition: global.h:96
The central class of the library. This is the QWidget which displays the plot and interacts with the ...
Definition: core.h:42
SelectablePart
Definition: axis.h:194
Manages a legend inside a QCustomPlot.
Definition: layoutelement-legend.h:126
Whether to use immediate repaint or queued update depends on whether the plotting hint QCP::phForceRe...
Definition: core.h:74
QCPAxis * yAxis2
Definition: core.h:181
A layout that arranges child elements in a grid.
Definition: layout.h:193
QPainter subclass used internally.
Definition: painter.h:111
The abstract base class for all objects that form the layout system.
Definition: layout.h:65
Holds multiple axes and arranges them in a rectangular shape.
Definition: layoutelement-axisrect.h:40
LayerInsertMode
Definition: core.h:62
The abstract base class for all entries in a QCPLegend.
Definition: layoutelement-legend.h:38
QCPLayoutGrid * plotLayout() const
Definition: core.h:85
QCPLegend * legend
Definition: core.h:182
Manages a single axis inside a QCustomPlot.
Definition: axis.h:94
The abstract base class for all items in a plot.
Definition: item.h:143
Base class for all drawable objects.
Definition: layer.h:80
A plottable representing a graph in a plot.
Definition: plottable-graph.h:60
The abstract base class for all data representing objects in a plot.
Definition: plottable.h:36
PlottingHint
Definition: global.h:117
Interaction
Definition: global.h:133