Qt Creator provides a debugger plugin that acts as an interface between the Qt Creator core and external native debuggers such as the GNU Symbolic Debugger (GDB), the Microsoft Console Debugger (CDB), and a QML/JavaScript debugger.
Illustrates how to debug Qt C++ applications in the Debug mode.
Illustrates how to debug Qt Quick applications in the Debug mode.
To start a program under the control of the debugger, press F5. Qt Creator checks whether the compiled program is up-to-date, and rebuilds it if necessary. The debugger then takes over and starts the program. The debugger is launched in the appropriate operating mode (plain, terminal, or on-device), based on the build and run settings for the active project. You can also launch the debugger in other mode.
You can use the Qt Creator Debug mode to inspect the state of your application while debugging.
The debugger plugin tries to automatically pick up a suitable native debugger. You only need to set it up if the automatic setup fails, because the native debugger is missing (as is usually the case for the CDB debugger on Windows, which you always must install yourself) or because the installed version is not supported.
Qt Creator is able to show complex data types in a customized, user-extensible manner. For this purpose, it takes advantage of two technologies, collectively referred to as debugging helpers. Using the debugging helpers is not essential for debugging with Qt Creator, but they help you to quickly examine complex data.
In the Debug mode, you can inspect the state of the application while debugging JavaScript functions. You can set breakpoints, view call stack trace, and examine locals and expressions. When the application is interrupted by a breakpoint, you can use the QML Script Console to execute JavaScript expressions in the current context.
While the application is running, you can use the QML Inspector view to explore the object structure, debug animations, and inspect colors.
If you encounter problems while debugging, check for possible solutions to them.