QWT API (中文) 7.0.1
Qt绘图库 - 中文API文档
载入中...
搜索中...
未找到
qwt_plot_abstract_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_ABSTRACT_CANVAS_H
28#define QWT_PLOT_ABSTRACT_CANVAS_H
29
30#include "qwt_global.h"
31#include <qframe.h>
32
33class QwtPlot;
34
44class QWT_EXPORT QwtPlotAbstractCanvas
45{
46 public:
62 {
73
86
99 ItemFocusIndicator
100 };
101
102 // Constructor
103 explicit QwtPlotAbstractCanvas( QWidget* canvasWidget );
104 // Destructor
105 virtual ~QwtPlotAbstractCanvas();
106
107 // Get the parent plot widget
108 QwtPlot* plot();
109 // Get the parent plot widget
110 const QwtPlot* plot() const;
111
112 // Set the focus indicator
113 void setFocusIndicator( FocusIndicator );
114 // Get the focus indicator
115 FocusIndicator focusIndicator() const;
116
117 // Set the border radius
118 void setBorderRadius( double );
119 // Get the border radius
120 double borderRadius() const;
121
122 protected:
123 QWidget* canvasWidget();
124 const QWidget* canvasWidget() const;
125
126 virtual void drawFocusIndicator( QPainter* );
127 virtual void drawBorder( QPainter* );
128 virtual void drawBackground( QPainter* );
129
130 void fillBackground( QPainter* );
131 void drawCanvas( QPainter* );
132 void drawStyled( QPainter*, bool );
133 void drawUnstyled( QPainter* );
134
135 QPainterPath canvasBorderPath( const QRect& rect ) const;
136 void updateStyleSheetInfo();
137
138 private:
139 Q_DISABLE_COPY(QwtPlotAbstractCanvas)
140
141 class PrivateData;
142 PrivateData* m_data;
143};
144
155{
156 public:
171 {
190 BackingStore = 1,
191
203 ImmediatePaint = 8,
204 };
205
207 Q_DECLARE_FLAGS( PaintAttributes, PaintAttribute )
208
209 // Constructor
210 explicit QwtPlotAbstractGLCanvas( QWidget* canvasWidget );
211 // Destructor
212 virtual ~QwtPlotAbstractGLCanvas();
213
214 // Set a paint attribute
215 void setPaintAttribute( PaintAttribute, bool on = true );
216 // Test a paint attribute
217 bool testPaintAttribute( PaintAttribute ) const;
218
219 // Set the frame style
220 void setFrameStyle( int style );
221 // Get the frame style
222 int frameStyle() const;
223
224 // Set the frame shadow
225 void setFrameShadow( QFrame::Shadow );
226 // Get the frame shadow
227 QFrame::Shadow frameShadow() const;
228
229 // Set the frame shape
230 void setFrameShape( QFrame::Shape );
231 // Get the frame shape
232 QFrame::Shape frameShape() const;
233
234 // Set the line width
235 void setLineWidth( int );
236 // Get the line width
237 int lineWidth() const;
238
239 // Set the mid line width
240 void setMidLineWidth( int );
241 // Get the mid line width
242 int midLineWidth() const;
243
244 // Get the frame width
245 int frameWidth() const;
246 // Get the frame rect
247 QRect frameRect() const;
248
250 virtual void invalidateBackingStore() = 0;
251
252 protected:
253 void replot();
254 void draw( QPainter* );
255
256 private:
257 virtual void clearBackingStore() = 0;
258
259 class PrivateData;
260 PrivateData* m_data;
261};
262
263Q_DECLARE_OPERATORS_FOR_FLAGS( QwtPlotAbstractGLCanvas::PaintAttributes )
264
265#endif
所有类型绘图画布的基类
Definition qwt_plot_abstract_canvas.h:45
FocusIndicator
焦点指示器
Definition qwt_plot_abstract_canvas.h:62
@ NoFocusIndicator
Definition qwt_plot_abstract_canvas.h:72
@ CanvasFocusIndicator
Definition qwt_plot_abstract_canvas.h:85
QwtPlotOpenGLCanvas 和 QwtPlotGLCanvas 的基类
Definition qwt_plot_abstract_canvas.h:155
virtual void invalidateBackingStore()=0
Invalidate the internal backing store
PaintAttribute
绘制属性
Definition qwt_plot_abstract_canvas.h:171
二维绘图部件
Definition qwt_plot.h:138