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. Convert my mainwindow in one library with Qt
QtWS25 Last Chance

Convert my mainwindow in one library with Qt

Scheduled Pinned Locked Moved General and Desktop
7 Posts 2 Posters 1.4k 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.
  • J Offline
    J Offline
    Jeronimo
    wrote on last edited by A Former User
    #1

    Hi i did one program but now i want to convert in one .dll to use when the program needs to include the features of this library. When i say library i'm refering in one dll. dynamic link library or static link library. And then use like any .dll is possible? some suggestion or idea how i can update this?

    1 Reply Last reply
    0
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by mrjj
      #2

      Hi
      If the app using this DLL, is also a Qt Application, you can use Qt plugins
      http://doc.qt.io/qt-5/plugins-howto.html
      the "The Low-Level API: Extending Qt Applications" section.
      That will make it just works.

      If the using App is Not qt, then you have issue of where the event loop runs and it will
      be much harder.

      So please give more information of your actual goal.

      J 1 Reply Last reply
      0
      • mrjjM mrjj

        Hi
        If the app using this DLL, is also a Qt Application, you can use Qt plugins
        http://doc.qt.io/qt-5/plugins-howto.html
        the "The Low-Level API: Extending Qt Applications" section.
        That will make it just works.

        If the using App is Not qt, then you have issue of where the event loop runs and it will
        be much harder.

        So please give more information of your actual goal.

        J Offline
        J Offline
        Jeronimo
        wrote on last edited by
        #3

        @mrjj the app is not qt, and i have one little question about this. If i include one static library in one .dll dynamic link library with qt i can use this static link library with my dll and use all functions and all like one dynamic link library. The only thing that my .dll is written with qt but my app is not using qt so for this i ask.

        1 Reply Last reply
        0
        • mrjjM Offline
          mrjjM Offline
          mrjj
          Lifetime Qt Champion
          wrote on last edited by mrjj
          #4

          Well if you app is not Qt then it much more complicated as the App will have event loop not
          taking into account Qt exits. And GUI controls only likes to live in MainThread.

          So yes its possible to I dont know the details so hopefully someone can tell you.
          Tried to google for it but didn't find anything good. :(

          This explains (some of) the issues
          http://stackoverflow.com/questions/25025168/event-loop-in-qt-based-dll-in-a-non-qt-application

          J 1 Reply Last reply
          1
          • mrjjM mrjj

            Well if you app is not Qt then it much more complicated as the App will have event loop not
            taking into account Qt exits. And GUI controls only likes to live in MainThread.

            So yes its possible to I dont know the details so hopefully someone can tell you.
            Tried to google for it but didn't find anything good. :(

            This explains (some of) the issues
            http://stackoverflow.com/questions/25025168/event-loop-in-qt-based-dll-in-a-non-qt-application

            J Offline
            J Offline
            Jeronimo
            wrote on last edited by
            #5

            @mrjj i must to use QMfcApp::pluginInstance to avoid event loop problem ok. It's good. The only thing is i can include in one dynamic link library my static link library and use all features of this static link library in my dynamic link library ¿Maybe it's not good do this what do you think? And sorry for all and thx for your help!

            1 Reply Last reply
            0
            • mrjjM Offline
              mrjjM Offline
              mrjj
              Lifetime Qt Champion
              wrote on last edited by
              #6

              Oh is your non Qt App an MFC app ?
              Yes then QMfcApp can really help :)

              Hi if the static lib is the Qt
              and the Dynamic DLL is linked against it.
              Then it might work when you dynamically load the DLL from App X ( as it dont care for Qt)
              But it might also have issue. Mixing static and dynamic loading often is tricky unless its pure c++.
              Then the static part is just compiled into the Dyna Dll like any other code.
              But in case of Qt static. It might have issue with event loop or QApplication.
              I never tried it though.

              Lets wait some hours and see if other have more clear answer :)

              J 1 Reply Last reply
              0
              • mrjjM mrjj

                Oh is your non Qt App an MFC app ?
                Yes then QMfcApp can really help :)

                Hi if the static lib is the Qt
                and the Dynamic DLL is linked against it.
                Then it might work when you dynamically load the DLL from App X ( as it dont care for Qt)
                But it might also have issue. Mixing static and dynamic loading often is tricky unless its pure c++.
                Then the static part is just compiled into the Dyna Dll like any other code.
                But in case of Qt static. It might have issue with event loop or QApplication.
                I never tried it though.

                Lets wait some hours and see if other have more clear answer :)

                J Offline
                J Offline
                Jeronimo
                wrote on last edited by
                #7

                @mrjj the only is using pure c++ but i will wait if someone know better but i think you are right

                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