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...