Skip to content

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

Open
Flippo24 wants to merge 1 commit intoib-api-reloaded:mainfrom
Flippo24:main
Open

Support for QThread and QEventLoop added. This will enable ib_async to run in a separate worker.#134
Flippo24 wants to merge 1 commit intoib-api-reloaded:mainfrom
Flippo24:main

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