How to see Qt Source Code while encoding Qt Creator?

How to see Qt source code when encoding Qt Creator? when I debug my program and press the breakpoint, and when I press F11 on top of the Qt function, the debugger goes to the source code of this function, this is very interesting material: D now I will see the source code of Qt functions in the Qt creator during coding, not during debugging: D

+6
qt qt-creator
source share
2 answers

You need a Qt debug build, and you need to create one yourself. Building Qt is easy: see the Installation part of the documentation.

Adding a debug version to Qt Creator

The following instructions apply to Qt Creator 2.0.0. If you are using a different version, adapt it if necessary. First, you need to add your debug build to the list of available Qt versions.

  • Select the menu Tools > Options ;
  • Select a Qt4 page;
  • Press the + button;
  • Click the Browse button and select the qmake binary that is inside the bin directory of your custom Qt;
  • Click Rebuild to create debugging helpers. It is important!
  • Click OK .

Now configure the project to use the debug build at compile time.

  • Return to the main window of Qt Creator, select the Projects view;
  • Select the tab that matches your project;
  • Select Build Settings ;
  • In General, change the version of Qt to the version added in the previous part.

Restore your project from scratch with new settings. Now you can debug the Qt code.

+4
source share

F2 means follow the character under the cursor. This should lead you to the right place, regardless of whether the code was provided by any included header file or not.

Your own projects will most likely not include the Qt source files, so you cannot directly jump to them (projects do not link to them, therefore they are not for the creator). Therefore, during editing, you cannot just go directly to the Qt source code. Of course, debugging will work (see the previous answer, buit rebuilding your own Qt is not really necessary).

You can open the projects.pro file found in Qt sources as an additional project in the creator. Then you can at least use the locator (Ctrl-K) to search for methods, etc.

Hope this helps ...

+1
source share

All Articles