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 below
  • virtual 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 attribute
  • void setFrameStyle (int style) β€” sets the frame style
  • int frameStyle () const β€” gets the frame style
  • void setFrameShadow (QFrame::Shadow) β€” sets the frame shadow
  • QFrame::Shadow frameShadow () const β€” gets the frame shadow
  • void setFrameShape (QFrame::Shape) β€” sets the frame shape
  • QFrame::Shape frameShape () const β€” gets the frame shape
  • void setLineWidth (int) β€” sets the line width
  • int lineWidth () const β€” gets the line width
  • void setMidLineWidth (int) β€” sets the mid line width
  • int midLineWidth () const β€” gets the mid line width
  • int frameWidth () const β€” gets the frame width
  • QRect 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 indicator
  • FocusIndicator focusIndicator () const β€” gets the focus indicator
  • void setBorderRadius (double) β€” sets the border radius
  • double borderRadius () const β€” gets the border radius

🧚 Protected Member Functions

  • virtual void paintEvent (QPaintEvent *) override β€” paints on a paint event
  • virtual 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 replot
  • void draw (QPainter *) β€” Helper function for the derived plot canvas.

πŸ™ˆ Protected Member Functions inherited from QwtPlotAbstractCanvas

  • QWidget * canvasWidget () β€” gives you the canvas widget
  • const QWidget * canvasWidget () const β€” const version, same deal
  • virtual void drawFocusIndicator (QPainter *) β€” draws the focus indicator
  • virtual void drawBorder (QPainter *) β€” draws the border
  • 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 β€” path for the canvas border
  • void 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 is NoFocusIndicator.

πŸ‘‘ 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 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::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