-
-
Notifications
You must be signed in to change notification settings - Fork 70
Plan to support QtAsyncio apps? #599
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hi @guilbaudl, No plans so far, in fact I just learned it existed. Seems to be in preview, but definitely seems interesting! |
It is in preview but it is actually part of PySide stable releases, so that would be amazing to try to support it! It is usable so far at least. |
It seems the first steps would be to study what if __name__ == "__main__":
app = QApplication(sys.argv)
main_window = MainWindow()
main_window.show()
QtAsyncio.run(handle_sigint=True) I believe it creates the Qt-specific event loop, and integrate with the Given # content of conftest.py
@pytest.fixture
def qapp(qapp: QApplication) -> QApplication:
# The qapp parameter is the builtin pytest-qt `qapp` fixture.
# At this point, we need to setup the event loop, etc (what QtAsyncio.run does under the covers),
# but in a non-blocking manner.
return qapp Also, we do not need For example, a test for the def test_main_window(qtbot):
main_window = MainWindow()
qtbot.add_widget(main_window)
main_window.async_trigger.click() # This triggers the `async set_text` method.
def check_text_changed():
assert main_window.text.text() == "What do you get if you multiply six by nine?"
qtbot.waitUntil(check_text_changed) Full disclosure, I do not have plans to work on this any time soon, I'm just writing down some quick thoughts in case somebody wants to tackle this. |
Hello,
I couldn't find any information regarding QtAsyncio support. Is there any plan moving forward to support apps running thanks to QtAsyncio?
Doc for QtAsyncio
Regards
The text was updated successfully, but these errors were encountered: