PDA

View Full Version : Can anyone explain the behaviour of the QtCreator



aarelovich
16th February 2009, 17:34
Hi:

I've got a question concerning QtCreator that has been bugging me for a while now.

I've got this relatively large program that I'm devolping and all of these classes.

Now in some of these classes using the F1 to use the help and the auto complete feature just absolutely refuses to work.

Can any one tell me why the Creator might do this? Is there something I can do to correct it?

Thanks

PD: The program compiles. At first I thought It was something like Eclipse where certain syntax errors make the auto complete unavailable, but that's not the case.

wysota
16th February 2009, 21:13
Qt Creator performs auto-completion based on indexing header files which is done right after loading the project. Either your classes (cpp or h files) are not added to the project or there or there is something wrong with the include statements.

aarelovich
17th February 2009, 17:57
If there were something wrong with the include statements then it would not compile. I can see nothing wrong with them.

Same thing goes if the classes are not included (they would not have been added to .pro file). They are part of the project.

And the program compiles just fine. And sometimes after a while it just starts autocompleting correctly.

But thanks for the answer.

wysota
17th February 2009, 18:53
If there were something wrong with the include statements then it would not compile.
It's not that simple. Compilation is a much more complex process than the one performed by QtCreator. Make sure you directly include files containing declarations of classes you want to use in each file you want to use them in.


And sometimes after a while it just starts autocompleting correctly.

Well... that you fogot to mention in the previous post :) Indexing is done in background, so if you have a complex hierarchy of classes it might take a while for Creator to catch up. Take a look at the status bar to see if the indexing process is running.

aarelovich
17th February 2009, 19:48
Hi:

I've haven't included classes directly. If I have a class A that includes a class B that includes a class C then I don't include class C in A. Maybe that's the problem?

And no the indexing bar is not running.

Thanks

wysota
17th February 2009, 20:13
Do the classes for which the completion doesn't work follow some kind of pattern? Do they have a similar design or maybe they are derived from the same base class or something like that?