QwtPlotGLCanvas(3)
π QwtPlotGLCanvas(3) β like, the GL canvas one, bestie
okay so this page lives in the Library Functions Manual, and it's all about QwtPlotGLCanvas β an alternative canvas for a QwtPlot derived from QGLWidget. yes, GL. hardware accelerated. we love to see it β¨
β¨ NAME β¨
QwtPlotGLCanvas β an alternative canvas for a QwtPlot derived from QGLWidget. that's the whole vibe, she's a canvas, she's GL-flavored π
πΈ SYNOPSIS πΈ
#include <qwt_plot_glcanvas.h>
Inherits QGLWidget, and QwtPlotAbstractGLCanvas. so she's got family. two families actually π
π Public Slots
void replot ()β makes her redraw, we'll get to that
π¦ Public Member Functions
QwtPlotGLCanvas (QwtPlot *=NULL)β Constructor.QwtPlotGLCanvas (const QGLFormat &, QwtPlot *=NULL)β Constructor (the one where you pick your GL format, fancy).virtual ~QwtPlotGLCanvas ()β Destructor.virtual Q_INVOKABLE void invalidateBackingStore () overrideβ Invalidate the internal backing store.Q_INVOKABLE QPainterPath borderPath (const QRect &) constβ gives you the border path, more belowvirtual bool event (QEvent *) overrideβ the Qt event handler
π Public Member Functions inherited from QwtPlotAbstractGLCanvas
QwtPlotAbstractGLCanvas (QWidget *canvasWidget)β Constructor.virtual ~QwtPlotAbstractGLCanvas ()β Destructor.void setPaintAttribute (PaintAttribute, bool on=true)β Changing the paint attributes.bool testPaintAttribute (PaintAttribute) constβ checks a paint attributevoid setFrameStyle (int style)β sets the frame styleint frameStyle () constβ gets the frame stylevoid setFrameShadow (QFrame::Shadow)β sets the frame shadowQFrame::Shadow frameShadow () constβ gets the frame shadowvoid setFrameShape (QFrame::Shape)β sets the frame shapeQFrame::Shape frameShape () constβ gets the frame shapevoid setLineWidth (int)β sets the line widthint lineWidth () constβ gets the line widthvoid setMidLineWidth (int)β sets the mid line widthint midLineWidth () constβ gets the mid line widthint frameWidth () constβ gets the frame widthQRect frameRect () constβ gets the frame rect
π«Ά Public Member Functions inherited from QwtPlotAbstractCanvas
QwtPlotAbstractCanvas (QWidget *canvasWidget)β Constructor.virtual ~QwtPlotAbstractCanvas ()β Destructor.QwtPlot * plot ()β Return parent plot widget.const QwtPlot * plot () constβ Return parent plot widget (const edition, she's chill like that).void setFocusIndicator (FocusIndicator)β sets the focus indicatorFocusIndicator focusIndicator () constβ gets the focus indicatorvoid setBorderRadius (double)β sets the border radiusdouble borderRadius () constβ gets the border radius
π§ Protected Member Functions
virtual void paintEvent (QPaintEvent *) overrideβ paints on a paint eventvirtual void initializeGL () overrideβ No operation - reserved for some potential use in the future.virtual void paintGL () overrideβ Paint the plot.virtual void resizeGL (int width, int height) overrideβ No operation - reserved for some potential use in the future.
π Protected Member Functions inherited from QwtPlotAbstractGLCanvas
void replot ()β the protected replotvoid draw (QPainter *)β Helper function for the derived plot canvas.
π Protected Member Functions inherited from QwtPlotAbstractCanvas
QWidget * canvasWidget ()β gives you the canvas widgetconst QWidget * canvasWidget () constβ const version, same dealvirtual void drawFocusIndicator (QPainter *)β draws the focus indicatorvirtual void drawBorder (QPainter *)β draws the bordervirtual 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β path for the canvas bordervoid updateStyleSheetInfo ()β Update the cached information about the current style sheet.
β Additional Inherited Members
π Public Types inherited from QwtPlotAbstractGLCanvas
enum PaintAttribute { BackingStore = 1, ImmediatePaint = 8 }β Paint attributes.typedef QFlags< PaintAttribute > PaintAttributesβ Paint attributes (the flag-collection era).
π Public Types inherited from QwtPlotAbstractCanvas
enum FocusIndicator { NoFocusIndicator, CanvasFocusIndicator, ItemFocusIndicator }β Focus indicator. The default setting isNoFocusIndicator.
π 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. (so like, she's got potential, she's growing, we're rooting for her π±)
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. not me being shocked she fakes the whole QFrame thing so convincingly π
Since Qt 5.4 QOpenGLWidget is available, that is used by QwtPlotOpenGLCanvas. so if you're on newer Qt, go say hi to her cousin.
See also: QwtPlot::setCanvas(), QwtPlotCanvas, QwtPlotOpenGLCanvas
Note π With Qt4 you might want to use theQPaintEngine::OpenGLpaint engine ( seeQGL::setPreferredPaintEngine()). On a Linux test systemQPaintEngine::OpenGL2shows very basic problems like translated geometries. Another way for getting hardware accelerated graphics is using an OpenGL offscreen buffer (QwtPlotCanvas::OpenGLBuffer) withQwtPlotCanvas. Performance is worse, than rendering straight to aQGLWidget, but is usually better integrated into a desktop application.
Definition at line 45 of file qwt_plot_glcanvas.h.
π Constructor & Destructor Documentation π
QwtPlotGLCanvas::QwtPlotGLCanvas (QwtPlot * plot = NULL) [explicit]
Constructor.
Parameters
- plot β Parent plot widget
See also: QwtPlot::setCanvas()
Definition at line 56 of file qwt_plot_glcanvas.cpp.
QwtPlotGLCanvas::QwtPlotGLCanvas (const QGLFormat & format, QwtPlot * plot = NULL) [explicit]
Constructor. this is the one where you hand her a format and she's like "oh we're doing GL options today? slay" π
Parameters
- format β OpenGL rendering options
- plot β Parent plot widget
See also: QwtPlot::setCanvas()
Definition at line 69 of file qwt_plot_glcanvas.cpp.
QwtPlotGLCanvas::~QwtPlotGLCanvas () [virtual]
Destructor. she's leaving the group chat π
Definition at line 77 of file qwt_plot_glcanvas.cpp.
π¦ Member Function Documentation π¦
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. (empty path, no border, moving on β¨)
Parameters
- rect β Bounding rectangle of the canvas
Returns
- Painter path, that can be used for clipping
Definition at line 157 of file qwt_plot_glcanvas.cpp.
void QwtPlotGLCanvas::clearBackingStore () [override], [private], [virtual]
Implements QwtPlotAbstractGLCanvas.
Definition at line 142 of file qwt_plot_glcanvas.cpp.
bool QwtPlotGLCanvas::event (QEvent * event) [override], [virtual]
Qt event handler for QEvent::PolishRequest and QEvent::StyleChange. she's listening, she's paying attention, she knows when you restyle her π«Ά
Parameters
- event β Qt Event
Returns
- See
QGLWidget::event()
Definition at line 110 of file qwt_plot_glcanvas.cpp.
void QwtPlotGLCanvas::initializeGL () [override], [protected], [virtual]
No operation - reserved for some potential use in the future. literally does nothing, and honestly? iconic. she's resting π
Definition at line 163 of file qwt_plot_glcanvas.cpp.
void QwtPlotGLCanvas::invalidateBackingStore () [override], [virtual]
Invalidate the internal backing store.
Implements QwtPlotAbstractGLCanvas.
Definition at line 137 of file qwt_plot_glcanvas.cpp.
void QwtPlotGLCanvas::paintEvent (QPaintEvent * event) [override], [protected], [virtual]
Paint event.
Parameters
- event β Paint event
See also: QwtPlot::drawCanvas()
Definition at line 100 of file qwt_plot_glcanvas.cpp.
void QwtPlotGLCanvas::paintGL () [override], [protected], [virtual]
Paint the plot. that's it, that's the function, she paints the plot π₯
Definition at line 168 of file qwt_plot_glcanvas.cpp.
void QwtPlotGLCanvas::replot () [slot]
Invalidate the paint cache and repaint the canvas. refresh era π
See also: invalidatePaintCache()
Definition at line 131 of file qwt_plot_glcanvas.cpp.
void QwtPlotGLCanvas::resizeGL (int width, int height) [override], [protected], [virtual]
No operation - reserved for some potential use in the future. again! nothing! and we respect it π§
Definition at line 233 of file qwt_plot_glcanvas.cpp.
π Author π
Generated automatically by Doxygen for Qwt User's Guide from the source code. so nobody hand-wrote this, the robot did it, and honestly the robot ate π€β¨
aaand that's the page, bestie π«Ά it came from the Qwt User's Guide (that's the source/version, iykyk) β go build something gorgeous with her, mwah πππ¦
π¦ where this page comes from
- alpine 3.24: qwt-doc 6.3.0-r0 Β· custom
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms