Skip to content

Support for QThread and QEventLoop added. This will enable ib_async to run in a separate worker. #134

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Flippo24
Copy link

@Flippo24 Flippo24 commented Mar 24, 2025

I use ib_async in a separate QThread with its own QEventLoop. I had to adapt useQt for this. A custom QApplication context can now also be used.

Minimal example QApplication:

class Application(QApplication):
    def __init__(self, argv):
        super().__init__(argv)
        ...

util.patchAsyncio()
app = Application(sys.argv)
util.useQt('PySide6', qtContext=app)

in a worker thread i use:

util.patchAsyncio()
util.useQt('PySide6', qtContext=QThread.currentThread())
self.ib = IB()
self.ib.run()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant