Classes | Public Slots | Public Member Functions | Protected Member Functions | Properties | Private Member Functions | Private Attributes | 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:
Inheritance graph
[legend]

Classes

class  PrivateData
 

Public Slots

void replot ()
 

Public Member Functions

Q_INVOKABLE QPainterPath borderPath (const QRect &) const
 
virtual bool event (QEvent *) QWT_OVERRIDE
 
virtual Q_INVOKABLE void invalidateBackingStore () QWT_OVERRIDE
 Invalidate the internal backing store. More...
 
 QwtPlotOpenGLCanvas (int samples, QwtPlot *=NULL)
 Constructor. More...
 
 QwtPlotOpenGLCanvas (QwtPlot *=NULL)
 Constructor. More...
 
virtual ~QwtPlotOpenGLCanvas ()
 Destructor. More...
 
- Public Member Functions inherited from QwtPlotAbstractGLCanvas
QRect frameRect () const
 
QFrame::Shadow frameShadow () const
 
QFrame::Shape frameShape () const
 
int frameStyle () const
 
int frameWidth () const
 
int lineWidth () const
 
int midLineWidth () const
 
 QwtPlotAbstractGLCanvas (QWidget *canvasWidget)
 Paint attributes. More...
 
void setFrameShadow (QFrame::Shadow)
 
void setFrameShape (QFrame::Shape)
 
void setFrameStyle (int style)
 
void setLineWidth (int)
 
void setMidLineWidth (int)
 
void setPaintAttribute (PaintAttribute, bool on=true)
 Changing the paint attributes. More...
 
bool testPaintAttribute (PaintAttribute) const
 
virtual ~QwtPlotAbstractGLCanvas ()
 Destructor. More...
 
- Public Member Functions inherited from QwtPlotAbstractCanvas
double borderRadius () const
 
FocusIndicator focusIndicator () const
 
QwtPlotplot ()
 Return parent plot widget. More...
 
const QwtPlotplot () const
 
 QwtPlotAbstractCanvas (QWidget *canvasWidget)
 Constructor. More...
 
void setBorderRadius (double)
 
void setFocusIndicator (FocusIndicator)
 
virtual ~QwtPlotAbstractCanvas ()
 Destructor. More...
 

Protected Member Functions

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

Properties

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

Private Member Functions

virtual void clearBackingStore () QWT_OVERRIDE
 
void init ()
 

Private Attributes

PrivateDatam_data
 

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.

Definition at line 34 of file qwt_plot_opengl_canvas.h.

Constructor & Destructor Documentation

◆ QwtPlotOpenGLCanvas() [1/2]

QwtPlotOpenGLCanvas::QwtPlotOpenGLCanvas ( QwtPlot plot = NULL)
explicit

Constructor.

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

Definition at line 49 of file qwt_plot_opengl_canvas.cpp.

◆ QwtPlotOpenGLCanvas() [2/2]

QwtPlotOpenGLCanvas::QwtPlotOpenGLCanvas ( int  numSamples,
QwtPlot plot = NULL 
)
explicit

Constructor.

Parameters
intNumber of samples, see QSurfaceFormat::samples()
plotParent plot widget
See also
QwtPlot::setCanvas()

Definition at line 63 of file qwt_plot_opengl_canvas.cpp.

◆ ~QwtPlotOpenGLCanvas()

QwtPlotOpenGLCanvas::~QwtPlotOpenGLCanvas ( )
virtual

Destructor.

Definition at line 94 of file qwt_plot_opengl_canvas.cpp.

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

Definition at line 185 of file qwt_plot_opengl_canvas.cpp.

◆ clearBackingStore()

void QwtPlotOpenGLCanvas::clearBackingStore ( )
privatevirtual

Implements QwtPlotAbstractGLCanvas.

Definition at line 170 of file qwt_plot_opengl_canvas.cpp.

◆ event()

bool QwtPlotOpenGLCanvas::event ( QEvent *  event)
virtual

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

Parameters
eventQt Event
Returns
See QGLWidget::event()

Definition at line 116 of file qwt_plot_opengl_canvas.cpp.

◆ init()

void QwtPlotOpenGLCanvas::init ( )
private

Definition at line 80 of file qwt_plot_opengl_canvas.cpp.

◆ initializeGL()

void QwtPlotOpenGLCanvas::initializeGL ( )
protectedvirtual

No operation - reserved for some potential use in the future.

Definition at line 191 of file qwt_plot_opengl_canvas.cpp.

◆ invalidateBackingStore()

void QwtPlotOpenGLCanvas::invalidateBackingStore ( )
virtual

Invalidate the internal backing store.

Implements QwtPlotAbstractGLCanvas.

Definition at line 165 of file qwt_plot_opengl_canvas.cpp.

◆ paintEvent()

void QwtPlotOpenGLCanvas::paintEvent ( QPaintEvent *  event)
protectedvirtual

Paint event

Parameters
eventPaint event
See also
QwtPlot::drawCanvas()

Definition at line 105 of file qwt_plot_opengl_canvas.cpp.

◆ paintGL()

void QwtPlotOpenGLCanvas::paintGL ( )
protectedvirtual

Paint the plot.

Definition at line 196 of file qwt_plot_opengl_canvas.cpp.

◆ replot

void QwtPlotOpenGLCanvas::replot ( )
slot

Invalidate the paint cache and repaint the canvas

See also
invalidatePaintCache()

Definition at line 159 of file qwt_plot_opengl_canvas.cpp.

◆ resizeGL()

void QwtPlotOpenGLCanvas::resizeGL ( int  width,
int  height 
)
protectedvirtual

No operation - reserved for some potential use in the future.

Definition at line 270 of file qwt_plot_opengl_canvas.cpp.

Member Data Documentation

◆ m_data

PrivateData* QwtPlotOpenGLCanvas::m_data
private

Definition at line 71 of file qwt_plot_opengl_canvas.h.

Property Documentation

◆ borderRadius

double QwtPlotOpenGLCanvas::borderRadius
readwrite

Definition at line 45 of file qwt_plot_opengl_canvas.h.

◆ frameRect

QRect QwtPlotOpenGLCanvas::frameRect
read

Definition at line 43 of file qwt_plot_opengl_canvas.h.

◆ frameShadow

QFrame::Shadow QwtPlotOpenGLCanvas::frameShadow
readwrite

Definition at line 38 of file qwt_plot_opengl_canvas.h.

◆ frameShape

QFrame::Shape QwtPlotOpenGLCanvas::frameShape
readwrite

Definition at line 39 of file qwt_plot_opengl_canvas.h.

◆ frameWidth

int QwtPlotOpenGLCanvas::frameWidth
read

Definition at line 42 of file qwt_plot_opengl_canvas.h.

◆ lineWidth

int QwtPlotOpenGLCanvas::lineWidth
readwrite

Definition at line 40 of file qwt_plot_opengl_canvas.h.

◆ midLineWidth

int QwtPlotOpenGLCanvas::midLineWidth
readwrite

Definition at line 41 of file qwt_plot_opengl_canvas.h.


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


plotjuggler
Author(s): Davide Faconti
autogenerated on Tue Nov 26 2024 03:24:13