QWT 7.0.1
Loading...
Searching...
No Matches
qwt_plot_canvas.h
1/******************************************************************************
2 * Qwt Widget Library
3 * Copyright (C) 1997 Josef Wilgen
4 * Copyright (C) 2002 Uwe Rathmann
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the Qwt License, Version 1.0
8 *
9 * Modified by ChenZongYan in 2024 <czy.t@163.com>
10 * Summary of major modifications (see ChangeLog.md for full history):
11 * 1. CMake build system & C++11 throughout.
12 * 2. Core panner/ zoomer refactored:
13 * - QwtPanner → QwtCachePanner (pixmap-cache version)
14 * - New real-time QwtPlotPanner derived from QwtPicker.
15 * 3. Zoomer supports multi-axis.
16 * 4. Parasite-plot framework:
17 * - QwtFigure, QwtPlotParasiteLayout, QwtPlotTransparentCanvas,
18 * - QwtPlotScaleEventDispatcher, built-in pan/zoom on axis.
19 * 5. New picker: QwtPlotSeriesDataPicker (works with date axis).
20 * 6. Raster & color-map extensions:
21 * - QwtGridRasterData (2-D table + interpolation)
22 * - QwtLinearColorMap::stopColors(), stopPos() API rename.
23 * 7. Bar-chart: expose pen/brush control.
24 * 8. Amalgamated build: single QwtPlot.h / QwtPlot.cpp pair in src-amalgamate.
25 *****************************************************************************/
26
27#ifndef QWT_PLOT_CANVAS_H
28#define QWT_PLOT_CANVAS_H
29
30#include "qwt_global.h"
31#include "qwt_plot_abstract_canvas.h"
32
33#include <qframe.h>
34
35class QwtPlot;
36class QPixmap;
37class QPainterPath;
38
46class QWT_EXPORT QwtPlotCanvas : public QFrame, public QwtPlotAbstractCanvas
47{
48 Q_OBJECT
49
50 Q_PROPERTY(double borderRadius READ borderRadius WRITE setBorderRadius)
51
52public:
63 {
80 BackingStore = 1,
81
102 Opaque = 2,
103
124 HackStyledBackground = 4,
125
134 ImmediatePaint = 8
135 };
136
137 Q_DECLARE_FLAGS(PaintAttributes, PaintAttribute)
138
139 explicit QwtPlotCanvas(QwtPlot* = NULL);
140 virtual ~QwtPlotCanvas();
141
142 void setPaintAttribute(PaintAttribute, bool on = true);
143 bool testPaintAttribute(PaintAttribute) const;
144
145 const QPixmap* backingStore() const;
146 Q_INVOKABLE void invalidateBackingStore();
147
148 virtual bool event(QEvent*) QWT_OVERRIDE;
149
150 Q_INVOKABLE QPainterPath borderPath(const QRect&) const;
151
152public Q_SLOTS:
153 void replot();
154
155protected:
156 virtual void paintEvent(QPaintEvent*) QWT_OVERRIDE;
157 virtual void resizeEvent(QResizeEvent*) QWT_OVERRIDE;
158
159 virtual void drawBorder(QPainter*) QWT_OVERRIDE;
160
161private:
162 class PrivateData;
163 PrivateData* m_data;
164};
165
166Q_DECLARE_OPERATORS_FOR_FLAGS(QwtPlotCanvas::PaintAttributes)
167
168#endif
Base class for all type of plot canvases.
Definition qwt_plot_abstract_canvas.h:39
virtual void drawBorder(QPainter *)
Draw the border of the canvas.
Definition qwt_plot_abstract_canvas.cpp:297
Canvas of a QwtPlot.
Definition qwt_plot_canvas.h:47
PaintAttribute
Paint attributes/绘制属性
Definition qwt_plot_canvas.h:63
A 2-D plotting widget.
Definition qwt_plot.h:99