Debug applications

You can debug:

  • Qt C++ applications using the Visual Studio debugger.
  • Qt Quick applications using the QML debug engine.
  • Applications on Linux using GDB.

Start debugging

To start a debugging session:

  • Go to Debug > Start Debugging.
  • To debug a CMake project, select the main source file inSolution Explorer and then select Set as Startup Item in the context menu.
  • Press F5.

Set breakpoints

Set breakpoints in C++ and QML files and step through the execution of code. While in break mode, watch variables and change their values, as well as evaluate arbitrary expressions. For Qt Quick applications, a QML debugging session runs concurrently to a C++ debugging session, which enables you to set breakpoints and watch variables in both C++ and QML during the same debugging session.

See also Tutorial: Qt Quick debugging, Cross-compile, Debug on Linux, Enable QML debugging, Debugging Qt Quick Applications, and Visualize C++ types.

© 2024 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.