aboutsummaryrefslogtreecommitdiffstats
path: root/examples/opengl/hellogl2
diff options
context:
space:
mode:
authorFriedemann Kleint <[email protected]>2024-09-18 07:36:20 +0200
committerFriedemann Kleint <[email protected]>2024-09-18 08:28:04 +0200
commite4199ec3881d8e556385af98084856be857e0dbe (patch)
tree77b264f5a21cff9f131a6b27e3b5142745faf91f /examples/opengl/hellogl2
parentf48433db9a5be32c0b401c1d5203853abbff6c32 (diff)
type hints: Fix some typing bugs for mypy (forgiveness)
The new enums still support old syntax by the forgiveness mode. Nevertheless, when using mypy to check files, strict correctness is enforced. We correct a large number of forgiveness-induced errors, but there is still a whole lot of other complaints to fix. Task-number: PYSIDE-2846 Change-Id: If566187d268ef75bc09b8d86f73d2c7d19f284f9 Reviewed-by: Friedemann Kleint <[email protected]>
Diffstat (limited to 'examples/opengl/hellogl2')
-rw-r--r--examples/opengl/hellogl2/main.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/examples/opengl/hellogl2/main.py b/examples/opengl/hellogl2/main.py
index 41884ab12..6bce36b01 100644
--- a/examples/opengl/hellogl2/main.py
+++ b/examples/opengl/hellogl2/main.py
@@ -17,9 +17,9 @@ try:
from glwidget import GLWidget
except ImportError:
app = QApplication(sys.argv)
- message_box = QMessageBox(QMessageBox.Critical, "OpenGL hellogl",
+ message_box = QMessageBox(QMessageBox.Icon.Critical, "OpenGL hellogl",
"PyOpenGL must be installed to run this example.",
- QMessageBox.Close)
+ QMessageBox.StandardButton.Close)
message_box.setDetailedText("Run:\npip install PyOpenGL PyOpenGL_accelerate")
message_box.exec()
sys.exit(1)
@@ -43,15 +43,15 @@ if __name__ == '__main__':
fmt.setSamples(4)
if options.coreprofile:
fmt.setVersion(3, 2)
- fmt.setProfile(QSurfaceFormat.CoreProfile)
+ fmt.setProfile(QSurfaceFormat.OpenGLContextProfile.CoreProfile)
QSurfaceFormat.setDefaultFormat(fmt)
GLWidget.set_transparent(options.transparent)
main_window = MainWindow()
if options.transparent:
- main_window.setAttribute(Qt.WA_TranslucentBackground)
- main_window.setAttribute(Qt.WA_NoSystemBackground, False)
+ main_window.setAttribute(Qt.WidgetAttribute.WA_TranslucentBackground)
+ main_window.setAttribute(Qt.WidgetAttribute.WA_NoSystemBackground, False)
main_window.show()