Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Tismer <tismer@stackless.com>2021-03-28 19:17:11 +0200
committerChristian Tismer <tismer@stackless.com>2021-04-07 11:00:57 +0200
commit817fae35a8669f16e6442b9d416c5578bb14285c (patch)
treef4b9ddb2a76dc3dc345605fa387cbb10b9293e9d /examples/installer_test/hello.py
parente641c225d2954cfc5c85e00eda83f5319c84b3c8 (diff)
wheel_tester: Enable it again for Qt >= 6 with Nuitka
With the usage of nuitka, we have a working compiled test, again. Only the scriptableapplication fails, and only for CMake. This will be fixed in another check-in. The PyInstaller test remains in the code for being re-enabled. Task-number: PYSIDE-1523 Change-Id: Ic831fa5b110bbff4150a01cb8a7344ae050aae02 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'examples/installer_test/hello.py')
-rw-r--r--examples/installer_test/hello.py15
1 files changed, 10 insertions, 5 deletions
diff --git a/examples/installer_test/hello.py b/examples/installer_test/hello.py
index 7a8811158..f8434133e 100644
--- a/examples/installer_test/hello.py
+++ b/examples/installer_test/hello.py
@@ -46,10 +46,10 @@ hello.py
This simple script shows a label with changing "Hello World" messages.
It can be used directly as a script, but we use it also to automatically
-test PyInstaller. See testing/wheel_tester.py .
+test PyInstaller or Nuitka. See testing/wheel_tester.py .
-When used with PyInstaller, it automatically stops its execution after
-2 seconds.
+When compiled with Nuitka or used with PyInstaller, it automatically
+stops its execution after 2 seconds.
"""
import sys
@@ -61,6 +61,11 @@ from PySide6.QtWidgets import (QApplication, QLabel, QPushButton,
QVBoxLayout, QWidget)
from PySide6.QtCore import Slot, Qt, QTimer
+is_compiled = "__compiled__" in globals() # Nuitka
+uses_embedding = sys.pyside_uses_embedding # PyInstaller
+auto_quit = "Nuitka" if is_compiled else "PyInst" if uses_embedding else False
+
+
class MyWidget(QWidget):
def __init__(self):
QWidget.__init__(self)
@@ -69,7 +74,7 @@ class MyWidget(QWidget):
"Hola Mundo", "Привет мир"]
self.button = QPushButton("Click me!")
- self.text = QLabel("Hello World embedded={}".format(sys.pyside_uses_embedding))
+ self.text = QLabel("Hello World auto_quit={}".format(auto_quit))
self.text.setAlignment(Qt.AlignCenter)
self.layout = QVBoxLayout()
@@ -94,7 +99,7 @@ if __name__ == "__main__":
widget = MyWidget()
widget.resize(800, 600)
widget.show()
- if sys.pyside_uses_embedding:
+ if auto_quit:
milliseconds = 2 * 1000 # run 2 second
QTimer.singleShot(milliseconds, app.quit)
retcode = app.exec_()