Setting a breakpoint is another good way to debug your program. When you right-click on the line number of your script in Qt Creator, you will get a pop-up menu with three options, which you can see in the following screenshot:
The first option is called Set Breakpoint at Line..., which lets you set a breakpoint at a specific line on your script. A red dot icon will appear beside the line number once you have created a breakpoint:
The second option is called Set Message Tracepoint at Line..., which prints a message when ...