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 create and load UI plugins?
Forum Updated to NodeBB v4.3 + New Features

How to create and load UI plugins?

Scheduled Pinned Locked Moved Solved General and Desktop
pluginloadergui
20 Posts 3 Posters 11.9k Views 2 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.
  • raven-worxR raven-worx

    yes, maybe this was a long shot from me.
    But basically it's the same mechanism i was talking about.
    Just Qt (QFactoryLoader) does most of the work under the hood automatically.

    ILI Offline
    ILI Offline
    IL
    wrote on last edited by
    #11

    @raven-worx
    Hello and thanks,
    Regarding your first comment/reply -
    Quote:
    Simply create a Lib project in QtCreator.
    Now the question is if you want a

    • list itemshared library (linked dependency - program doesn't run without it), or
    • list itema Qt-plugin (discovered and loaded at runtime - program also runs without it)

    Then simply add a UI file manually to your QtCreator project.
    Right click on your project -> Add New -> Qt -> Qt Designer Form Class
    End of Quote
    The second option is what I need, and I already did that but after adding UI into the QT plugin, the project doesn't compiled any more, it complain about missing files, like ui_<project-name>.h and more.

    • What is the correct way to do that?

    Best regards,
    IL

    1 Reply Last reply
    0
    • raven-worxR Offline
      raven-worxR Offline
      raven-worx
      Moderators
      wrote on last edited by
      #12

      try re-running qmake.
      (Right click on project -> Run qmake)

      --- 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

      ILI 1 Reply Last reply
      0
      • raven-worxR raven-worx

        try re-running qmake.
        (Right click on project -> Run qmake)

        ILI Offline
        ILI Offline
        IL
        wrote on last edited by
        #13

        @raven-worx
        same thing,
        Running qmake is ok but build failed
        it should at-least generate ui_project.h file but it doesnt do that.

        kshegunovK 1 Reply Last reply
        0
        • ILI IL

          @raven-worx
          same thing,
          Running qmake is ok but build failed
          it should at-least generate ui_project.h file but it doesnt do that.

          kshegunovK Offline
          kshegunovK Offline
          kshegunov
          Moderators
          wrote on last edited by
          #14

          @IL
          Do you have your forms in your project, like this:

          FORMS += myform.ui
          

          I don't know what IDE you're using, for me QtCreator does this automatically, but it's possible it's different for you.

          Read and abide by the Qt Code of Conduct

          ILI 1 Reply Last reply
          0
          • kshegunovK kshegunov

            @IL
            Do you have your forms in your project, like this:

            FORMS += myform.ui
            

            I don't know what IDE you're using, for me QtCreator does this automatically, but it's possible it's different for you.

            ILI Offline
            ILI Offline
            IL
            wrote on last edited by
            #15

            @kshegunov
            Yes I do have the file in my form project.
            The thing is when I create new QT widgets application project, QtCreator creat the file.ui file and under the output folder build-...-Debug it create a ui_file.h which contains all the UI stuff
            But when I create QtPlugin library project and add UI form, the ui_file doesn't create eventhough it adding include of it.
            I am working with QT-5.5.0 and Qt Creator 3.4.2

            Any idea?

            kshegunovK raven-worxR 2 Replies Last reply
            0
            • ILI IL

              @kshegunov
              Yes I do have the file in my form project.
              The thing is when I create new QT widgets application project, QtCreator creat the file.ui file and under the output folder build-...-Debug it create a ui_file.h which contains all the UI stuff
              But when I create QtPlugin library project and add UI form, the ui_file doesn't create eventhough it adding include of it.
              I am working with QT-5.5.0 and Qt Creator 3.4.2

              Any idea?

              kshegunovK Offline
              kshegunovK Offline
              kshegunov
              Moderators
              wrote on last edited by
              #16

              @IL
              When I go to the New file or project ... menu and then from the sidebar I select Library, I can choose from:

              1. C++ library - this is what you actually want
              2. QtQuick 1 Extension plugin - this is for QtQuick (not relevant to your case)
              3. QtQuick 2 Extension plugin - this is for QtQuick 2 (not relevant to your case as well)
              4. Qt Creator Plugin - unless you want to create plugins for QtCreator, this is not your project type.

              I don't have a QtPlugin library project in my list.

              Read and abide by the Qt Code of Conduct

              ILI 1 Reply Last reply
              0
              • ILI IL

                @kshegunov
                Yes I do have the file in my form project.
                The thing is when I create new QT widgets application project, QtCreator creat the file.ui file and under the output folder build-...-Debug it create a ui_file.h which contains all the UI stuff
                But when I create QtPlugin library project and add UI form, the ui_file doesn't create eventhough it adding include of it.
                I am working with QT-5.5.0 and Qt Creator 3.4.2

                Any idea?

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

                @IL
                seems like this is a bug in Qt5's qmake. That the build steps are not created correctly when TEMPLATE=lib
                It works perfectly fine in Qt4.

                --- 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
                0
                • kshegunovK kshegunov

                  @IL
                  When I go to the New file or project ... menu and then from the sidebar I select Library, I can choose from:

                  1. C++ library - this is what you actually want
                  2. QtQuick 1 Extension plugin - this is for QtQuick (not relevant to your case)
                  3. QtQuick 2 Extension plugin - this is for QtQuick 2 (not relevant to your case as well)
                  4. Qt Creator Plugin - unless you want to create plugins for QtCreator, this is not your project type.

                  I don't have a QtPlugin library project in my list.

                  ILI Offline
                  ILI Offline
                  IL
                  wrote on last edited by
                  #18

                  @kshegunov
                  Good,
                  Now if you go to New Project and select C++ Library
                  Under Type you will have three options:

                  • shared library
                  • statically linked library
                  • Qt Plugin

                  I choose the third option, can you see that?

                  kshegunovK 1 Reply Last reply
                  0
                  • ILI IL

                    @kshegunov
                    Good,
                    Now if you go to New Project and select C++ Library
                    Under Type you will have three options:

                    • shared library
                    • statically linked library
                    • Qt Plugin

                    I choose the third option, can you see that?

                    kshegunovK Offline
                    kshegunovK Offline
                    kshegunov
                    Moderators
                    wrote on last edited by
                    #19

                    @IL
                    Aha, I see what you mean. Well, you won't be extending Qt, but your application, so choose Shared Library from the dropdown, not Qt Plugin.

                    Read and abide by the Qt Code of Conduct

                    ILI 1 Reply Last reply
                    0
                    • kshegunovK kshegunov

                      @IL
                      Aha, I see what you mean. Well, you won't be extending Qt, but your application, so choose Shared Library from the dropdown, not Qt Plugin.

                      ILI Offline
                      ILI Offline
                      IL
                      wrote on last edited by
                      #20

                      @kshegunov
                      Yap, Thanks, Thanks. :-)
                      Now It's generate all the required files, I also need to add QWidgets in Select Required Models.

                      Best Regards,
                      IL

                      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