Changeset 11158 in ntrip for trunk/BNC/qwt/qwt_plot_glcanvas.h
- Timestamp:
- Nov 3, 2026, 10:53:35 AM (3 weeks ago)
- File:
-
- 1 edited
-
trunk/BNC/qwt/qwt_plot_glcanvas.h (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/qwt/qwt_plot_glcanvas.h
r9383 r11158 1 /* -*- mode: C++ ; c-file-style: "stroustrup" -*-*****************************1 /****************************************************************************** 2 2 * Qwt Widget Library 3 3 * Copyright (C) 1997 Josef Wilgen … … 12 12 13 13 #include "qwt_global.h" 14 #include <qframe.h> 14 #include "qwt_plot_abstract_canvas.h" 15 15 16 #include <qgl.h> 16 #include <qpainterpath.h>17 17 18 18 class QwtPlot; 19 19 20 20 /*! 21 \brief An alternative canvas for a QwtPlot derived from QGLWidget 21 \brief An alternative canvas for a QwtPlot derived from QGLWidget 22 22 23 QwtPlotGLCanvas implements the very basics to act as canvas 24 inside of a QwtPlot widget. It might be extended to a full 25 featured alternative to QwtPlotCanvas in a future version of Qwt. 23 QwtPlotGLCanvas implements the very basics to act as canvas 24 inside of a QwtPlot widget. It might be extended to a full 25 featured alternative to QwtPlotCanvas in a future version of Qwt. 26 26 27 Even if QwtPlotGLCanvas is not derived from QFrame it imitates 28 its API. When using style sheets it supports the box model - beside 29 backgrounds with rounded borders. 27 Even if QwtPlotGLCanvas is not derived from QFrame it imitates 28 its API. When using style sheets it supports the box model - beside 29 backgrounds with rounded borders. 30 30 31 \saQwtPlot::setCanvas(), QwtPlotCanvas31 Since Qt 5.4 QOpenGLWidget is available, that is used by QwtPlotOpenGLCanvas. 32 32 33 \note With Qt4 you might want to use the QPaintEngine::OpenGL paint engine 33 \sa QwtPlot::setCanvas(), QwtPlotCanvas, QwtPlotOpenGLCanvas 34 35 \note With Qt4 you might want to use the QPaintEngine::OpenGL paint engine 34 36 ( see QGL::setPreferredPaintEngine() ). On a Linux test system 35 37 QPaintEngine::OpenGL2 shows very basic problems like translated 36 38 geometries. 37 */ 38 class QWT_EXPORT QwtPlotGLCanvas: public QGLWidget 39 40 \note Another way for getting hardware accelerated graphics is using 41 an OpenGL offscreen buffer ( QwtPlotCanvas::OpenGLBuffer ) with QwtPlotCanvas. 42 Performance is worse, than rendering straight to a QGLWidget, but is usually 43 better integrated into a desktop application. 44 */ 45 class QWT_EXPORT QwtPlotGLCanvas : public QGLWidget, public QwtPlotAbstractGLCanvas 39 46 { 40 47 Q_OBJECT 41 48 42 Q_ENUMS( Shape Shadow ) 43 44 Q_PROPERTY( Shadow frameShadow READ frameShadow WRITE setFrameShadow ) 45 Q_PROPERTY( Shape frameShape READ frameShape WRITE setFrameShape ) 49 Q_PROPERTY( QFrame::Shadow frameShadow READ frameShadow WRITE setFrameShadow ) 50 Q_PROPERTY( QFrame::Shape frameShape READ frameShape WRITE setFrameShape ) 46 51 Q_PROPERTY( int lineWidth READ lineWidth WRITE setLineWidth ) 47 52 Q_PROPERTY( int midLineWidth READ midLineWidth WRITE setMidLineWidth ) … … 49 54 Q_PROPERTY( QRect frameRect READ frameRect DESIGNABLE false ) 50 55 51 public: 52 /*! 53 \brief Frame shadow 56 Q_PROPERTY( double borderRadius READ borderRadius WRITE setBorderRadius ) 54 57 55 Unfortunately it is not possible to use QFrame::Shadow 56 as a property of a widget that is not derived from QFrame. 57 The following enum is made for the designer only. It is safe 58 to use QFrame::Shadow instead. 59 */ 60 enum Shadow 61 { 62 //! QFrame::Plain 63 Plain = QFrame::Plain, 64 65 //! QFrame::Raised 66 Raised = QFrame::Raised, 67 68 //! QFrame::Sunken 69 Sunken = QFrame::Sunken 70 }; 71 72 /*! 73 \brief Frame shape 74 75 Unfortunately it is not possible to use QFrame::Shape 76 as a property of a widget that is not derived from QFrame. 77 The following enum is made for the designer only. It is safe 78 to use QFrame::Shadow instead. 79 80 \note QFrame::StyledPanel and QFrame::WinPanel are unsupported 81 and will be displayed as QFrame::Panel. 82 */ 83 enum Shape 84 { 85 NoFrame = QFrame::NoFrame, 86 87 Box = QFrame::Box, 88 Panel = QFrame::Panel 89 }; 90 91 explicit QwtPlotGLCanvas( QwtPlot * = NULL ); 58 public: 59 explicit QwtPlotGLCanvas( QwtPlot* = NULL ); 60 explicit QwtPlotGLCanvas( const QGLFormat&, QwtPlot* = NULL ); 92 61 virtual ~QwtPlotGLCanvas(); 93 62 94 void setFrameStyle( int style );95 int frameStyle() const;63 Q_INVOKABLE virtual void invalidateBackingStore() QWT_OVERRIDE; 64 Q_INVOKABLE QPainterPath borderPath( const QRect& ) const; 96 65 97 void setFrameShadow( Shadow ); 98 Shadow frameShadow() const; 66 virtual bool event( QEvent* ) QWT_OVERRIDE; 99 67 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: 68 public Q_SLOTS: 117 69 void replot(); 118 70 119 protected: 120 virtual void paintEvent( QPaintEvent * );71 protected: 72 virtual void paintEvent( QPaintEvent* ) QWT_OVERRIDE; 121 73 122 virtual void drawBackground( QPainter * );123 virtual void drawBorder( QPainter * );124 virtual void drawItems( QPainter * );74 virtual void initializeGL() QWT_OVERRIDE; 75 virtual void paintGL() QWT_OVERRIDE; 76 virtual void resizeGL( int width, int height ) QWT_OVERRIDE; 125 77 126 private: 78 private: 79 void init(); 80 virtual void clearBackingStore() QWT_OVERRIDE; 81 127 82 class PrivateData; 128 PrivateData *d_data;83 PrivateData* m_data; 129 84 }; 130 85
Note:
See TracChangeset
for help on using the changeset viewer.
