[Solved] Force file parsing intellisense



  • Hi People,

    First of all: if I know well, the intellisense of the Qt Creator parses only the included files. My question is the following:
    Can I anyway force the intellisense which files should parse?

    Regards,
    Norbert


  • Moderators

    [quote author="moravas" date="1394520475"]Can I anyway force the intellisense which files should parse?[/quote]

    You have answered yourself in the first sentence, didn't you?

    More to the point: do you want to remove some files from being parsed? Or add some additional ones? I don't really understand what you are asking about/ what is your aim here, so it's hard to give you a good answer.



  • Hi,

    I would like add files that must be parsed by the intellisense. This is my post about the problem:
    http://qt-project.org/forums/viewthread/38731/
    I didn't get answer so I started a new thread in this section...

    Regards,
    Norbert


  • Moderators

    I don't see any problem in your other thread. If I understand correctly, in your header file you are using forward declaration:
    @
    // header:
    class apple;

    // source:
    #include "apple.h"
    @

    This is standard practice and Qt Creator handles it correctly. It will not allow you to use symbols from apple.h in the header file because they are not visible there: only the source file has all the information.



  • Hi,

    not really: the header doesn't contain any forward declaration, just in my example: an inheritance from an unknown type. But: in the compiler viewpoint, the code will be correct because the compiler compiles the .cpp file, which includes the headers in the right order. Let's considering my example
    @
    #include "someclass.h"
    #include "apple.h"
    //...implementation
    @

    in the case above, after the preprocessing, the source will be correct:

    • the "someclass" type is defined before use.

    Let's swap the first and the second line:
    @
    #include "apple.h"
    #include "someclass.h"
    //...implementation
    @

    In that case, you will get an "undefined type error", because the compiler doesn't found the "someclass" type, but you would like to use it.
    And there are a lots of scenario in our project, like that. Why ...? I don't know, but I would like the intellisense to parses explicit given file as well.

    Regards,
    Norbert


  • Moderators

    OK, now it is clearer to me, but I have no answer ;) I think one should always clearly include the headers that a file uses (but I understand that is out of the question in your case, where the project is big and old).

    You could maybe try adding the headers to the INCLUDEPATH, but I doubt that would help.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.