QWT API (中文) 7.0.1
Qt绘图库 - 中文API文档
载入中...
搜索中...
未找到
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
52class QWT_EXPORT QwtPlotCanvas : public QFrame, public QwtPlotAbstractCanvas
53{
54 Q_OBJECT
55
56 Q_PROPERTY(double borderRadius READ borderRadius WRITE setBorderRadius)
57
58public:
73 {
93 BackingStore = 1,
94
117 Opaque = 2,
118
142 HackStyledBackground = 4,
143
157 ImmediatePaint = 8
158 };
159
160 Q_DECLARE_FLAGS(PaintAttributes, PaintAttribute)
161
162 // Constructor
163 explicit QwtPlotCanvas(QwtPlot* = nullptr);
164 // Destructor
165 virtual ~QwtPlotCanvas();
166
167 // Set paint attribute
168 void setPaintAttribute(PaintAttribute, bool on = true);
169 // Test paint attribute
170 bool testPaintAttribute(PaintAttribute) const;
171
172 // Get backing store
173 const QPixmap* backingStore() const;
174 // Invalidate backing store
175 Q_INVOKABLE void invalidateBackingStore();
176
177 // Handle events
178 virtual bool event(QEvent*) override;
179
180 // Get border path
181 Q_INVOKABLE QPainterPath borderPath(const QRect&) const;
182
183public Q_SLOTS:
184 // Replot the canvas
185 void replot();
186
187protected:
189 virtual void paintEvent(QPaintEvent*) override;
191 virtual void resizeEvent(QResizeEvent*) override;
192
194 virtual void drawBorder(QPainter*) override;
195
196private:
197 class PrivateData;
198 PrivateData* m_data;
199};
200
201Q_DECLARE_OPERATORS_FOR_FLAGS(QwtPlotCanvas::PaintAttributes)
202
203#endif
所有类型绘图画布的基类
Definition qwt_plot_abstract_canvas.h:45
virtual void drawBorder(QPainter *)
Draw the border of the canvas
Definition qwt_plot_abstract_canvas.cpp:364
QwtPlot 的画布
Definition qwt_plot_canvas.h:53
PaintAttribute
绘制属性
Definition qwt_plot_canvas.h:73
二维绘图部件
Definition qwt_plot.h:138