How to see Qt Source code while coding by Qt Creator ? when I Debug my program and hit a break point, and when I press F11 over a Qt function , Debugger steps into source code of that function, it is very interesting stuff :D now, I will see the source code of Qt functions in Qt creator while coding , not at Debug time :D
You need a debug build of Qt, and you have to build it yourself. Building Qt is easy: see the Installation part of the documentation.
Adding the debug version to Qt Creator
The following instructions are for Qt Creator 2.0.0. If you're using a different version, adapt as needed. First, you need to add your debug build to the list of available Qt Versions.
- Select the Tools > Options menu;
- Pick the Qt4 page;
- Click the + button;
- Click the Browse button and select the qmake binary that is inside the
bin
directory of your custom-built Qt; - Click Rebuild to build the debugging helpers. This is important!
- Click OK.
Now, configure the project to use your debug build during compilation.
- Back in the Qt Creator main window, select the Projects view;
- Pick the tab corresponding to your project;
- Select Build Settings;
- On General, change the Qt Version to the version you added on the previous part.
Rebuild of your project from zero with the new settings. You should now be able to debug into Qt code.
F2 is "follow symbol under cursor". That should get you to the right place, independently of whether the code was provided by some included header file or not.
Your own projects will most likely not include the Qt source files though, so you can not jump into them directly (they are not referenced from the project, so they are not there for creator). So during editing you will not be able to just jump straight into the Qt source code. Debugging will of course work (see previous answer, buit rebuilding your own Qt shouldn't actually be necessary).
You can open the projects.pro file found in the Qt sources as an additional project in creator. Then you can at least use the locator (Ctrl-K) to look up methods, etc.
Hope this helps...