QWT API (中文) 7.0.1
Qt绘图库 - 中文API文档
载入中...
搜索中...
未找到
qwt_plot_glcanvas.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_GLCANVAS_H
28#define QWT_PLOT_GLCANVAS_H
29
30#include "qwt_global.h"
31#include "qwt_plot_abstract_canvas.h"
32
33#include <qgl.h>
34
35class QwtPlot;
36
84class QWT_EXPORT QwtPlotGLCanvas : public QGLWidget, public QwtPlotAbstractGLCanvas
85{
86 Q_OBJECT
87
88 Q_PROPERTY( QFrame::Shadow frameShadow READ frameShadow WRITE setFrameShadow )
89 Q_PROPERTY( QFrame::Shape frameShape READ frameShape WRITE setFrameShape )
90 Q_PROPERTY( int lineWidth READ lineWidth WRITE setLineWidth )
91 Q_PROPERTY( int midLineWidth READ midLineWidth WRITE setMidLineWidth )
92 Q_PROPERTY( int frameWidth READ frameWidth )
93 Q_PROPERTY( QRect frameRect READ frameRect DESIGNABLE false )
94
95 Q_PROPERTY( double borderRadius READ borderRadius WRITE setBorderRadius )
96
97 public:
107 explicit QwtPlotGLCanvas( QwtPlot* = nullptr );
117 explicit QwtPlotGLCanvas( const QGLFormat&, QwtPlot* = nullptr );
127 virtual ~QwtPlotGLCanvas();
128
138 Q_INVOKABLE virtual void invalidateBackingStore() override;
148 Q_INVOKABLE QPainterPath borderPath( const QRect& ) const;
149
159 virtual bool event( QEvent* ) override;
160
161 public Q_SLOTS:
171 void replot();
172
173 protected:
179 virtual void paintEvent( QPaintEvent* ) override;
180
186 virtual void initializeGL() override;
192 virtual void paintGL() override;
198 virtual void resizeGL( int width, int height ) override;
199
200 private:
206 void init();
212 virtual void clearBackingStore() override;
213
214 class PrivateData;
215 PrivateData* m_data;
216};
217
218#endif
QwtPlotOpenGLCanvas 和 QwtPlotGLCanvas 的基类
Definition qwt_plot_abstract_canvas.h:155
virtual void invalidateBackingStore()=0
Invalidate the internal backing store
void replot()
使绘制缓存失效并重绘画布
Definition qwt_plot_abstract_canvas.cpp:914
QwtPlot 的替代画布,派生自 QGLWidget
Definition qwt_plot_glcanvas.h:85
二维绘图部件
Definition qwt_plot.h:138