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. How to run Qt Application(GUI) from DLL?
Forum Updated to NodeBB v4.3 + New Features

How to run Qt Application(GUI) from DLL?

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 3 Posters 645 Views 1 Watching
  • 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.
  • K Offline
    K Offline
    Konstantin13
    wrote on last edited by
    #1

    Hello everyone.
    I need your advice. How to run Qt Application(GUI) from DLL? I have a console application C++, and I want to load DLL then run Qt application GUI from that DLL. How can I do that?

    raven-worxR 1 Reply Last reply
    0
    • K Konstantin13

      Hello everyone.
      I need your advice. How to run Qt Application(GUI) from DLL? I have a console application C++, and I want to load DLL then run Qt application GUI from that DLL. How can I do that?

      raven-worxR Offline
      raven-worxR Offline
      raven-worx
      Moderators
      wrote on last edited by
      #2

      @Konstantin13
      same way you would do in an application/exe.
      Start a QApplication event loop.
      But note that each process (the instance loading your dll) can only have a single QApplication. If thats not possible you will need to launch a separate process from within your dll and communicate with the launched application.

      --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
      If you have a question please use the forum so others can benefit from the solution in the future

      K 1 Reply Last reply
      3
      • Christian EhrlicherC Offline
        Christian EhrlicherC Offline
        Christian Ehrlicher
        Lifetime Qt Champion
        wrote on last edited by
        #3

        Or turn around the dependency - create a lib with the functionality of the console application and then use this library from a console or gui app.

        Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
        Visit the Qt Academy at https://academy.qt.io/catalog

        1 Reply Last reply
        2
        • raven-worxR raven-worx

          @Konstantin13
          same way you would do in an application/exe.
          Start a QApplication event loop.
          But note that each process (the instance loading your dll) can only have a single QApplication. If thats not possible you will need to launch a separate process from within your dll and communicate with the launched application.

          K Offline
          K Offline
          Konstantin13
          wrote on last edited by
          #4

          @raven-worx thank`s, I did as you say and everything works!
          I have already familiarized myself with the problems associated with processes. Now I have a new question : how I can communicate with UI(Qt) from my application and back???

          raven-worxR 1 Reply Last reply
          0
          • K Konstantin13

            @raven-worx thank`s, I did as you say and everything works!
            I have already familiarized myself with the problems associated with processes. Now I have a new question : how I can communicate with UI(Qt) from my application and back???

            raven-worxR Offline
            raven-worxR Offline
            raven-worx
            Moderators
            wrote on last edited by
            #5

            @Konstantin13 said in How to run Qt Application(GUI) from DLL?:

            how I can communicate with UI(Qt) from my application and back???

            https://doc.qt.io/qt-5/ipc.html
            or
            https://doc.qt.io/qt-5/qtremoteobjects-index.html

            --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
            If you have a question please use the forum so others can benefit from the solution in the future

            1 Reply Last reply
            2

            • Login

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