Qt World Summit: Register Today!

Problem with "static const" variable in qdoc

  • Hi..Everyone...
    I'm new here and i'm having a big problem with qdoc3.
    I try to write a code to create a document with qdoc, however whem i try to make a document for const static variable the qdoc3 says that:

    Cannot find 'Fluxo::dirEsquerdaCima' specified with '\variable in any header file.

    But i have this in my Fluxo.h file like that:

    const static int dirEsquerdaCima = 1;

    I realized that if a put only int dirEsquerdaCima ; without "const static" and =1 it works....

    I need someome clever...that answer me please...


  • In my opinion this is not a qdoc problem but a problem with your code.

    If you write (just for explanation)

    @ static const int dirEsquerdaCima = 1;

    on top of a *.cpp or *.c module (file) then this means, that this variable is only known within that c or cpp module. You can write that code into evey module you want so every module will have its own variable - each not visible from the other modules.

    This is what you do, when you write that code into a header file. Each module that includes this header file will have its own variable.

    But if you write

    @ extern const int dirEsquerdaCima;

    in the mentioned headerfile and

    @ const int dirEsquerdaCima = 1;

    in ONE of your modules it probably will work. This idea does not cover static variables in classes.

Log in to reply