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 debug Qt Designer source?
Forum Updated to NodeBB v4.3 + New Features

How to debug Qt Designer source?

Scheduled Pinned Locked Moved Solved General and Desktop
7 Posts 4 Posters 357 Views 1 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.
  • R Offline
    R Offline
    Roberrt
    wrote on 27 Aug 2024, 17:58 last edited by Roberrt
    #1

    I figured out how to recompile the Qt Designer sources (Qt 6.6 Windows).

    My modifications are getting compiled correctly but i would like to be able to debug it, i mean pause on breakpoints see values etc.

    Is it possible to debug it using Visual Studio?
    Looking for any help on this.

    C 1 Reply Last reply 27 Aug 2024, 22:27
    0
    • R Offline
      R Offline
      Roberrt
      wrote on 28 Aug 2024, 14:31 last edited by
      #7

      I figured out how to debug it on VS:

      Go to Project Properties -> Debugging
      Set the "Command" field to the path of the Qt Designer executable.

      And also set the path to the pdb files, done.

      1 Reply Last reply
      0
      • R Roberrt
        27 Aug 2024, 17:58

        I figured out how to recompile the Qt Designer sources (Qt 6.6 Windows).

        My modifications are getting compiled correctly but i would like to be able to debug it, i mean pause on breakpoints see values etc.

        Is it possible to debug it using Visual Studio?
        Looking for any help on this.

        C Offline
        C Offline
        ChrisW67
        wrote on 27 Aug 2024, 22:27 last edited by
        #2

        @Roberrt said in How to debug Qt Designer source?:

        I figured out how to modify and recompile the Qt Designer source

        OK. Just out of interest, why?

        but im not finding out how to debug it on VS2022.

        It is debugged exactly the same way as any other C++ program (Qt or not) is in Visual Studio.
        Can you build and execute a "Hello, World!" program and debug it?

        R 1 Reply Last reply 27 Aug 2024, 23:22
        1
        • C ChrisW67
          27 Aug 2024, 22:27

          @Roberrt said in How to debug Qt Designer source?:

          I figured out how to modify and recompile the Qt Designer source

          OK. Just out of interest, why?

          but im not finding out how to debug it on VS2022.

          It is debugged exactly the same way as any other C++ program (Qt or not) is in Visual Studio.
          Can you build and execute a "Hello, World!" program and debug it?

          R Offline
          R Offline
          Roberrt
          wrote on 27 Aug 2024, 23:22 last edited by Roberrt
          #3

          @ChrisW67

          OK. Just out of interest, why?

          I have added custom widgets to the Widget Box, now im trying to debug it while on the preview window (CTRL R).

          It is debugged exactly the same way as any other C++ program (Qt or not) is in Visual Studio.

          How is it the same way? theres no .sln to open on VS and hit "Start Debugging".

          I have checked every .pro files that comes with the 6.6 source, the most relevant by name is located at 6.6.0\qttools\src\designer\src\designer\doc\snippets\designer.pro

          I have converted it to sln but its not related to the Qt Designer ui/build.

          B 1 Reply Last reply 28 Aug 2024, 01:55
          0
          • R Roberrt
            27 Aug 2024, 23:22

            @ChrisW67

            OK. Just out of interest, why?

            I have added custom widgets to the Widget Box, now im trying to debug it while on the preview window (CTRL R).

            It is debugged exactly the same way as any other C++ program (Qt or not) is in Visual Studio.

            How is it the same way? theres no .sln to open on VS and hit "Start Debugging".

            I have checked every .pro files that comes with the 6.6 source, the most relevant by name is located at 6.6.0\qttools\src\designer\src\designer\doc\snippets\designer.pro

            I have converted it to sln but its not related to the Qt Designer ui/build.

            B Offline
            B Offline
            Bonnie
            wrote on 28 Aug 2024, 01:55 last edited by Bonnie
            #4

            @Roberrt Qt6 does not use qmake / .pro file to build Qt anymore but cmake, so it is CMakeLists.txt you should look at.
            So how do you recompile designer? As I know cmake creates .sln file in the build folder if set VS generator.
            Also in VS you don't always need .sln to debug, what you need is .pdb files. With .pdb files next to .exe and .dll files, you can just run the application first and then attach debugger to the process.
            BTW,

            I have added custom widgets to the Widget Box, now im trying to debug it while on the preview window (CTRL R).

            Isn't this what "custom widget plugin" for? Is it really necessary to rebuild qt designer?

            1 Reply Last reply
            0
            • R Offline
              R Offline
              Roberrt
              wrote on 28 Aug 2024, 03:22 last edited by Roberrt
              #5

              @Bonnie I did several modifications not just on QtDesigner, it wouldnt work with just the widget plugin.
              I already managed to get these modifications compiled, what i'm missing is a way to debug it.

              J 1 Reply Last reply 28 Aug 2024, 07:57
              0
              • R Roberrt
                28 Aug 2024, 03:22

                @Bonnie I did several modifications not just on QtDesigner, it wouldnt work with just the widget plugin.
                I already managed to get these modifications compiled, what i'm missing is a way to debug it.

                J Offline
                J Offline
                JonB
                wrote on 28 Aug 2024, 07:57 last edited by
                #6

                @Roberrt
                As @Bonnie has said Qt Designer is just a C++ program you have compiled. So either make your own/use a .sln file if you really need it for VS, else try what he says about just having the .pdb files and sources in the right place and attach debugger to process.

                However, I really don't understand what you are doing altering the sources of Designer/Creator. You should not be making modifications to it for whatever it is you want to do: either use a "plugin" or simply do not make such modifications. I cannot imagine what modifications are so important that you have to modify the design-time experience, surely this is better done in runtime code anyway. Since you are choosing to modify sources and recompile you are making it so every time Qt releases a new Designer/Creator you need or want you have to look at your changes and rebuild it all. That seems crazy.

                1 Reply Last reply
                0
                • R Offline
                  R Offline
                  Roberrt
                  wrote on 28 Aug 2024, 14:31 last edited by
                  #7

                  I figured out how to debug it on VS:

                  Go to Project Properties -> Debugging
                  Set the "Command" field to the path of the Qt Designer executable.

                  And also set the path to the pdb files, done.

                  1 Reply Last reply
                  0
                  • R Roberrt has marked this topic as solved on 28 Aug 2024, 14:32

                  4/7

                  28 Aug 2024, 01:55

                  • Login

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