diff options
author | Adrian Herrmann <adrian.herrmann@qt.io> | 2024-01-25 02:05:15 +0100 |
---|---|---|
committer | Adrian Herrmann <adrian.herrmann@qt.io> | 2024-01-30 13:37:44 +0100 |
commit | 3bc157720e37198c99e2d9c8ce38185b894b2fdd (patch) | |
tree | 321744531d5c015f839b7c71ab99824f454a40f0 /sources/pyside6/doc/PySide6 | |
parent | e57c5d0adb446c38dccbe9e7e9003e89a33b4c55 (diff) |
QtAsyncio: Introduce quit_qapp argument
A new optional argument quit_qapp can be passed to QtAsyncio.run()
to configure whether the QCoreApplication at the core of QtAsyncio
should be shut down when asyncio finishes. A special case where one
would want to disable this is test suites that want to reuse a single
QCoreApplication instance across all unit tests, which would fail if
this instance is shut down every time.
Pick-to: 6.6
Fixes: PYSIDE-2575
Task-number: PYSIDE-769
Change-Id: I49cd0a50311fb30cc50df9b7f6a6d73fe8c58613
Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'sources/pyside6/doc/PySide6')
-rw-r--r-- | sources/pyside6/doc/PySide6/QtAsyncio/index.rst | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/sources/pyside6/doc/PySide6/QtAsyncio/index.rst b/sources/pyside6/doc/PySide6/QtAsyncio/index.rst index e5c06de81..90c0ee670 100644 --- a/sources/pyside6/doc/PySide6/QtAsyncio/index.rst +++ b/sources/pyside6/doc/PySide6/QtAsyncio/index.rst @@ -118,6 +118,19 @@ or to run the coroutine and then stop the event loop upon its completion. This latter case behaves identically to ``asyncio.run(my_coroutine())``. +An additional optional argument ``quit_qapp`` can be passed to ``run()`` +to configure whether the QCoreApplication at the core of QtAsyncio +should be shut down when asyncio finishes. A special case where one +would want to disable this is test suites that want to reuse a single +QCoreApplication instance across all unit tests, which would fail if +this instance is shut down every time. The default is ``True``. + +Note that this argument is orthogonal to the ``keep_running`` argument. +``keep_running`` determines if **asyncio** should keep running after the +coroutine has finished, while ``quit_qapp`` determines if the +QCoreApplication should be shut down after asyncio has finished. It is +possible for asyncio to finish while the QCoreApplication is kept alive. + Coroutines explained ^^^^^^^^^^^^^^^^^^^^ |