An alternative canvas for a QwtPlot derived from QGLWidget.
More...
#include <qwt_plot_glcanvas.h>
|
| void | replot () |
| | Replot the canvas.
|
| |
|
| virtual void | paintEvent (QPaintEvent *) override |
| | Paint event handler.
|
| |
| virtual void | initializeGL () override |
| | Initialize OpenGL.
|
| |
| virtual void | paintGL () override |
| | Paint OpenGL scene.
|
| |
| virtual void | resizeGL (int width, int height) override |
| | Resize OpenGL view.
|
| |
| void | replot () |
| | Invalidate the paint cache and repaint the canvas.
|
| |
|
void | draw (QPainter *) |
| | Helper function for the derived plot canvas.
|
| |
| 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.
|
| |
|
|
QFrame::Shadow | frameShadow |
| |
|
QFrame::Shape | frameShape |
| |
|
int | lineWidth |
| |
|
int | midLineWidth |
| |
|
int | frameWidth |
| |
|
QRect | frameRect |
| |
|
double | borderRadius |
| |
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.
◆ QwtPlotGLCanvas()
| QwtPlotGLCanvas::QwtPlotGLCanvas |
( |
QwtPlot * |
plot = nullptr | ) |
|
|
explicit |
Constructor.
- Parameters
-
| [in] | plot | Parent plot widget |
- See also
- QwtPlot::setCanvas()
Constructor
- Parameters
-
| [in] | format | OpenGL rendering options |
| [in] | plot | Parent plot widget |
- See also
- QwtPlot::setCanvas()
Destructor
◆ borderPath()
| QPainterPath QwtPlotGLCanvas::borderPath |
( |
const QRect & |
rect | ) |
const |
Get the border path.
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
-
| [in] | rect | Bounding rectangle of the canvas |
- Returns
- Painter path, that can be used for clipping
◆ event()
| bool QwtPlotGLCanvas::event |
( |
QEvent * |
event | ) |
|
|
overridevirtual |
Handle events.
Qt event handler for QEvent::PolishRequest and QEvent::StyleChange.
- Parameters
-
- Returns
- See QGLWidget::event()
◆ initializeGL()
| void QwtPlotGLCanvas::initializeGL |
( |
| ) |
|
|
overrideprotectedvirtual |
Initialize OpenGL.
No operation - reserved for some potential use in the future.
◆ invalidateBackingStore()
| void QwtPlotGLCanvas::invalidateBackingStore |
( |
| ) |
|
|
overridevirtual |
◆ paintEvent()
| void QwtPlotGLCanvas::paintEvent |
( |
QPaintEvent * |
event | ) |
|
|
overrideprotectedvirtual |
◆ paintGL()
| void QwtPlotGLCanvas::paintGL |
( |
| ) |
|
|
overrideprotectedvirtual |
Paint OpenGL scene.
Paint the plot.
◆ replot
| void QwtPlotGLCanvas::replot |
( |
| ) |
|
|
slot |
Replot the canvas.
Invalidate the paint cache and repaint the canvas.
- See also
- invalidatePaintCache()
◆ resizeGL()
| void QwtPlotGLCanvas::resizeGL |
( |
int |
width, |
|
|
int |
height |
|
) |
| |
|
overrideprotectedvirtual |
Resize OpenGL view.
No operation - reserved for some potential use in the future.
The documentation for this class was generated from the following files:
- /home/runner/work/QWT/QWT/src/plot/qwt_plot_glcanvas.h
- /home/runner/work/QWT/QWT/src/plot/qwt_plot_glcanvas.cpp