QWT 7.0.1
Loading...
Searching...
No Matches
Classes | Public Slots | Public Member Functions | Protected Member Functions | Properties | List of all members
QwtPlotOpenGLCanvas Class Reference

An alternative canvas for a QwtPlot derived from QOpenGLWidget. More...

#include <qwt_plot_opengl_canvas.h>

Inheritance diagram for QwtPlotOpenGLCanvas:
QwtPlotAbstractGLCanvas QwtPlotAbstractCanvas

Classes

class  PrivateData
 

Public Slots

void replot ()
 Invalidate the paint cache and repaint the canvas.
 

Public Member Functions

 QwtPlotOpenGLCanvas (QwtPlot *=NULL)
 Constructor.
 
 QwtPlotOpenGLCanvas (const QSurfaceFormat &, QwtPlot *=NULL)
 Constructor.
 
virtual ~QwtPlotOpenGLCanvas ()
 Destructor.
 
virtual Q_INVOKABLE void invalidateBackingStore () QWT_OVERRIDE
 Invalidate the internal backing store.
 
Q_INVOKABLE QPainterPath borderPath (const QRect &) const
 Calculate the painter path for a styled or rounded border.
 
virtual bool event (QEvent *) QWT_OVERRIDE
 Qt event handler for QEvent::PolishRequest and QEvent::StyleChange.
 
- Public Member Functions inherited from QwtPlotAbstractGLCanvas
 QwtPlotAbstractGLCanvas (QWidget *canvasWidget)
 Paint attributes.
 
virtual ~QwtPlotAbstractGLCanvas ()
 Destructor.
 
void setPaintAttribute (PaintAttribute, bool on=true)
 Changing the paint attributes.
 
bool testPaintAttribute (PaintAttribute) const
 Test whether a paint attribute is enabled.
 
void setFrameStyle (int style)
 Set the frame style.
 
int frameStyle () const
 
void setFrameShadow (QFrame::Shadow)
 Set the frame shadow.
 
QFrame::Shadow frameShadow () const
 
void setFrameShape (QFrame::Shape)
 Set the frame shape.
 
QFrame::Shape frameShape () const
 
void setLineWidth (int)
 Set the frame line width.
 
int lineWidth () const
 
void setMidLineWidth (int)
 Set the frame mid line width.
 
int midLineWidth () const
 
int frameWidth () const
 
QRect frameRect () const
 
- Public Member Functions inherited from QwtPlotAbstractCanvas
 QwtPlotAbstractCanvas (QWidget *canvasWidget)
 Constructor.
 
virtual ~QwtPlotAbstractCanvas ()
 Destructor.
 
QwtPlotplot ()
 Return parent plot widget.
 
const QwtPlotplot () const
 Return parent plot widget.
 
void setFocusIndicator (FocusIndicator)
 Set the focus indicator.
 
FocusIndicator focusIndicator () const
 
void setBorderRadius (double)
 Set the radius for the corners of the border frame.
 
double borderRadius () const
 

Protected Member Functions

virtual void paintEvent (QPaintEvent *) QWT_OVERRIDE
 Paint event.
 
virtual void initializeGL () QWT_OVERRIDE
 No operation - reserved for some potential use in the future.
 
virtual void paintGL () QWT_OVERRIDE
 Paint the plot.
 
virtual void resizeGL (int width, int height) QWT_OVERRIDE
 No operation - reserved for some potential use in the future.
 
- Protected Member Functions inherited from QwtPlotAbstractGLCanvas
void replot ()
 Invalidate the paint cache and repaint the canvas.
 
void draw (QPainter *)
 Helper function for the derived plot canvas.
 
- Protected Member Functions inherited from QwtPlotAbstractCanvas
QWidget * canvasWidget ()
 
const QWidget * canvasWidget () const
 
virtual void drawFocusIndicator (QPainter *)
 Draw the focus indication.
 
