QOpenGLContext missing "functions" method?

Jason Hallen hallenj at gmail.com
Fri Mar 1 14:01:04 GMT 2024


Perfect, that worked. Thanks!
Jason

On Thu, Feb 29, 2024 at 3:27 AM Phil Thompson <phil at riverbankcomputing.com>
wrote:

> On 29/02/2024 04:43, Jason Hallen wrote:
> > Hello everyone,
> >
> > I'm trying to reimplement QOpenGLWidget in PyQt6 and have the following
> > code.
> >
> >
> >
> >
> >
> >
> >
> >
> > *class OpenGLWidget(QOpenGLWidget):        def __init__(self):
> > super().__init__()    def initializeGL(self):        context =
> > QtGui.QOpenGLContext.currentContext()        functions =
> > context.functions()*
> >
> > However, I'm getting the following error when running the code.
> >
> > *AttributeError: 'QOpenGLContext' object has no attribute 'functions'*
> >
> > I looked in the source code at the QtGui.pyi file, and sure enough
> > there
> > isn't a "functions" method declared in the QOpenGLContext class despite
> > the
> > fact that the documentation
> > <
> https://doc.qt.io/qtforpython-6/PySide6/QtGui/QOpenGLContext.html#PySide6.QtGui.PySide6.QtGui.QOpenGLContext.functions
> >
> > says it should be there.
> >
> > Can anyone help me understand what's going on? Am I misunderstanding
> > something, or is there a workaround I can use to access the OpenGL
> > functions?
>
>
> https://www.riverbankcomputing.com/static/Docs/PyQt6/api/qtopengl/qopenglversionfunctionsfactory.html#
>
> Phil
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20240301/7bb43ea2/attachment.htm>


More information about the PyQt mailing list