Qwt User's Guide  6.1.6
qwt_plot_glcanvas.h
1 /* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
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_GLCANVAS_H
11 #define QWT_PLOT_GLCANVAS_H
12 
13 #include "qwt_global.h"
14 #include <qframe.h>
15 #include <qgl.h>
16 #include <qpainterpath.h>
17 
18 class QwtPlot;
19 
38 class QWT_EXPORT QwtPlotGLCanvas: public QGLWidget
39 {
40  Q_OBJECT
41 
42  Q_ENUMS( Shape Shadow )
43 
44  Q_PROPERTY( Shadow frameShadow READ frameShadow WRITE setFrameShadow )
45  Q_PROPERTY( Shape frameShape READ frameShape WRITE setFrameShape )
46  Q_PROPERTY( int lineWidth READ lineWidth WRITE setLineWidth )
47  Q_PROPERTY( int midLineWidth READ midLineWidth WRITE setMidLineWidth )
48  Q_PROPERTY( int frameWidth READ frameWidth )
49  Q_PROPERTY( QRect frameRect READ frameRect DESIGNABLE false )
50 
51 public:
60  enum Shadow
61  {
63  Plain = QFrame::Plain,
64 
66  Raised = QFrame::Raised,
67 
69  Sunken = QFrame::Sunken
70  };
71 
83  enum Shape
84  {
85  NoFrame = QFrame::NoFrame,
86 
87  Box = QFrame::Box,
88  Panel = QFrame::Panel
89  };
90 
91  explicit QwtPlotGLCanvas( QwtPlot * = NULL );
92  virtual ~QwtPlotGLCanvas();
93 
94  void setFrameStyle( int style );
95  int frameStyle() const;
96 
97  void setFrameShadow( Shadow );
98  Shadow frameShadow() const;
99 
100  void setFrameShape( Shape );
101  Shape frameShape() const;
102 
103  void setLineWidth( int );
104  int lineWidth() const;
105 
106  void setMidLineWidth( int );
107  int midLineWidth() const;
108 
109  int frameWidth() const;
110  QRect frameRect() const;
111 
112  Q_INVOKABLE QPainterPath borderPath( const QRect & ) const;
113 
114  virtual bool event( QEvent * );
115 
116 public Q_SLOTS:
117  void replot();
118 
119 protected:
120  virtual void paintEvent( QPaintEvent * );
121 
122  virtual void drawBackground( QPainter * );
123  virtual void drawBorder( QPainter * );
124  virtual void drawItems( QPainter * );
125 
126 private:
127  class PrivateData;
128  PrivateData *d_data;
129 };
130 
131 #endif
QwtPlot
A 2-D plotting widget.
Definition: qwt_plot.h:76
QwtPlotGLCanvas
An alternative canvas for a QwtPlot derived from QGLWidget.
Definition: qwt_plot_glcanvas.h:39
QwtPlotGLCanvas::Shape
Shape
Frame shape.
Definition: qwt_plot_glcanvas.h:84
QwtPlotGLCanvas::Shadow
Shadow
Frame shadow.
Definition: qwt_plot_glcanvas.h:61