How to debug Qt Designer source?
-
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. -
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.@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? -
@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?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 at6.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.
-
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 at6.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.
@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?
-
@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.@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.
-