Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Qt Bluetooth server not working with QCoreApplication
Forum Update on Monday, May 27th 2025

Qt Bluetooth server not working with QCoreApplication

Scheduled Pinned Locked Moved Solved Mobile and Embedded
3 Posts 2 Posters 762 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.
  • C Offline
    C Offline
    cosmarc
    wrote on 5 Jul 2016, 19:40 last edited by
    #1

    Hello to all,

    I'm trying to build a simple Qt based Bluetooth Server (rfcomm) that just prints in the console the text that is sent by the client. I've noticed that when I'm using QCoreApplication(this is what I need because it will run on a board) instead of QGuiApplication or QApplication, I'm not able to receive any message and I'm not notified when a client is connected (SLOTS are not called). The entire code can be found here. The server can be tested with Qt Bluetooth Chat example and the entire code of my server is extracted from the example. It could be something related to the event loop but I don't know what. I'm running the server on OS X El Capitan with Qt 5.6.1.

    Any suggestions?
    Thanks a lot!

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 7 Aug 2016, 19:59 last edited by
      #2

      Hi and welcome to devnet,

      Are you removing the app_bundle option when you build your application with only QCoreApplication ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • C Offline
        C Offline
        cosmarc
        wrote on 12 Aug 2016, 08:34 last edited by cosmarc 8 Dec 2016, 08:35
        #3

        According to the Qt team response on this reported bug Bluetooth I/O related functionality needs a running loop which is not available through QCoreApplication.

        Qt 5.7 has a workaround for this - using Core Foundation event dispatcher.

        To activate this event dispatcher you'll need to set the 'QT_EVENT_DISPATCHER_CORE_FOUNDATION=1' environment variable.

        1 Reply Last reply
        1

        • Login

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