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. My custom widget does not appear in Qt Designer
Forum Updated to NodeBB v4.3 + New Features

My custom widget does not appear in Qt Designer

Scheduled Pinned Locked Moved Solved General and Desktop
8 Posts 3 Posters 641 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.
  • J Offline
    J Offline
    jdent
    wrote on 14 Mar 2024, 12:13 last edited by
    #1

    I followed https://doc.qt.io/qt-6/qtdesigner-customwidgetplugin-example.html building in VS2022 and placed the DLL in the plugins/designer folder but it is not been picked up by Qt Designer when I open Qt Designer. I was expecting a separate section for my widget but nothing is displayed...

    Could I be missing any actions when working in VS2022?

    The example instructions use CMake - I have translated them to a VS project file as best I could...

    What could be the reasons the plugin does not show in the toolabar set?

    P 1 Reply Last reply 14 Mar 2024, 13:57
    0
    • P Pl45m4
      14 Mar 2024, 14:51

      @jdent said in My custom widget does not appear in Qt Designer:

      I opened the .pro file with VS Tools:
      root/examples/designer/customwidgetplugin/customwidgetplugin.pro

      So you use QMake

      Then I placed the resulting DLL in the plugins/designer folder ( U:\Qt\6.6.2\msvc2019_64\plugins\designer).

      I don't know if placing it manually will work. The documenation says you have to install it there, so there might be some more files than just the library.

      I opened Qt Designer from within VS and there is no customwidget in the toolbar!! :-(

      Is the QtDesigner you open from VS Tools the same Designer which came with Qt and where you install your plugin?

      C Online
      C Online
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on 14 Mar 2024, 15:14 last edited by
      #7

      @Pl45m4 Simply copying the dll is fine. The loaded plugins can be seen in the designer under Help -> Plugins. The plugin must be compiled with the same Qt version as Qt designer.

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

      J 1 Reply Last reply 14 Mar 2024, 16:01
      2
      • J jdent
        14 Mar 2024, 12:13

        I followed https://doc.qt.io/qt-6/qtdesigner-customwidgetplugin-example.html building in VS2022 and placed the DLL in the plugins/designer folder but it is not been picked up by Qt Designer when I open Qt Designer. I was expecting a separate section for my widget but nothing is displayed...

        Could I be missing any actions when working in VS2022?

        The example instructions use CMake - I have translated them to a VS project file as best I could...

        What could be the reasons the plugin does not show in the toolabar set?

        P Offline
        P Offline
        Pl45m4
        wrote on 14 Mar 2024, 13:57 last edited by Pl45m4
        #2

        @jdent

        Assuming your code is correct, to what location did you built your plugin?
        e.g. $QTDIR/plugins/designer on Windows.

        The example instructions use CMake - I have translated them to a VS project file as best I could...

        You translated CMake to VS?! What do you mean?
        CMake is a build system like MakeFile or Qt's QMake. So I think you use one of them.


        If debugging is the process of removing software bugs, then programming must be the process of putting them in.

        ~E. W. Dijkstra

        J 1 Reply Last reply 14 Mar 2024, 14:06
        0
        • P Pl45m4
          14 Mar 2024, 13:57

          @jdent

          Assuming your code is correct, to what location did you built your plugin?
          e.g. $QTDIR/plugins/designer on Windows.

          The example instructions use CMake - I have translated them to a VS project file as best I could...

          You translated CMake to VS?! What do you mean?
          CMake is a build system like MakeFile or Qt's QMake. So I think you use one of them.

          J Offline
          J Offline
          jdent
          wrote on 14 Mar 2024, 14:06 last edited by jdent
          #3

          @Pl45m4 Should I create a QML file in Visual Studio and fill it with :

          CONFIG      += plugin
          TEMPLATE    = lib
          
          QT          += widgets uiplugin
          
          HEADERS     = analogclock.h \
                        customwidgetplugin.h
          SOURCES     = analogclock.cpp \
                        customwidgetplugin.cpp
          OTHER_FILES += analogclock.json
          TARGET = $$qtLibraryTarget($$TARGET)
          
          target.path = $$[QT_INSTALL_PLUGINS]/designer
          INSTALLS += target
          

          and then compile it with qmake?w

          would it be a QML file (qml) or a QML module definition file (qmldir)?

          BUT, I don't have a analogclock.json file!!! is this important?

          OR: how do I add a CMakeLists.txt file to my VS2022 project?
          and make it compile?

          P 1 Reply Last reply 14 Mar 2024, 14:24
          0
          • J jdent
            14 Mar 2024, 14:06

            @Pl45m4 Should I create a QML file in Visual Studio and fill it with :

            CONFIG      += plugin
            TEMPLATE    = lib
            
            QT          += widgets uiplugin
            
            HEADERS     = analogclock.h \
                          customwidgetplugin.h
            SOURCES     = analogclock.cpp \
                          customwidgetplugin.cpp
            OTHER_FILES += analogclock.json
            TARGET = $$qtLibraryTarget($$TARGET)
            
            target.path = $$[QT_INSTALL_PLUGINS]/designer
            INSTALLS += target
            

            and then compile it with qmake?w

            would it be a QML file (qml) or a QML module definition file (qmldir)?

            BUT, I don't have a analogclock.json file!!! is this important?

            OR: how do I add a CMakeLists.txt file to my VS2022 project?
            and make it compile?

            P Offline
            P Offline
            Pl45m4
            wrote on 14 Mar 2024, 14:24 last edited by Pl45m4
            #4

            @jdent

            Nothing of what you write above makes sense.
            So you want to create a Designer plugin with QML? I dont think this is possible. QtDesigner is for QtWidgets only.

            and then compile it with qmake?

            You don't compile with QMake, CMake etc.
            These are used to configure what to do with your compiled project... whether you create a library, what additional things have to be linked and where to build/install it.
            You compile with your, well, compiler... e.g. MinGW, MSVC or GCC, etc.

            how do I add a CMakeLists.txt file to my VS2022 project?

            If you have a CMake project, you should already have one, if you don't use CMake, you don't need one.


            If debugging is the process of removing software bugs, then programming must be the process of putting them in.

            ~E. W. Dijkstra

            J 1 Reply Last reply 14 Mar 2024, 14:35
            0
            • P Pl45m4
              14 Mar 2024, 14:24

              @jdent

              Nothing of what you write above makes sense.
              So you want to create a Designer plugin with QML? I dont think this is possible. QtDesigner is for QtWidgets only.

              and then compile it with qmake?

              You don't compile with QMake, CMake etc.
              These are used to configure what to do with your compiled project... whether you create a library, what additional things have to be linked and where to build/install it.
              You compile with your, well, compiler... e.g. MinGW, MSVC or GCC, etc.

              how do I add a CMakeLists.txt file to my VS2022 project?

              If you have a CMake project, you should already have one, if you don't use CMake, you don't need one.

              J Offline
              J Offline
              jdent
              wrote on 14 Mar 2024, 14:35 last edited by
              #5

              @Pl45m4 I apologize for the confusion. Here is what I did: I opened the .pro file with VS Tools:

              root/examples/designer/customwidgetplugin/customwidgetplugin.pro

              and compiled the resulting VS project. Then I placed the resulting DLL in the plugins/designer folder ( U:\Qt\6.6.2\msvc2019_64\plugins\designer)... I opened Qt Designer from within VS and there is no customwidget in the toolbar!! :-(

              So even following the .pro file, I am not gettings a plugin configured correctly...

              P 1 Reply Last reply 14 Mar 2024, 14:51
              0
              • J jdent
                14 Mar 2024, 14:35

                @Pl45m4 I apologize for the confusion. Here is what I did: I opened the .pro file with VS Tools:

                root/examples/designer/customwidgetplugin/customwidgetplugin.pro

                and compiled the resulting VS project. Then I placed the resulting DLL in the plugins/designer folder ( U:\Qt\6.6.2\msvc2019_64\plugins\designer)... I opened Qt Designer from within VS and there is no customwidget in the toolbar!! :-(

                So even following the .pro file, I am not gettings a plugin configured correctly...

                P Offline
                P Offline
                Pl45m4
                wrote on 14 Mar 2024, 14:51 last edited by Pl45m4
                #6

                @jdent said in My custom widget does not appear in Qt Designer:

                I opened the .pro file with VS Tools:
                root/examples/designer/customwidgetplugin/customwidgetplugin.pro

                So you use QMake

                Then I placed the resulting DLL in the plugins/designer folder ( U:\Qt\6.6.2\msvc2019_64\plugins\designer).

                I don't know if placing it manually will work. The documenation says you have to install it there, so there might be some more files than just the library.

                I opened Qt Designer from within VS and there is no customwidget in the toolbar!! :-(

                Is the QtDesigner you open from VS Tools the same Designer which came with Qt and where you install your plugin?


                If debugging is the process of removing software bugs, then programming must be the process of putting them in.

                ~E. W. Dijkstra

                C 1 Reply Last reply 14 Mar 2024, 15:14
                0
                • P Pl45m4
                  14 Mar 2024, 14:51

                  @jdent said in My custom widget does not appear in Qt Designer:

                  I opened the .pro file with VS Tools:
                  root/examples/designer/customwidgetplugin/customwidgetplugin.pro

                  So you use QMake

                  Then I placed the resulting DLL in the plugins/designer folder ( U:\Qt\6.6.2\msvc2019_64\plugins\designer).

                  I don't know if placing it manually will work. The documenation says you have to install it there, so there might be some more files than just the library.

                  I opened Qt Designer from within VS and there is no customwidget in the toolbar!! :-(

                  Is the QtDesigner you open from VS Tools the same Designer which came with Qt and where you install your plugin?

                  C Online
                  C Online
                  Christian Ehrlicher
                  Lifetime Qt Champion
                  wrote on 14 Mar 2024, 15:14 last edited by
                  #7

                  @Pl45m4 Simply copying the dll is fine. The loaded plugins can be seen in the designer under Help -> Plugins. The plugin must be compiled with the same Qt version as Qt designer.

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

                  J 1 Reply Last reply 14 Mar 2024, 16:01
                  2
                  • C Christian Ehrlicher
                    14 Mar 2024, 15:14

                    @Pl45m4 Simply copying the dll is fine. The loaded plugins can be seen in the designer under Help -> Plugins. The plugin must be compiled with the same Qt version as Qt designer.

                    J Offline
                    J Offline
                    jdent
                    wrote on 14 Mar 2024, 16:01 last edited by
                    #8

                    @Christian-Ehrlicher I found the problem: I was placing a debug version of the plugin!!
                    Now that I compiled with release it appears in Qt Designer!! GREAT!! Thanks!!

                    1 Reply Last reply
                    4
                    • J jdent has marked this topic as solved on 14 Mar 2024, 16:01

                    1/8

                    14 Mar 2024, 12:13

                    • Login

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