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. Starting a QQmlApplicationEngine from a dll
QtWS25 Last Chance

Starting a QQmlApplicationEngine from a dll

Scheduled Pinned Locked Moved Unsolved General and Desktop
1 Posts 1 Posters 180 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.
  • Y Offline
    Y Offline
    yeehaw
    wrote on last edited by yeehaw
    #1

    Hello,

    I am using QT (Gui library, QML, etc...) in a dll plugin that is to be used in another software.
    My entry point is a user-defined dllMain function.
    I start by creating a QApplication when the DLL_PROCESS_ATTACH happens, but creating the QQmlApplicationEngine just after that (like in a static program with a normal main() ), the program freezes inside the QQmlThread waiting function.

    Is there a sane way to load the engine and pop a window from a dll?
    PS: I don't even call the exec() function of the Application and trying to follow what was discussed here: https://stackoverflow.com/questions/11054087/starting-qt-gui-from-dll-in-dllstart-function.

    The code inside the dll attach in the dllMain looks like this:

      auto* app = new QApplication(argc, nullptr);
      Application::RegisterTypes();
      auto* engine = new QQmlApplicationEngine; // freezes here in the QQmlThread
      app->processEvents();
    

    Thanks

    1 Reply Last reply
    0

    • Login

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