To step into Qt source code in QtCreator, you'll need two steps:
-
(step 1) Open the settings dialog with the menu Tools > Options, then in the tab Debugger, in the sub-tab General, in the Source Paths Mapping part, click on the Add Qt Sources... button. Then select the
<path_to_qt>/Src
directory path. Exemple:C:\Qt\5.15.2\Src
if you're on Windows and installed Qt in the default directory.This will allow you to step into Qt source coed, but not set breakpoints in cpp files (unless they're already open). You need step 2 for that.
-
In the Environment tab, then the Locator sub-tab, you can add custom search directories, in the Custom part in the treeview. Choose that part and click on the Add... button (step 2a). Configure the new dialogas your will (step 2b). For example, I've only selected
C:\Qt\5.15.2\Src\qtbase\src\widgets
, that I've named"QtWidgets"
.
Now the QtWidgets source code is fully browsable in QtCreator. Try CTRL+K<