Qwt User's Guide 6.1.1

- Main Page
- Related Pages
- Classes

- Class List
- Class Index
- Class Hierarchy
- Class Members

All Classes Functions Variables Typedefs Enumerations Enumerator Pages
Public Types | Public Slots | Public Member Functions | Protected Member Functions | 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:
[legend]

## Public Types
enum | Shadow { Plain = QFrame::Plain, Raised = QFrame::Raised, Sunken = QFrame::Sunken }
| Frame shadow. More...
enum | Shape { NoFrame = QFrame::NoFrame, Box = QFrame::Box, Panel = QFrame::Panel }
| Frame shape. More...

## Public Slots
void | replot ()
| Calls repaint()

## Public Member Functions
| QwtPlotGLCanvas (QwtPlot *=NULL)
| Constructor. More...
virtual | ~QwtPlotGLCanvas ()
| Destructor.
void | setFrameStyle (int style)
int | frameStyle () const
void | setFrameShadow (Shadow)
Shadow | frameShadow () const
void | setFrameShape (Shape)
Shape | frameShape () const
void | setLineWidth (int)
int | lineWidth () const
void | setMidLineWidth (int)
int | midLineWidth () const
int | frameWidth () const
QRect | frameRect () const
Q_INVOKABLE QPainterPath | borderPath (const QRect &) const
virtual bool | event (QEvent *)

## Protected Member Functions
virtual void | paintEvent (QPaintEvent *)
virtual void | drawBackground (QPainter *)
virtual void | drawBorder (QPainter *)
virtual void | drawItems (QPainter *)

## 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.

See Also
  QwtPlot::setCanvas(), QwtPlotCanvas

Note
  You might want to use the QPaintEngine::OpenGL paint engine ( see QGL::setPreferredPaintEngine() ). On a Linux test system QPaintEngine::OpenGL2 shows very basic problems ( wrong geometries of rectangles ) but also more advanced stuff like antialiasing doesn't work.
  Another way to introduce OpenGL rendering to Qwt is to use QGLPixelBuffer or QGLFramebufferObject. Both type of buffers can be converted into a QImage and used in combination with a regular QwtPlotCanvas.

## Member Enumeration Documentation

enum QwtPlotGLCanvas::Shadow

Frame shadow.

Unfortunately it is not possible to use QFrame::Shadow as a property of a widget that is not derived from QFrame. The following enum is made for the designer only. It is safe to use QFrame::Shadow instead.

Enumerator
Plain | QFrame::Plain.
Raised | QFrame::Raised.
Sunken | QFrame::Sunken.

enum QwtPlotGLCanvas::Shape

Frame shape.

Unfortunately it is not possible to use QFrame::Shape as a property of a widget that is not derived from QFrame. The following enum is made for the designer only. It is safe to use QFrame::Shadow instead.

Note
  QFrame::StyledPanel and QFrame::WinPanel are unsuported and will be displayed as QFrame::Panel.

## Constructor & Destructor Documentation

QwtPlotGLCanvas::QwtPlotGLCanvas | ( | QwtPlot * | plot = `NULL` | ) |
| explicit

Constructor.

Parameters

  plot | Parent plot widget

See Also
  QwtPlot::setCanvas()

## Member Function Documentation

QPainterPath QwtPlotGLCanvas::borderPath | ( | const QRect & | rect | ) | const

Returns
  Empty path

void QwtPlotGLCanvas::drawBackground | ( | QPainter * | painter | ) |
| protected virtual

Draw the background of the canvas

Parameters

  painter | Painter

void QwtPlotGLCanvas::drawBorder | ( | QPainter * | painter | ) |
| protected virtual

Draw the border of the canvas

Parameters

  painter | Painter

void QwtPlotGLCanvas::drawItems | ( | QPainter * | painter | ) |
| protected virtual

Draw the plot items

Parameters

  painter | Painter

See Also
  QwtPlot::drawCanvas()

bool QwtPlotGLCanvas::event | ( | QEvent * | event | ) |
| virtual

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

Parameters

  event | Qt Event

Returns
  See QGLWidget::event()

QRect QwtPlotGLCanvas::frameRect | ( |  | ) | const

Returns
  The rectangle where the frame is drawn in.

QwtPlotGLCanvas::Shadow QwtPlotGLCanvas::frameShadow | ( |  | ) | const

Returns
  Frame shadow

See Also
  setFrameShadow(), QFrame::setFrameShadow()

QwtPlotGLCanvas::Shape QwtPlotGLCanvas::frameShape | ( |  | ) | const

Returns
  Frame shape

See Also
  setFrameShape(), QFrame::frameShape()

int QwtPlotGLCanvas::frameStyle | ( |  | ) | const

Returns
  The bitwise OR between a frameShape() and a frameShadow()

See Also
  setFrameStyle(), QFrame::frameStyle()

int QwtPlotGLCanvas::frameWidth | ( |  | ) | const

Returns
  Frame width depending on the style, line width and midline width.

int QwtPlotGLCanvas::lineWidth | ( |  | ) | const

Returns
  Line width of the frame

See Also
  setLineWidth(), midLineWidth()

int QwtPlotGLCanvas::midLineWidth | ( |  | ) | const

Returns
  Midline width of the frame

See Also
  setMidLineWidth(), lineWidth()

void QwtPlotGLCanvas::paintEvent | ( | QPaintEvent * | event | ) |
| protected virtual

Paint event

Parameters

  event | Paint event

See Also
  QwtPlot::drawCanvas()

void QwtPlotGLCanvas::setFrameShadow | ( | Shadow | shadow | ) |

Set the frame shadow

Parameters

  shadow | Frame shadow

See Also
  frameShadow(), setFrameShape(), QFrame::setFrameShadow()

void QwtPlotGLCanvas::setFrameShape | ( | Shape | shape | ) |

Set the frame shape

Parameters

  shape | Frame shape

See Also
  frameShape(), setFrameShadow(), QFrame::frameShape()

void QwtPlotGLCanvas::setFrameStyle | ( | int | style | ) |

Set the frame style

Parameters

  style | The bitwise OR between a shape and a shadow.

See Also
  frameStyle(), QFrame::setFrameStyle(), setFrameShadow(), setFrameShape()

void QwtPlotGLCanvas::setLineWidth | ( | int | width | ) |

Set the frame line width

The default line width is 2 pixels.

Parameters

  width | Line width of the frame

See Also
  lineWidth(), setMidLineWidth()

void QwtPlotGLCanvas::setMidLineWidth | ( | int | width | ) |

Set the frame mid line width

The default midline width is 0 pixels.

Parameters

  width | Midline width of the frame

See Also
  midLineWidth(), setLineWidth()