nucleic / enaml

Declarative User Interfaces for Python
http://enaml.readthedocs.io/en/latest/
Other
1.53k stars 130 forks source link

[DOC] How to use async/await function in Enaml ? #510

Closed Kochise closed 1 year ago

Kochise commented 1 year ago

I'd like to use async/await functions and avoid blocking the UI.

Is there a "progress bar" available for pending operations ?

MatthieuDartiailh commented 1 year ago

There is a progress bar widget but I am not sure this what you are looking for. Using qasync you may be able to get what you want.

Kochise commented 1 year ago

qasync ?

MatthieuDartiailh commented 1 year ago

If you want to use async / await you need an asyncio compatible eventloop. qasync implement one on top of the Qt event loop.

Kochise commented 1 year ago

So not directly inside a enaml object ?

MatthieuDartiailh commented 1 year ago

You can write async func in an Enaml object. At one point you will need to start an asyncio.Task and this requires an asyncio event loop. @frmdstryr may be able to provide a more in depth description since he has been doing more work using async.

Kochise commented 1 year ago

Ok thank, looking forward to it.

Kochise commented 1 year ago

Works with qasync, thanks.

Closing...