virtual void drawBorder (QPainter *)
 Draw the border of the canvas.
 
virtual void drawBackground (QPainter *)
 Helper function for the derived plot canvas.
 
void fillBackground (QPainter *)
 Helper function for the derived plot canvas.
 
void drawCanvas (QPainter *)
 Draw the plot to the canvas.
 
void drawStyled (QPainter *, bool)
 Helper function for the derived plot canvas.
 
void drawUnstyled (QPainter *)
 Helper function for the derived plot canvas.
 
QPainterPath canvasBorderPath (const QRect &rect) const
 
void updateStyleSheetInfo ()
 Update the cached information about the current style sheet.
 

Properties

QFrame::Shadow frameShadow
 
QFrame::Shape frameShape
 
int lineWidth
 
int midLineWidth
 
int frameWidth
 
QRect frameRect
 
double borderRadius
 

Additional Inherited Members

- Public Types inherited from QwtPlotAbstractGLCanvas
enum  PaintAttribute { BackingStore = 1 , ImmediatePaint = 8 }
 Paint attributes. More...
 
- Public Types inherited from QwtPlotAbstractCanvas
enum  FocusIndicator { NoFocusIndicator , CanvasFocusIndicator , ItemFocusIndicator }
 Focus indicator The default setting is NoFocusIndicator. More...
 

Detailed Description

An alternative canvas for a QwtPlot derived from QOpenGLWidget.

Even if QwtPlotOpenGLCanvas is not derived from QFrame it imitates its API. When using style sheets it supports the box model - beside backgrounds with rounded borders.

See also
QwtPlot::setCanvas(), QwtPlotCanvas, QwtPlotCanvas::OpenGLBuffer
Note
Another way for getting hardware accelerated graphics is using an OpenGL offscreen buffer ( QwtPlotCanvas::OpenGLBuffer ) with QwtPlotCanvas. Performance is worse, than rendering straight to a QOpenGLWidget, but is usually better integrated into a desktop application.

Constructor & Destructor Documentation

◆ QwtPlotOpenGLCanvas() [1/2]

QwtPlotOpenGLCanvas::QwtPlotOpenGLCanvas ( QwtPlot plot = NULL)
explicit

Constructor.

Parameters
plotParent plot widget
See also
QwtPlot::setCanvas()

◆ QwtPlotOpenGLCanvas() [2/2]

QwtPlotOpenGLCanvas::QwtPlotOpenGLCanvas ( const QSurfaceFormat &  format,
QwtPlot plot = NULL 
)
explicit

Constructor.

Parameters
formatOpenGL surface format
plotParent plot widget
See also
QwtPlot::setCanvas()

Member Function Documentation

◆ borderPath()

QPainterPath QwtPlotOpenGLCanvas::borderPath ( const QRect &  rect) const

Calculate the painter path for a styled or rounded border.

When the canvas has no styled background or rounded borders the painter path is empty.

Parameters
rectBounding rectangle of the canvas
Returns
Painter path, that can be used for clipping

◆ event()

bool QwtPlotOpenGLCanvas::event ( QEvent *  event)
virtual

Qt event handler for QEvent::PolishRequest and QEvent::StyleChange.

Parameters
eventQt Event
Returns
See QGLWidget::event()

◆ invalidateBackingStore()

void QwtPlotOpenGLCanvas::invalidateBackingStore ( )
virtual

Invalidate the internal backing store.

Implements QwtPlotAbstractGLCanvas.

◆ paintEvent()

void QwtPlotOpenGLCanvas::paintEvent ( QPaintEvent *  event)
protectedvirtual

Paint event.

Parameters
eventPaint event
See also
QwtPlot::drawCanvas()

◆ replot

void QwtPlotOpenGLCanvas::replot ( )
slot

Invalidate the paint cache and repaint the canvas.

See also
invalidatePaintCache()

The documentation for this class was generated from the following files: