Oddball configuration: and Can PySide6 Bluetooth Classic and BLE be run in a separate python thread?
-
using python 3.13 on an M3 matchbook pro, but not using the version that has the experimental threading model.
I am using the Bluestuff objects only, running in the context of a wxpython app
I have
os.environ['QT_EVENT_DISPATCHER_CORE_FOUNDATION'] = '1'I am only using QT for it's bluetooth, since Python STILL lacks bluetooth support , and the app has many threads but the QT bluetooth objects are all running in the same thread as the application (the 'main' thread, where all the wxpythoin guy objects are running)
so my question is:
are there 'gotchas' about running the QT bluetooth in a thread that is NOT the application's threadspecifically: do I have to do anything other than
os.environ['QT_EVENT_DISPATCHER_CORE_FOUNDATION'] = '1' -
using python 3.13 on an M3 matchbook pro, but not using the version that has the experimental threading model.
I am using the Bluestuff objects only, running in the context of a wxpython app
I have
os.environ['QT_EVENT_DISPATCHER_CORE_FOUNDATION'] = '1'I am only using QT for it's bluetooth, since Python STILL lacks bluetooth support , and the app has many threads but the QT bluetooth objects are all running in the same thread as the application (the 'main' thread, where all the wxpythoin guy objects are running)
so my question is:
are there 'gotchas' about running the QT bluetooth in a thread that is NOT the application's threadspecifically: do I have to do anything other than
os.environ['QT_EVENT_DISPATCHER_CORE_FOUNDATION'] = '1'@Ravenboy said in Oddball configuration: and Can PySide6 Bluetooth Classic and BLE be run in a separate python thread?:
are there 'gotchas' about running the QT bluetooth in a thread that is NOT the application's thread
Should work. But you most probably will need Qt event loop.
-
thanks, I'll give it a try
as it is now, the service gets registered fine, but when I start a service discovery
I get
serviceInfo.registerService(localAdapter.address()): True
2024-10-31 11:40:55.383 Python[9728:593469] -[IOBluetoothDeviceInquiry initWithDelegate:] - 0x6000032d2a60
QObject::startTimer: Timers can only be used with threads started with QThreadthis is because so far the QT objects are all running in the wxpyton app thread
t sounds like I have to start a qThread, and that thread needs to have a QCoreApplication object running.
-
Hi,
It looks like you are creating objects in the main thread and then move them to the other thread hence the error message you get.
-
I didn't post anything about receiving error messages in this thread.
when I posted in this thread I hadn't tried doing anything about having another thread yet.I HAVE since tried it and the Mac OSX won't allow running QT applications in other than the main thread, whether the main thread is a wxpython app thread, OR if the main thread is a QT application main thread.
I am just about to give up. I am locked in to over a million lines of wxpython code, and switching my apps to QT is not going to happen because of the size of my legacy code base
thanks for the help