View and debug QT source code (dynamically compiled QT can also enter the source code) good

Source: Internet
Author: User

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:

    1. Select: Tools, Options, Debugger-Overview
    2. 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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.