[prev in list] [next in list] [prev in thread] [next in thread]
List: pykde
Subject: QOpenGLContext missing "functions" method?
From: Jason Hallen <hallenj () gmail ! com>
Date: 2024-02-29 4:43:08
Message-ID: CA+-0_dp2LSxX8zoE+OR_4xcsPyTsSDvJMctEWjQVZCqefHPAGw () mail ! gmail ! com
[Download RAW message or body]
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?
Thanks!
Jason
[Attachment #3 (text/html)]
<div dir="ltr"><div>Hello everyone,</div><div><br></div><div>I'm trying to \
reimplement QOpenGLWidget in PyQt6 and have the following \
code.</div><div><br></div><div><b>class OpenGLWidget(QOpenGLWidget):<br> <br> \
def __init__(self):<br> super().__init__()<br><br> def \
initializeGL(self):<br> context = \
QtGui.QOpenGLContext.currentContext()<br> functions = \
context.functions()</b></div><div><br></div><div>However, I'm getting the \
following error when running the \
code.<br></div><div><br></div><div><b>AttributeError: 'QOpenGLContext' object \
has no attribute 'functions'</b></div><div><b><br></b></div><div>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 <a href="https://doc.qt.io/qtforpython-6/PySide6/QtGui/QOpenGLContext.html#PySide6.QtGui.PySide6.QtGui.QOpenGLContext.functions">documentation</a> \
says it should be there.</div><div><br></div><div>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?</div><div><br></div><div>Thanks!<br></div><div>Jason<br></div></div>
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic