aboutsummaryrefslogtreecommitdiffstats
path: root/examples/opengl/hellogl2/glwidget.py
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2024-12-20 08:35:46 +0100
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2025-01-06 11:52:18 +0100
commit7189a4c5ec193d30c6bd4e68701038880cbc5982 (patch)
tree87e4ec00d7e9d31e5df0c11b155e46ffd3726362 /examples/opengl/hellogl2/glwidget.py
parentab8b330123cb557f66306b237f4c3aa8c0004f39 (diff)
Use fully qualified enumerations in more examples
Pick-to: 6.8 Task-number: PYSIDE-1735 Change-Id: Ic2c478ef363d73f65f366e21529c0429c86539aa Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
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: