Briefly
In debugging the program, sometimes need to debug into Qt source code, which not only helps us understand the internal implementation mechanism, but also to solve some hidden problems are very helpful.
All know F11 is "single Step into", but in the process of debugging, press F11 but can not enter. Some people say that the need to statically compile Qt can, in fact, just need a few simple configuration can be done.
- Briefly
- Qt Version and Installation
- Configuring Qt Creator
- Source Debugging
- More references
All rights reserved: A go, two or three Li, reprint please indicate source: http://blog.csdn.net/liang19890820
Qt Version and Installation
QT provides two types of installation packages for the Windows platform:
- Version MinGW-use MinGW as the default compiler
- Version MSVC (VS2010, VS2012, VS2013, VS2015 ... )-use MSVC as the default compiler
The MinGW includes GCC, GDB and other tools. So if you install version MinGW, you can use GDB as the default debugger in Qt Creator, if you install the MSVC version, you need to go to the Microsoft Official website to download the CDB debugger.
To debug into QT source, when installing QT, you need to make sure that:
- Install the source code (default does not select Sources, need to manually check)
QT Creator can correctly detect the compiler and debugger after the installation is complete, and it is generally not necessary to manually configure the device. Of course, you can also add them manually.
Configuring Qt Creator
After everything is ready, to debug into Qt source code, only need to do:
- Select: Tools, Options, Debugger-Overview
- In the "Source Path mapping", click "Add qt Source" button, select the QT source installation directory (for example: D:\QT\QT5.7.1\5.7\SRC)
Now, you can debug Qt source code in your program, together to try it!
Source Debugging
Create a new example project and place a breakpoint on the location where you want to debug:
Press F11 Single Step into the source code program:
Congratulations, it's done!
http://blog.csdn.net/liang19890820/article/details/54346241
View and debug QT source code (dynamically compiled QT can also enter the source code) good