aboutsummaryrefslogtreecommitdiffstats
path: root/examples/opengl
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2022-08-18 15:44:52 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2022-08-24 12:58:38 +0200
commitebfaceedf7413ce70e6ae411c821e6c3e68aa37f (patch)
tree823dfbe6faa238345f18f1af2ab92e4d620dcd84 /examples/opengl
parent5c37a8c9ffea848f4115e3b89f50bddc4ea4a6de (diff)
Examples: Add some missing slot decorators
As unearthed by the warnings added by the logging category. As a drive-by, fix some imports. Pick-to: 6.3 6.2 Task-number: PYSIDE-2033 Change-Id: I3812c705b60eb7be744c3532fcfb0e4024763885 Reviewed-by: Christian Tismer <tismer@stackless.com>
Diffstat (limited to 'examples/opengl')
-rw-r--r--examples/opengl/contextinfo/contextinfo.py4
-rw-r--r--examples/opengl/hellogl2/hellogl2.py7
-rw-r--r--examples/opengl/threadedqopenglwidget/glwidget.py1
3 files changed, 10 insertions, 2 deletions
diff --git a/examples/opengl/contextinfo/contextinfo.py b/examples/opengl/contextinfo/contextinfo.py
index f66d5a46f..5ca7ecb26 100644
--- a/examples/opengl/contextinfo/contextinfo.py
+++ b/examples/opengl/contextinfo/contextinfo.py
@@ -9,7 +9,8 @@ import sys
from textwrap import dedent
-from PySide6.QtCore import QCoreApplication, QLibraryInfo, QSize, QTimer, Qt
+from PySide6.QtCore import (QCoreApplication, QLibraryInfo, QSize, QTimer, Qt,
+ Slot)
from PySide6.QtGui import (QMatrix4x4, QOpenGLContext, QSurfaceFormat, QWindow)
from PySide6.QtOpenGL import (QOpenGLBuffer, QOpenGLShader,
QOpenGLShaderProgram, QOpenGLVertexArrayObject)
@@ -192,6 +193,7 @@ class RenderWindow(QWindow):
self.context.swapBuffers(self)
self.context.doneCurrent()
+ @Slot()
def slot_timer(self):
self.render()
self.angle += 1
diff --git a/examples/opengl/hellogl2/hellogl2.py b/examples/opengl/hellogl2/hellogl2.py
index 7520f6bc6..7ea3b7ad3 100644
--- a/examples/opengl/hellogl2/hellogl2.py
+++ b/examples/opengl/hellogl2/hellogl2.py
@@ -8,7 +8,8 @@ from argparse import ArgumentParser, RawTextHelpFormatter
import ctypes
import math
import sys
-from PySide6.QtCore import QCoreApplication, Signal, SIGNAL, SLOT, Qt, QSize, QPointF
+from PySide6.QtCore import (QCoreApplication, Signal, Slot,
+ Qt, QSize, QPointF)
from PySide6.QtGui import (QVector3D, QOpenGLFunctions,
QMatrix4x4, QOpenGLContext, QSurfaceFormat, QVector3DList)
from PySide6.QtOpenGL import (QOpenGLVertexArrayObject, QOpenGLBuffer,
@@ -228,6 +229,7 @@ class GLWidget(QOpenGLWidget, QOpenGLFunctions):
angle -= 360 * 16
return angle
+ @Slot(int)
def set_xrotation(self, angle):
angle = self.normalize_angle(angle)
if angle != self._x_rot:
@@ -235,6 +237,7 @@ class GLWidget(QOpenGLWidget, QOpenGLFunctions):
self.x_rotation_changed.emit(angle)
self.update()
+ @Slot(int)
def set_yrotation(self, angle):
angle = self.normalize_angle(angle)
if angle != self._y_rot:
@@ -242,6 +245,7 @@ class GLWidget(QOpenGLWidget, QOpenGLFunctions):
self.y_rotation_changed.emit(angle)
self.update()
+ @Slot(int)
def set_zrotation(self, angle):
angle = self.normalize_angle(angle)
if angle != self._z_rot:
@@ -249,6 +253,7 @@ class GLWidget(QOpenGLWidget, QOpenGLFunctions):
self.z_rotation_changed.emit(angle)
self.update()
+ @Slot()
def cleanup(self):
self.makeCurrent()
self._logo_vbo.destroy()
diff --git a/examples/opengl/threadedqopenglwidget/glwidget.py b/examples/opengl/threadedqopenglwidget/glwidget.py
index 68a86dc77..edb88e77c 100644
--- a/examples/opengl/threadedqopenglwidget/glwidget.py
+++ b/examples/opengl/threadedqopenglwidget/glwidget.py
@@ -68,6 +68,7 @@ class GLWidget(QOpenGLWidget):
def on_resized(self):
self._renderer.unlock_renderer()
+ @Slot()
def grab_context(self):
if not self._renderer:
return