Qwt User's Guide 6.2.0

qwt_plot_opengl_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
10 #ifndef QWT_PLOT_OPENGL_CANVAS_H
11 #define QWT_PLOT_OPENGL_CANVAS_H
12
13 #include "qwt_global.h"
14 #include "qwt_plot_abstract_canvas.h"
15
16 #include <qopenglwidget.h>
17
18 class QwtPlot;
19
34 class QWT_EXPORT QwtPlotOpenGLCanvas : public QOpenGLWidget, public QwtPlotAbstractGLCanvas
35 {
36 Q_OBJECT
37
38 Q_PROPERTY( QFrame::Shadow frameShadow READ frameShadow WRITE setFrameShadow )
39 Q_PROPERTY( QFrame::Shape frameShape READ frameShape WRITE setFrameShape )
40 Q_PROPERTY( int lineWidth READ lineWidth WRITE setLineWidth )
41 Q_PROPERTY( int midLineWidth READ midLineWidth WRITE setMidLineWidth )
42 Q_PROPERTY( int frameWidth READ frameWidth )
43 Q_PROPERTY( QRect frameRect READ frameRect DESIGNABLE false )
44
45 Q_PROPERTY( double borderRadius READ borderRadius WRITE setBorderRadius )
46
47 public:
48 explicit QwtPlotOpenGLCanvas( QwtPlot* = NULL );
49 explicit QwtPlotOpenGLCanvas( const QSurfaceFormat&, QwtPlot* = NULL);
50 virtual ~QwtPlotOpenGLCanvas();
51
52 Q_INVOKABLE virtual void invalidateBackingStore() QWT_OVERRIDE;
53 Q_INVOKABLE QPainterPath borderPath( const QRect& ) const;
54
55 virtual bool event( QEvent* ) QWT_OVERRIDE;
56
57 public Q_SLOTS:
58 void replot();
59
60 protected:
61 virtual void paintEvent( QPaintEvent* ) QWT_OVERRIDE;
62
63 virtual void initializeGL() QWT_OVERRIDE;
64 virtual void paintGL() QWT_OVERRIDE;
65 virtual void resizeGL( int width, int height ) QWT_OVERRIDE;
66
67 private:
68 void init( const QSurfaceFormat& );
69 virtual void clearBackingStore() QWT_OVERRIDE;
70
71 class PrivateData;
72 PrivateData* m_data;
73 };
74
75 #endif
QwtPlotAbstractGLCanvas
Base class of QwtPlotOpenGLCanvas and QwtPlotGLCanvas.
Definition: qwt_plot_abstract_canvas.h:88
QwtPlotAbstractGLCanvas::invalidateBackingStore
virtual void invalidateBackingStore()=0
Invalidate the internal backing store.
QwtPlotAbstractGLCanvas::replot
void replot()
Definition: qwt_plot_abstract_canvas.cpp:1093
QwtPlot
A 2-D plotting widget.
Definition: qwt_plot.h:79
QwtPlotOpenGLCanvas
An alternative canvas for a QwtPlot derived from QOpenGLWidget.
Definition: qwt_plot_opengl_canvas.h:35