aboutsummaryrefslogtreecommitdiffstats
path: root/examples/opengl
diff options
context:
space:
mode:
authorCristian Maureira-Fredes <Cristian.Maureira-Fredes@qt.io>2021-05-12 14:51:00 +0200
committerCristian Maureira-Fredes <Cristian.Maureira-Fredes@qt.io>2021-05-12 20:33:39 +0200
commit06f6395b46492b2be45f9f06f9258f9b31b323e4 (patch)
tree0833daaf85cd28b599269aecc3a22b8c48d69e1c /examples/opengl
parentc5db9d63277201ee58829f7eb0656c534d04c249 (diff)
examples: avoid built-in functions names as variable
There were many variable names using built-in python functions so this patch renames them to something safe. Task-number: PYSIDE-841 Change-Id: Iade34711ba31797f08f3f924be05023a7f12d5ef Reviewed-by: Christian Tismer <tismer@stackless.com>
Diffstat (limited to 'examples/opengl')
-rw-r--r--examples/opengl/contextinfo/contextinfo.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/examples/opengl/contextinfo/contextinfo.py b/examples/opengl/contextinfo/contextinfo.py
index 4e2704f1c..47fd83abc 100644
--- a/examples/opengl/contextinfo/contextinfo.py
+++ b/examples/opengl/contextinfo/contextinfo.py
@@ -118,10 +118,10 @@ def print_surface_format(surface_format):
class RenderWindow(QWindow):
- def __init__(self, format):
+ def __init__(self, fmt):
super().__init__()
self.setSurfaceType(QWindow.OpenGLSurface)
- self.setFormat(format)
+ self.setFormat(fmt)
self.context = QOpenGLContext(self)
self.context.setFormat(self.requestedFormat())
if not self.context.create():
@@ -135,14 +135,14 @@ class RenderWindow(QWindow):
self.vao = QOpenGLVertexArrayObject()
self.vbo = QOpenGLBuffer()
- format = self.context.format()
- use_new_style_shader = format.profile() == QSurfaceFormat.CoreProfile
+ fmt = self.context.format()
+ use_new_style_shader = fmt.profile() == QSurfaceFormat.CoreProfile
# Try to handle 3.0 & 3.1 that do not have the core/compatibility profile
# concept 3.2+ has. This may still fail since version 150 (3.2) is
# specified in the sources but it's worth a try.
- if (format.renderableType() == QSurfaceFormat.OpenGL and format.majorVersion() == 3
- and format.minorVersion() <= 1):
- use_new_style_shader = not format.testOption(QSurfaceFormat.DeprecatedFunctions)
+ if (fmt.renderableType() == QSurfaceFormat.OpenGL and fmt.majorVersion() == 3
+ and fmt.minorVersion() <= 1):
+ use_new_style_shader = not fmt.testOption(QSurfaceFormat.DeprecatedFunctions)
vertex_shader = vertex_shader_source if use_new_style_shader else vertex_shader_source_110
fragment_shader = fragment_shader_source if use_new_style_shader else fragment_shader_source_110