Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Anyone using Qt inside their own SDK?
QtWS25 Last Chance

Anyone using Qt inside their own SDK?

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 297 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
    chopper
    wrote on last edited by
    #1

    I'm looking to make use of some of Qt's cross platform network capabilities (which I've always enjoyed) - and I was curious as to how this would affect client applications that planned to use my SDK - because I suspect that large swathes of Qt will not function properly without a QApplication instance someplace...

    I wouldn't sweat my SDK instancing one except my concern is that a client application may itself be a Qt application - I suspect this is likely a serious problem. I assume there are many singletons at that level.

    Can you use, safely, a QCoreApplication if you isolate it to its own thread (at least avoiding event loop blocking)?

    Can you run the networking subsystem off a local event loop?

    Can you use a static request for the active QCoreApplication object and if not found, just use one during the scope of your operation? (Risky as it could be a race condition depending upon the behavior of the client application...)

    aha_1980A 1 Reply Last reply
    0
    • C chopper

      I'm looking to make use of some of Qt's cross platform network capabilities (which I've always enjoyed) - and I was curious as to how this would affect client applications that planned to use my SDK - because I suspect that large swathes of Qt will not function properly without a QApplication instance someplace...

      I wouldn't sweat my SDK instancing one except my concern is that a client application may itself be a Qt application - I suspect this is likely a serious problem. I assume there are many singletons at that level.

      Can you use, safely, a QCoreApplication if you isolate it to its own thread (at least avoiding event loop blocking)?

      Can you run the networking subsystem off a local event loop?

      Can you use a static request for the active QCoreApplication object and if not found, just use one during the scope of your operation? (Risky as it could be a race condition depending upon the behavior of the client application...)

      aha_1980A Offline
      aha_1980A Offline
      aha_1980
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi @chopper,

      In my limited experience, it was enough if the calling application that used my DLL was running an event loop - be it QCoreApplication or QGuiApplication. If none of these were available, I started my own QCoreApplication.

      Luckily, QCoreApplication::instance() returns nullptr if none of these exist so you can spin of your own loop.

      More interesting would be, if your SDK and the calling app uses different Qt versions. For that, Qt in namespace might be worth reading.

      Others may add more points - for my simple DLL (using Qt Network, SerialPort and soon SerialBus) that was enough so far.

      Regards

      Qt has to stay free or it will die.

      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