aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdrian Herrmann <adrian.herrmann@qt.io>2023-03-04 02:20:38 +0100
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2023-03-20 15:26:23 +0000
commit392559ed8c4d6a733a72af9c1311b8cb2ff3e633 (patch)
tree5d1a8fb7f26e5d794cb43601c56fc098fdfba006
parent357b9567347765aa639b24e5ab095bccd0ab0419 (diff)
examples: Use new enums in asyncio examplesv6.4.36.4
Use the new enum syntax in the asyncio examples instead of relying on forgiveness mode. Task-number: PYSIDE-2169 Change-Id: I0faa384586e27f13643688b55ea03393da502753 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> (cherry picked from commit 5468617478c93951de7744b6bad8608911a78880) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--examples/async/eratosthenes/eratosthenes_asyncio.py4
-rw-r--r--examples/async/eratosthenes/eratosthenes_trio.py4
-rw-r--r--examples/async/minimal/minimal_asyncio.py4
-rw-r--r--examples/async/minimal/minimal_trio.py4
4 files changed, 8 insertions, 8 deletions
diff --git a/examples/async/eratosthenes/eratosthenes_asyncio.py b/examples/async/eratosthenes/eratosthenes_asyncio.py
index f63058cdf..a5177a94b 100644
--- a/examples/async/eratosthenes/eratosthenes_asyncio.py
+++ b/examples/async/eratosthenes/eratosthenes_asyncio.py
@@ -132,7 +132,7 @@ class AsyncHelper(QObject):
asyncio to resume when the event is handled. event.fn() is
the next entry point of the asyncio event loop. """
def event(self, event):
- if event.type() == QEvent.User + 1:
+ if event.type() == QEvent.Type.User + 1:
event.fn()
return True
return False
@@ -141,7 +141,7 @@ class AsyncHelper(QObject):
""" This is the QEvent that will be handled by the ReenterQtObject.
self.fn is the next entry point of the asyncio event loop. """
def __init__(self, fn):
- super().__init__(QEvent.Type(QEvent.User + 1))
+ super().__init__(QEvent.Type(QEvent.Type.User + 1))
self.fn = fn
def __init__(self, worker, entry):
diff --git a/examples/async/eratosthenes/eratosthenes_trio.py b/examples/async/eratosthenes/eratosthenes_trio.py
index 862a4fddd..89d3d1ce6 100644
--- a/examples/async/eratosthenes/eratosthenes_trio.py
+++ b/examples/async/eratosthenes/eratosthenes_trio.py
@@ -125,7 +125,7 @@ class AsyncHelper(QObject):
Trio to resume when the event is handled. event.fn() is the
next entry point of the Trio event loop. """
def event(self, event):
- if event.type() == QEvent.User + 1:
+ if event.type() == QEvent.Type.User + 1:
event.fn()
return True
return False
@@ -134,7 +134,7 @@ class AsyncHelper(QObject):
""" This is the QEvent that will be handled by the ReenterQtObject.
self.fn is the next entry point of the Trio event loop. """
def __init__(self, fn):
- super().__init__(QEvent.Type(QEvent.User + 1))
+ super().__init__(QEvent.Type(QEvent.Type.User + 1))
self.fn = fn
def __init__(self, worker, entry):
diff --git a/examples/async/minimal/minimal_asyncio.py b/examples/async/minimal/minimal_asyncio.py
index 497e388a1..80c81da3b 100644
--- a/examples/async/minimal/minimal_asyncio.py
+++ b/examples/async/minimal/minimal_asyncio.py
@@ -46,7 +46,7 @@ class AsyncHelper(QObject):
asyncio to resume when the event is handled. event.fn() is
the next entry point of the asyncio event loop. """
def event(self, event):
- if event.type() == QEvent.User + 1:
+ if event.type() == QEvent.Type.User + 1:
event.fn()
return True
return False
@@ -55,7 +55,7 @@ class AsyncHelper(QObject):
""" This is the QEvent that will be handled by the ReenterQtObject.
self.fn is the next entry point of the asyncio event loop. """
def __init__(self, fn):
- super().__init__(QEvent.Type(QEvent.User + 1))
+ super().__init__(QEvent.Type(QEvent.Type.User + 1))
self.fn = fn
def __init__(self, worker, entry):
diff --git a/examples/async/minimal/minimal_trio.py b/examples/async/minimal/minimal_trio.py
index 526bdd331..5ae19fa36 100644
--- a/examples/async/minimal/minimal_trio.py
+++ b/examples/async/minimal/minimal_trio.py
@@ -46,7 +46,7 @@ class AsyncHelper(QObject):
Trio to resume when the event is handled. event.fn() is the
next entry point of the Trio event loop. """
def event(self, event):
- if event.type() == QEvent.User + 1:
+ if event.type() == QEvent.Type.User + 1:
event.fn()
return True
return False
@@ -55,7 +55,7 @@ class AsyncHelper(QObject):
""" This is the QEvent that will be handled by the ReenterQtObject.
self.fn is the next entry point of the Trio event loop. """
def __init__(self, fn):
- super().__init__(QEvent.Type(QEvent.User + 1))
+ super().__init__(QEvent.Type(QEvent.Type.User + 1))
self.fn = fn
def __init__(self, worker, entry):