To debug any Qt application, you need to ensure that you have installed the debug symbols of the Qt libraries. On Windows, they are installed together with release version DLLs. Meanwhile, on Linux, you may need to install debug symbols by the distribution's package manager.
Some developers tend to use a function similar to printf
to debug the application. Qt provides four global functions, which are shown in the following table, to print out debug, warnings, and error text:
Normally, you can just use a C-style method similar to printf
.
qDebug("Hello %s", "World!");
However, in most cases, we'll include the...