Changeset 11158 in ntrip for trunk/BNC/qwt/qwt_plot_glcanvas.h


Ignore:
Timestamp:
Nov 3, 2026, 10:53:35 AM (3 weeks ago)
Author:
stuerze
Message:

deprecated functions exchanged libs updated

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/qwt/qwt_plot_glcanvas.h

    r9383 r11158  
    1 /* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
     1/******************************************************************************
    22 * Qwt Widget Library
    33 * Copyright (C) 1997   Josef Wilgen
    … …  
    1212
    1313#include "qwt_global.h"
    14 #include <qframe.h>
     14#include "qwt_plot_abstract_canvas.h"
     15
    1516#include <qgl.h>
    16 #include <qpainterpath.h>
    1717
    1818class QwtPlot;
    1919
    2020/*!
    21   \brief An alternative canvas for a QwtPlot derived from QGLWidget
     21   \brief An alternative canvas for a QwtPlot derived from QGLWidget
    2222
    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.
    2626
    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.
    3030
    31   \sa QwtPlot::setCanvas(), QwtPlotCanvas
     31   Since Qt 5.4 QOpenGLWidget is available, that is used by QwtPlotOpenGLCanvas.
    3232
    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
    3436        ( see QGL::setPreferredPaintEngine() ). On a Linux test system
    3537        QPaintEngine::OpenGL2 shows very basic problems like translated
    3638        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 */
     45class QWT_EXPORT QwtPlotGLCanvas : public QGLWidget, public QwtPlotAbstractGLCanvas
    3946{
    4047    Q_OBJECT
    4148
    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 )
    4651    Q_PROPERTY( int lineWidth READ lineWidth WRITE setLineWidth )
    4752    Q_PROPERTY( int midLineWidth READ midLineWidth WRITE setMidLineWidth )
    … …  
    4954    Q_PROPERTY( QRect frameRect READ frameRect DESIGNABLE false )
    5055
    51 public:
    52     /*!
    53         \brief Frame shadow
     56    Q_PROPERTY( double borderRadius READ borderRadius WRITE setBorderRadius )
    5457
    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 );
    9261    virtual ~QwtPlotGLCanvas();
    9362
    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;
    9665
    97     void setFrameShadow( Shadow );
    98     Shadow frameShadow() const;
     66    virtual bool event( QEvent* ) QWT_OVERRIDE;
    9967
    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:
    11769    void replot();
    11870
    119 protected:
    120     virtual void paintEvent( QPaintEvent * );
     71  protected:
     72    virtual void paintEvent( QPaintEvent* ) QWT_OVERRIDE;
    12173
    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;
    12577
    126 private:
     78  private:
     79    void init();
     80    virtual void clearBackingStore() QWT_OVERRIDE;
     81
    12782    class PrivateData;
    128     PrivateData *d_data;
     83    PrivateData* m_data;
    12984};
    13085
Note: See TracChangeset for help on using the changeset viewer.