Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct

    Unsolved Anyone using Qt inside their own SDK?

    General and Desktop
    2
    2
    177
    Loading More Posts
    • 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
      chopper last edited by

      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_1980 1 Reply Last reply Reply Quote 0
      • aha_1980
        aha_1980 Lifetime Qt Champion @chopper last edited by

        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 Reply Quote 1
        • First post
          Last post