Classes | Public Slots | Public Member Functions | Protected Member Functions | Properties | Private Member Functions | Private Attributes | List of all members
QwtPlotGLCanvas Class Reference

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

#include <qwt_plot_glcanvas.h>

Inheritance diagram for QwtPlotGLCanvas:
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...
 
 QwtPlotGLCanvas (const QGLFormat &, QwtPlot *=NULL)
 Constructor. More...
 
 QwtPlotGLCanvas (QwtPlot *=NULL)
 Constructor. More...
 
virtual ~QwtPlotGLCanvas ()
 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 QGLWidget.

QwtPlotGLCanvas implements the very basics to act as canvas inside of a QwtPlot widget. It might be extended to a full featured alternative to QwtPlotCanvas in a future version of Qwt.

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

Since Qt 5.4 QOpenGLWidget is available, that is used by QwtPlotOpenGLCanvas.

See also
QwtPlot::setCanvas(), QwtPlotCanvas, QwtPlotOpenGLCanvas
Note
With Qt4 you might want to use the QPaintEngine::OpenGL paint engine ( see QGL::setPreferredPaintEngine() ). On a Linux test system QPaintEngine::OpenGL2 shows very basic problems like translated geometries.
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 QGLWidget, but is usually better integrated into a desktop application.

Definition at line 45 of file qwt_plot_glcanvas.h.

Constructor & Destructor Documentation

◆ QwtPlotGLCanvas() [1/2]

QwtPlotGLCanvas::QwtPlotGLCanvas ( QwtPlot plot = NULL)
explicit

Constructor.

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

Definition at line 56 of file qwt_plot_glcanvas.cpp.

◆ QwtPlotGLCanvas() [2/2]

QwtPlotGLCanvas::QwtPlotGLCanvas ( const QGLFormat &  format,
QwtPlot plot = NULL 
)
explicit

Constructor.

Parameters
formatOpenGL rendering options
plotParent plot widget
See also
QwtPlot::setCanvas()

Definition at line 69 of file qwt_plot_glcanvas.cpp.

◆ ~QwtPlotGLCanvas()

QwtPlotGLCanvas::~QwtPlotGLCanvas ( )
virtual

Destructor.

Definition at line 77 of file qwt_plot_glcanvas.cpp.

Member Function Documentation

◆ borderPath()

QPainterPath QwtPlotGLCanvas::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 157 of file qwt_plot_glcanvas.cpp.

◆ clearBackingStore()

void QwtPlotGLCanvas::clearBackingStore ( )
privatevirtual

Implements QwtPlotAbstractGLCanvas.

Definition at line 142 of file qwt_plot_glcanvas.cpp.

◆ event()

bool QwtPlotGLCanvas::event ( QEvent *  event)
virtual

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

Parameters
eventQt Event
Returns
See QGLWidget::event()

Definition at line 110 of file qwt_plot_glcanvas.cpp.

◆ init()

void QwtPlotGLCanvas::init ( )
private

Definition at line 82 of file qwt_plot_glcanvas.cpp.

◆ initializeGL()

void QwtPlotGLCanvas::initializeGL ( )
protectedvirtual

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

Definition at line 163 of file qwt_plot_glcanvas.cpp.

◆ invalidateBackingStore()

void QwtPlotGLCanvas::invalidateBackingStore ( )
virtual

Invalidate the internal backing store.

Implements QwtPlotAbstractGLCanvas.

Definition at line 137 of file qwt_plot_glcanvas.cpp.

◆ paintEvent()

void QwtPlotGLCanvas::paintEvent ( QPaintEvent *  event)
protectedvirtual

Paint event

Parameters
eventPaint event
See also
QwtPlot::drawCanvas()

Definition at line 100 of file qwt_plot_glcanvas.cpp.

◆ paintGL()

void QwtPlotGLCanvas::paintGL ( )
protectedvirtual

Paint the plot.

Definition at line 168 of file qwt_plot_glcanvas.cpp.

◆ replot

void QwtPlotGLCanvas::replot ( )
slot

Invalidate the paint cache and repaint the canvas

See also
invalidatePaintCache()

Definition at line 131 of file qwt_plot_glcanvas.cpp.

◆ resizeGL()

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

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

Definition at line 233 of file qwt_plot_glcanvas.cpp.

Member Data Documentation

◆ m_data

PrivateData* QwtPlotGLCanvas::m_data
private

Definition at line 82 of file qwt_plot_glcanvas.h.

Property Documentation

◆ borderRadius

double QwtPlotGLCanvas::borderRadius
readwrite

Definition at line 56 of file qwt_plot_glcanvas.h.

◆ frameRect

QRect QwtPlotGLCanvas::frameRect
read

Definition at line 54 of file qwt_plot_glcanvas.h.

◆ frameShadow

QFrame::Shadow QwtPlotGLCanvas::frameShadow
readwrite

Definition at line 49 of file qwt_plot_glcanvas.h.

◆ frameShape

QFrame::Shape QwtPlotGLCanvas::frameShape
readwrite

Definition at line 50 of file qwt_plot_glcanvas.h.

◆ frameWidth

int QwtPlotGLCanvas::frameWidth
read

Definition at line 53 of file qwt_plot_glcanvas.h.

◆ lineWidth

int QwtPlotGLCanvas::lineWidth
readwrite

Definition at line 51 of file qwt_plot_glcanvas.h.

◆ midLineWidth

int QwtPlotGLCanvas::midLineWidth
readwrite

Definition at line 52 of file qwt_plot_glcanvas.h.


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


plotjuggler
Author(s): Davide Faconti
autogenerated on Sun Aug 11 2024 02:24:29