Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. Problem with "static const" variable in qdoc
QtWS25 Last Chance

Problem with "static const" variable in qdoc

Scheduled Pinned Locked Moved Qt Creator and other tools
2 Posts 2 Posters 1.7k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    rodolfoCosta
    wrote on last edited by
    #1

    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...

    grateful

    1 Reply Last reply
    0
    • F Offline
      F Offline
      franku
      wrote on last edited by
      #2

      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.

      This, Jen, is the internet.

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved