aboutsummaryrefslogtreecommitdiffstats
path: root/examples/opengl/hellogl2/glwidget.py
diff options
context:
space:
mode:
Diffstat (limited to 'examples/opengl/hellogl2/glwidget.py')
-rw-r--r--examples/opengl/hellogl2/glwidget.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/examples/opengl/hellogl2/glwidget.py b/examples/opengl/hellogl2/glwidget.py
index d86ba59e8..9660f8736 100644
--- a/examples/opengl/hellogl2/glwidget.py
+++ b/examples/opengl/hellogl2/glwidget.py
@@ -82,7 +82,7 @@ class GLWidget(QOpenGLWidget, QOpenGLFunctions):
QOpenGLWidget.__init__(self, parent)
QOpenGLFunctions.__init__(self)
- self._core = QSurfaceFormat.defaultFormat().profile() == QSurfaceFormat.CoreProfile
+ self._core = QSurfaceFormat.defaultFormat().profile() == QSurfaceFormat.OpenGLContextProfile.CoreProfile # noqa: E501
self._x_rot = 0
self._y_rot = 0
@@ -180,9 +180,9 @@ class GLWidget(QOpenGLWidget, QOpenGLFunctions):
self._vertex_shader = VERTEX_SHADER_SOURCE
self._fragment_shader = FRAGMENT_SHADER_SOURCE
- self.program.addShaderFromSourceCode(QOpenGLShader.Vertex,
+ self.program.addShaderFromSourceCode(QOpenGLShader.ShaderTypeBit.Vertex,
self._vertex_shader)
- self.program.addShaderFromSourceCode(QOpenGLShader.Fragment,
+ self.program.addShaderFromSourceCode(QOpenGLShader.ShaderTypeBit.Fragment,
self._fragment_shader)
self.program.bindAttributeLocation("vertex", 0)
self.program.bindAttributeLocation("normal", 1)
@@ -263,7 +263,7 @@ class GLWidget(QOpenGLWidget, QOpenGLFunctions):
dx = pos.x() - self._last_pos.x()
dy = pos.y() - self._last_pos.y()
- if event.buttons() & Qt.LeftButton:
+ if event.buttons() & Qt.MouseButton.LeftButton:
self.set_xrotation(self._x_rot + 8 * dy)
self.set_yrotation(self._y_rot + 8 * dx)
elif event.buttons() & Qt.RightButton: