PDA

View Full Version : Qt Creator How to make Creator be aware of the Qt source code project?



kartwall
26th September 2010, 08:32
Hi, guys, I downloaded the whole Qt 4.6 source codes via git and opened it in Qt creator.
Now my question is:
I want Qt creator can navigate the functions/classes to the source codes. E.g: Currently if I try to navigate to the declaration of QListWidget, Qt creator navigates to the header file in Qt's SDK and it can't find out the source codes of QListWidget because Qt SDK doesn't ship with source codes.
So I want creator turns to the source codes of Qt which I have already opened in creator. In this way, I can read the source codes of Qt directly while coding, you know, this is more efficient than reading documents.

Thanks in advance.

Zlatomir
26th September 2010, 09:02
Qt SDK comes with the source code, for example QListWidget source can be found in: "C:\Qt\2010.05\qt\src\gui\itemviews" //i'm on windows now, with Qt 4.7

And i don't really understand your question, you want the help to display the source code and not the documentation?
I don't think that, in the majority of the cases, you need to see the source code to understand how to use a feature/function/class/module of Qt, it might help in some cases, but the documentation is better most of the times.

ktk
26th September 2010, 18:33
If you have the Qt sources downloaded you can open src.pro and Creator.

kartwall
27th September 2010, 03:47
Qt SDK comes with the source code, for example QListWidget source can be found in: "C:\Qt\2010.05\qt\src\gui\itemviews" //i'm on windows now, with Qt 4.7

And i don't really understand your question, you want the help to display the source code and not the documentation?
I don't think that, in the majority of the cases, you need to see the source code to understand how to use a feature/function/class/module of Qt, it might help in some cases, but the documentation is better most of the times.

Thank you, Zlatomir. Yes, qt SDK ships with the source codes, great. This is not necessary to download the Qt source codes manually. If so, my question is, how to read the Qt source codes in creator?
E.g: I wanna check the source codes of QListWidget, my steps are:
1. Place the cursor on the "QListWidget" in my source codes, then select "Follow symbol under cursor", the Creator jumps to the declaration of QListWidget which is inside "qlistwidget.h".
2. Choose menu "Tools" -> "C++" -> "Switch Header/Source" -- nothing happened.
3. Navigate to one function defined in QListWidget, e.g: "currentItem()", select context menu "Switch between method declaration/Definition" -- nothing happened.

So, I just wanna check the source codes of QListWidget, not just only header files. If qt SDK ships with source codes of Qt, why creator can't navigate to the source codes for me? Is this a bug of Creator or, something is wrong in my creator configuration?

Thanks again.

kartwall
27th September 2010, 03:48
If you have the Qt sources downloaded you can open src.pro and Creator.

Thank you, I already opened the project in creator.

Zlatomir
27th September 2010, 08:39
As far as i know, you can't navigate directly from your project in Creator.

In cases you really need to see the source, you can navigate to that src folder and search the files that you need to see.