Details
Description
Here's a script to reproduce the bug. Works fine with PyQt5 5.12.
from PySide2.QtCore import QUrl from PySide2.QtQuick import QQuickView from PySide2.QtQml import QQmlApplicationEngine from PySide2.QtGui import QGuiApplication, QOpenGLVersionProfile, QSurfaceFormat, QVector3D if __name__ == '__main__': fmt = QSurfaceFormat() fmt.setProfile(QSurfaceFormat.CoreProfile) fmt.setVersion( 4, 1 ) fmt.setAlphaBufferSize(8) fmt.setStencilBufferSize(8) fmt.setDepthBufferSize(24) fmt.setOption(QSurfaceFormat.DebugContext) profile = QOpenGLVersionProfile() profile.setProfile(QSurfaceFormat.CoreProfile) profile.setVersion( 4, 1 ) app = QGuiApplication(sys.argv) QSurfaceFormat.setDefaultFormat(fmt) view = QQuickView() view.setSource( QUrl.fromLocalFile('whatever.qml') ) view.show() QGuiApplication.processEvents() gl = view.openglContext().versionFunctions(profile) gl.glClearColor(0,0,0,0) #FAILS with AttributeError: 'PySide2.QtGui.QAbstractOpenGLFunctions' object has no attribute 'glClearColor'
One possible hint, on my machine, _QOpenGLFunctions_4_1_Core.so seems not installed by PySide2 :
***:~$ locate QOpenGLFunctions /home/***/.local/lib/python3.6/site-packages/PyQt5/_QOpenGLFunctions_2_0.so /home/***/.local/lib/python3.6/site-packages/PyQt5/_QOpenGLFunctions_2_1.so /home/***/.local/lib/python3.6/site-packages/PyQt5/_QOpenGLFunctions_4_1_Core.so
whatever.qml:
import QtQuick 2.5 Rectangle { height: 800 width: 800 color: "blue" }
Attachments
Issue Links
- is duplicated by
-
PYSIDE-988 PySide2 : setAttributeArray of QOpenGLShaderProgram does not have effect
-
- Closed
-
-
PYSIDE-989 PySide2 : QOpenGLFunction
-
- Closed
-
- mentioned in
-
Page Loading...
For Gerrit Dashboard: PYSIDE-955 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
258756,16 | WIP: PySide2: Add OpenGL version functions | 5.12 | pyside/pyside-setup | Status: DEFERRED | -2 | 0 |
258799,8 | shiboken: Enable including typesystem XML snippets via entities | 5.12 | pyside/pyside-setup | Status: MERGED | +2 | 0 |
258897,11 | Ensure that signature strings never overflow again | 5.12 | pyside/pyside-setup | Status: MERGED | +2 | 0 |
259075,3 | Signatures: Add support for PySide2.QtCore.short/ushort/signed char | 5.12 | pyside/pyside-setup | Status: MERGED | +2 | 0 |
259818,4 | shiboken/Generators: Cache class information lists per class | 5.12 | pyside/pyside-setup | Status: MERGED | +2 | 0 |
259865,9 | Add PySide2: Add OpenGL version functions as separate module | 5.12 | pyside/pyside-setup | Status: MERGED | -2 | 0 |
338514,3 | PySide6: Add QOpenGLVersionFunctionsFactory | dev | pyside/pyside-setup | Status: MERGED | +2 | 0 |
338525,1 | WIP: Fix QOpenGLContext::versionFunctions() to return the versioned functions | tqtc/lts-5.15 | pyside/tqtc-pyside-setup | Status: ABANDONED | 0 | 0 |
338551,2 | PySide6: Add QOpenGLVersionFunctionsFactory | 6.0 | pyside/pyside-setup | Status: MERGED | +2 | 0 |
338650,4 | Add QOpenGLVersionFunctionsFactory from Qt 6 | tqtc/lts-5.15 | pyside/tqtc-pyside-setup | Status: MERGED | +2 | 0 |
338797,1 | WIP: test | tqtc/lts-5.15 | pyside/tqtc-pyside-setup | Status: ABANDONED | 0 | 0 |
338798,3 | PySide2: Implement QOpenGLContext.versionFunctions() | tqtc/lts-5.15 | pyside/tqtc-pyside-setup | Status: MERGED | +2 | 0 |