Qt Forum

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

    Convert my mainwindow in one library with Qt

    General and Desktop
    2
    7
    1081
    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.
    • J
      Jeronimo last edited by A Former User

      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 Reply Quote 0
      • mrjj
        mrjj Lifetime Qt Champion last edited by 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 1 Reply Last reply Reply Quote 0
        • J
          Jeronimo @mrjj last edited by

          @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 Reply Quote 0
          • mrjj
            mrjj Lifetime Qt Champion last edited by 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 1 Reply Last reply Reply Quote 1
            • J
              Jeronimo @mrjj last edited by

              @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 Reply Quote 0
              • mrjj
                mrjj Lifetime Qt Champion last edited by

                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 Reply Quote 0
                • J
                  Jeronimo @mrjj last edited by

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