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. \enum directive doesn't work correctly in QDoc if enum is not included in the class or namespace.
Forum Updated to NodeBB v4.3 + New Features

\enum directive doesn't work correctly in QDoc if enum is not included in the class or namespace.

Scheduled Pinned Locked Moved Solved Qt Creator and other tools
2 Posts 1 Posters 754 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.
  • O Offline
    O Offline
    ovasyura
    wrote on last edited by
    #1

    Hi,

    According documentation there is not any requirements that enum should be included in name space or some class for correct QDoc parsing . QDoc doesn't recognize any comments to enum if it is included just in some *.h without class or namespace context.
    Example:
    In mainwindow.h class:

    
    enum eParentPath
    {
        PARENT_NONE = 0,
        PARENT_PARAM,
        PARENT_DEF,
        PARENT_EQUAL,
        PARENT_OPERATOR,
        PARENT_SON,
        PARENT_SIBLING
    };
    
    namespace Ui {
    
    class MainWindow;
    }
    
    class MainWindow : public QMainWindow
    {
    ...
    }
    

    In some .qdoc file:

    /*!
      \module GeneralEnums
      \title General enums
      \brief Contains general enums used in the project
    */
    
    /*!
      \enum eParentPath
      \brief Relations for bidirectional tree references
      \inmodule GeneralEnums
    
      Relations for bidirectional tree references
    
      \value PARENT_NONE
            no parent for the element
      \value PARENT_PARAM
            some parent parameter
      \value PARENT_DEF
            item is definition
      \value PARENT_EQUAL
            equal item
      \value PARENT_OPERATOR
            parent as operator
      \value PARENT_SON
            parent is the son of some item
      \value PARENT_SIBLING
            item is the sibling
    
      Some dummy comments.
    */
    

    QDoc run successfully and generalenums-module.html is generated but without any real documentation. Where is the error? Doesn't mean that QDoc doesn't support enum without some context like class or namespace? It is really bad because now I need refactor one big library in Qt compatible project for documentation generation. Do I need create the error?

    1 Reply Last reply
    0
    • O Offline
      O Offline
      ovasyura
      wrote on last edited by
      #2

      Got some comments from one Qt developer. All global items like functions, variables and enums should be marked as related to some classes or header using \related directive.
      From the point of C++ design it is not good to use such enums. But I am creating the documentation for existing library and cannot do big refactoring now.

      1 Reply Last reply
      1

      • Login

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