Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt for Python
  4. No deviceConnected() signals from QBluetoothLocalDevice in QCoreApplication (but works in QApplication)

No deviceConnected() signals from QBluetoothLocalDevice in QCoreApplication (but works in QApplication)

Scheduled Pinned Locked Moved Unsolved Qt for Python
4 Posts 2 Posters 154 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    hakane
    wrote on 29 Jan 2025, 16:37 last edited by
    #1

    Hello!

    I am working with a Pyside6.Qt app where we use Bluetooth, both QBluetoothLocalDevice and QBluetoothDeviceDiscoveryAgent. It works fine when I run it in a GUI app, using QApplication, but recently I've been trying to extract the Bluetooth code to maybe use in scripts. To do that I tried using QCoreApplication instead. I get the connected local devices when asking for them (connectedDevices()), I get signals for discovered BLE devices, but the signals for connected/disconnected local devices no longer work as expected.
    This is on macOS (haven't tried Linux yet).

    Note that I am new in the Qt world, but it seems weird to me that the exact same Bluetooth code works in QApplication, but only partially in QCoreApplication.

    I would be very happy for ideas on what might be wrong, but also pointers to other paths forward – like e.g. how to debug this. :-)

    Best regards,
    Håkan Eriksson

    1 Reply Last reply
    0
    • F Offline
      F Offline
      friedemannkleint
      wrote on 29 Jan 2025, 19:04 last edited by
      #2

      Which platform is this? - for example, on Android, the BT code uses QGuiApplication.

      1 Reply Last reply
      0
      • H Offline
        H Offline
        hakane
        wrote on 31 Jan 2025, 14:39 last edited by
        #3

        For now, I have only tried this on macOS. Also, I found other things seemingly stuck when using QCoreApplication instead of QApplication, so for now I've just resigned and use QApplication (even though it feels like overkill). Will try to separate stuff into threads, I'm sure it's all just a beginner's mistake somewhere.

        1 Reply Last reply
        0
        • F Offline
          F Offline
          friedemannkleint
          wrote on 31 Jan 2025, 19:36 last edited by
          #4

          QGuiApplication is a bit smaller...

          1 Reply Last reply
          0

          3/4

          31 Jan 2025, 14:39

          • Login

          • Login or register to search.
          3 out of 4
          • First post
            3/4
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved