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. Making a Qt custom widget without Qt Creator
Forum Updated to NodeBB v4.3 + New Features

Making a Qt custom widget without Qt Creator

Scheduled Pinned Locked Moved Solved General and Desktop
40 Posts 4 Posters 14.5k 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.
  • P Panoss
    2 Feb 2017, 12:59

    In Qt Maintenance Tool I have these options under Qt 5.8:
    WinRt arm7(MSVC2015)
    WinRt x64 (MSVC2015)
    WinRt x86 (MSVC2015)
    Windows Phone arm (MSVC2013)
    Windows Phone x86(MSVC2013)
    Windows Runtime 8.1 x64 (MSVC2013)
    msvc2013 32-bit
    msvc2015 32-bit

    I suppose I 'll have to choose the 'msvc2015 32-bit', right?

    M Offline
    M Offline
    mrjj
    Lifetime Qt Champion
    wrote on 2 Feb 2017, 13:07 last edited by
    #17

    @Panoss
    yes. as long as it matches the visual studio suite you install later it should be fine.

    Can I ask what goal is ?
    You want to create a custom Designer plugin and use in your windows project or
    what is the plan?
    Or is just to test it out?

    Yes compiling Creator do take some time.
    I didnt use the make install thing.
    I simply copied worldtimeclockplugin.dll to
    M:\1_Creator\qt-creator-build-2\bin\plugins\designer
    (bin\plugins\designer)
    and it was visible in designer.

    So if goal is to produce a real plugin for Designer, then you need visual studio.

    If just for trying it out, we could cheat and i can give u the mingw Creator.
    Its like 50 MB download.
    But for a real project/plugin, the Visual Studio road is better.

    P 1 Reply Last reply 2 Feb 2017, 13:15
    0
    • M mrjj
      2 Feb 2017, 13:07

      @Panoss
      yes. as long as it matches the visual studio suite you install later it should be fine.

      Can I ask what goal is ?
      You want to create a custom Designer plugin and use in your windows project or
      what is the plan?
      Or is just to test it out?

      Yes compiling Creator do take some time.
      I didnt use the make install thing.
      I simply copied worldtimeclockplugin.dll to
      M:\1_Creator\qt-creator-build-2\bin\plugins\designer
      (bin\plugins\designer)
      and it was visible in designer.

      So if goal is to produce a real plugin for Designer, then you need visual studio.

      If just for trying it out, we could cheat and i can give u the mingw Creator.
      Its like 50 MB download.
      But for a real project/plugin, the Visual Studio road is better.

      P Offline
      P Offline
      Panoss
      wrote on 2 Feb 2017, 13:15 last edited by Panoss 2 Feb 2017, 13:22
      #18

      My goal is to create a real widget (ok plugin which wraps the widget).
      The strange thing is that I managed to create Qt widgets with Python, SO MUCH easier, just two files, one the plugin and one the widget, put in the right place and immediatelly show up in Qt Designer!!!
      I can't believe that with Qt Creator it's so much harder!!!
      Antway...I 'm thinking of using Visual Studio Express 2015.
      Is this suitable as Visual Studio?

      M J 2 Replies Last reply 2 Feb 2017, 13:29
      0
      • P Panoss
        2 Feb 2017, 13:15

        My goal is to create a real widget (ok plugin which wraps the widget).
        The strange thing is that I managed to create Qt widgets with Python, SO MUCH easier, just two files, one the plugin and one the widget, put in the right place and immediatelly show up in Qt Designer!!!
        I can't believe that with Qt Creator it's so much harder!!!
        Antway...I 'm thinking of using Visual Studio Express 2015.
        Is this suitable as Visual Studio?

        M Offline
        M Offline
        mrjj
        Lifetime Qt Champion
        wrote on 2 Feb 2017, 13:29 last edited by
        #19

        @Panoss
        Im not sure express will work but it might nowadays.
        I only heard of
        https://www.visualstudio.com/vs/community/
        But i can be wrong. I dont use visual studio at all. :)

        The reason for it being hard in C++ than python is the way DLLS works in windows.
        ( and python is not compiled)
        On linux its more easy as there is only gcc compiler.

        Just final question.
        It is easy to use custom plugins without all the plugin code using
        promotion.
        http://doc.qt.io/qt-5/designer-using-custom-widgets.html

        That however do not provide Design time editing of its properties.

        P 1 Reply Last reply 2 Feb 2017, 14:37
        0
        • P Panoss
          2 Feb 2017, 13:15

          My goal is to create a real widget (ok plugin which wraps the widget).
          The strange thing is that I managed to create Qt widgets with Python, SO MUCH easier, just two files, one the plugin and one the widget, put in the right place and immediatelly show up in Qt Designer!!!
          I can't believe that with Qt Creator it's so much harder!!!
          Antway...I 'm thinking of using Visual Studio Express 2015.
          Is this suitable as Visual Studio?

          J Offline
          J Offline
          jsulm
          Lifetime Qt Champion
          wrote on 2 Feb 2017, 13:32 last edited by
          #20

          @Panoss Use Community edition, it is free. Don't forget to select C++ during installation.

          https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          1
          • M mrjj
            2 Feb 2017, 13:29

            @Panoss
            Im not sure express will work but it might nowadays.
            I only heard of
            https://www.visualstudio.com/vs/community/
            But i can be wrong. I dont use visual studio at all. :)

            The reason for it being hard in C++ than python is the way DLLS works in windows.
            ( and python is not compiled)
            On linux its more easy as there is only gcc compiler.

            Just final question.
            It is easy to use custom plugins without all the plugin code using
            promotion.
            http://doc.qt.io/qt-5/designer-using-custom-widgets.html

            That however do not provide Design time editing of its properties.

            P Offline
            P Offline
            Panoss
            wrote on 2 Feb 2017, 14:37 last edited by Panoss 2 Feb 2017, 14:40
            #21

            @mrjj said in Making a Qt custom widget without Qt Creator:

            @Panoss
            Just final question.
            It is easy to use custom plugins without all the plugin code using
            promotion.

            No, I need real widget(plugin).
            Well, I thought of it again, I think I'd better compile Qt Creator with mingw.
            How can I do this?
            According to this...it's a nightmare!!
            Will I have to re-compile if I create a new plugin sometime later?
            Or it's done once and forever?

            M 1 Reply Last reply 2 Feb 2017, 14:45
            0
            • P Panoss
              2 Feb 2017, 14:37

              @mrjj said in Making a Qt custom widget without Qt Creator:

              @Panoss
              Just final question.
              It is easy to use custom plugins without all the plugin code using
              promotion.

              No, I need real widget(plugin).
              Well, I thought of it again, I think I'd better compile Qt Creator with mingw.
              How can I do this?
              According to this...it's a nightmare!!
              Will I have to re-compile if I create a new plugin sometime later?
              Or it's done once and forever?

              M Offline
              M Offline
              mrjj
              Lifetime Qt Champion
              wrote on 2 Feb 2017, 14:45 last edited by mrjj 2 Feb 2017, 14:50
              #22

              @Panoss
              Its sort of a do once and use mingw Creator for ever with that version of Qt
              But in a few version of Qt you might need to recompile Creator.

              Its not a nightmare as such ( webkit is: ) but it does take some (long) time.

              If you plan on others to use your plugin , the VS way is still better :)
              You will still use Creator etc and its just other compiler.

              And no, the whole reason to compile Creator with mingww is so it will load plugins compiled with
              mingw. So as long as you do not upgrade mingw , then no need to ever recompile Creator for a new plugin.

              The normal Creator is compiled with Vs and only like VS compiled plugins.

              So in my opinion, for your use case Visual Studio is better as its how it normally works and
              all other installations of Qt can just use it.

              1 Reply Last reply
              1
              • P Offline
                P Offline
                Panoss
                wrote on 2 Feb 2017, 14:50 last edited by
                #23

                Ok, I 'll go for the Visual Studio, you convienced me :).

                M 1 Reply Last reply 2 Feb 2017, 14:51
                1
                • P Panoss
                  2 Feb 2017, 14:50

                  Ok, I 'll go for the Visual Studio, you convienced me :).

                  M Offline
                  M Offline
                  mrjj
                  Lifetime Qt Champion
                  wrote on 2 Feb 2017, 14:51 last edited by mrjj 2 Feb 2017, 14:57
                  #24

                  @Panoss
                  Super. Its fun with plugins.
                  We need more , one can never have too many Designer widgets :)

                  Final note:
                  The debugger is a separate download.
                  https://forum.qt.io/topic/60713/setting-visual-studio-2015-debugger/

                  optional component called "debugging tools for windows"

                  This is often a surprise :)

                  1 Reply Last reply
                  0
                  • P Offline
                    P Offline
                    Panoss
                    wrote on 2 Feb 2017, 15:00 last edited by Panoss 2 Feb 2017, 15:01
                    #25

                    "Optional". So I can live without it, right?
                    You mean, 'this is often a good surprise' ?

                    M 1 Reply Last reply 2 Feb 2017, 15:07
                    0
                    • P Panoss
                      2 Feb 2017, 15:00

                      "Optional". So I can live without it, right?
                      You mean, 'this is often a good surprise' ?

                      M Offline
                      M Offline
                      mrjj
                      Lifetime Qt Champion
                      wrote on 2 Feb 2017, 15:07 last edited by mrjj 2 Feb 2017, 15:08
                      #26

                      @Panoss

                      You will need debugger :)
                      We all do.
                      And no its was not good surprise.
                      They come here and say.
                      "Program crash"
                      and we go like "ok, place a breakpoint and single step the function to find crash point."

                      But it can wait till later i guess :)

                      1 Reply Last reply
                      1
                      • M Offline
                        M Offline
                        mrjj
                        Lifetime Qt Champion
                        wrote on 2 Feb 2017, 15:11 last edited by
                        #27

                        Fast question:
                        This plugin will run on windows xp?
                        The app is for Xp?

                        Note that from 5.7 ( think) its not tested on xp.
                        Might work or might not. Its not supported.

                        1 Reply Last reply
                        0
                        • P Offline
                          P Offline
                          Panoss
                          wrote on 2 Feb 2017, 15:13 last edited by Panoss 2 Feb 2017, 15:13
                          #28

                          It will run on Win 10, Win 7 and XP.

                          M 1 Reply Last reply 2 Feb 2017, 15:15
                          0
                          • P Panoss
                            2 Feb 2017, 15:13

                            It will run on Win 10, Win 7 and XP.

                            M Offline
                            M Offline
                            mrjj
                            Lifetime Qt Champion
                            wrote on 2 Feb 2017, 15:15 last edited by mrjj 2 Feb 2017, 15:17
                            #29

                            @Panoss
                            Ok. just asking as XP is not on ppl mind anymore.
                            https://forum.qt.io/topic/73292/the-last-qt-version-that-supported-windows-xp

                            Sounds like using 5.6 is the best bet :)

                            Did u try that version of Creator on xp?

                            It didn't start or ?

                            Note that Xp in virtual machine do not have openGL (often) and can only work if started with some option
                            https://forum.qt.io/topic/36827/qt-creator-3-0-welcome-mode-not-working-in-virtualbox-vm

                            like
                            c:\path\qtcreator -noload Welcome -noload QmlDesigner -noload QmlProfiler

                            1 Reply Last reply
                            0
                            • P Offline
                              P Offline
                              Panoss
                              wrote on 2 Feb 2017, 15:19 last edited by
                              #30

                              On XP I haven't tried Qt Creator yet.
                              I was thinking of trying an older version, and adjusting the code where necessary.

                              M 1 Reply Last reply 2 Feb 2017, 15:22
                              0
                              • P Panoss
                                2 Feb 2017, 15:19

                                On XP I haven't tried Qt Creator yet.
                                I was thinking of trying an older version, and adjusting the code where necessary.

                                M Offline
                                M Offline
                                mrjj
                                Lifetime Qt Champion
                                wrote on 2 Feb 2017, 15:22 last edited by
                                #31

                                @Panoss
                                well if u go back to Qt4 then all plugin stuff is a bit different. ( from Qt5 series)
                                So would be great if 5.6 can be used. :)

                                1 Reply Last reply
                                0
                                • P Offline
                                  P Offline
                                  Panoss
                                  wrote on 3 Feb 2017, 07:17 last edited by
                                  #32

                                  Ok, I installed VS 2015 and the debugger (Windows 10 SDK).
                                  Qt Creator auto-detected the VS compiler and a CDB debugger (this must be from Windows 10 SDK).
                                  This means I 'm ready?
                                  So how do I compile a plugin to dll?

                                  1 Reply Last reply
                                  0
                                  • S Offline
                                    S Offline
                                    SGaist
                                    Lifetime Qt Champion
                                    wrote on 3 Feb 2017, 08:07 last edited by
                                    #33

                                    Start a "Qt Custom Designer Plugin" project and it will be all prepared for that. This one is under "Other project" in the "New File or Project" dialog.

                                    Interested in AI ? www.idiap.ch
                                    Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                                    1 Reply Last reply
                                    1
                                    • P Offline
                                      P Offline
                                      Panoss
                                      wrote on 3 Feb 2017, 10:38 last edited by Panoss 2 Mar 2017, 10:59
                                      #34

                                      I make a New Project->Qt Custom Designer Widget, Name: I enter 'AnalogClock'->Next but I see no VS kit:

                                      alt text

                                      And no VS kit is auto detected.
                                      Maybe I should add manually a VS kit?

                                      Should I make two projects? The 'main' project in wich the widget will be used, and the project of the widget (plugin)?

                                      1 Reply Last reply
                                      0
                                      • P Offline
                                        P Offline
                                        Panoss
                                        wrote on 3 Feb 2017, 11:12 last edited by Panoss 2 Mar 2017, 11:18
                                        #35

                                        I tried to add a kit manually, but it raises errors:
                                        alt text

                                        (I changed C++ compiler from MingW to VS2015)

                                        EDIT: Ok, I had forgotten in Maintenance tool to add, at Qt5.8: msvc2015 32-bit, I'm adding it right now.

                                        1 Reply Last reply
                                        1
                                        • P Offline
                                          P Offline
                                          Panoss
                                          wrote on 3 Feb 2017, 11:46 last edited by Panoss 2 Mar 2017, 11:47
                                          #36

                                          Ok, after adding msvc2015 32-bit in Maintenance tool, everything seems ok.
                                          I built the poject, and a dll was created(!!wow) in my project 's debug folder.

                                          I also now have two folders:
                                          c:\qt\5.8\mingw53_32\bin and
                                          c:\qt\5.8\msvc2015\bin
                                          which have a designer.exe inside.
                                          I run them both (I suppose the one that should show my plugin is the msvc2015\bind\designer.exe) but in none of them appears my plugin.
                                          Also the dll of my plugin was not copied in any of the folders of c:\qt\5.8.

                                          J 1 Reply Last reply 3 Feb 2017, 11:50
                                          0

                                          26/40

                                          2 Feb 2017, 15:07

                                          • Login

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