在文档中引用使用doxygen的结构成员不起作用;结构成员未出现在文档中

Referencing struct member in documentation using doxygen not working; struct member not appearing in documentation

本文关键字:结构 成员 文档 不起作用 引用 doxygen      更新时间:2023-10-16

运行氧气

namespace BV
{
namespace Data
{
typedef struct Station {
    uint offsetId;              //! The ID of a station is generated by adding an offset to a base (example: 1000)
    uint id;                    //! The ID of the station (see {@link Station.offsetId} for more details)
    QString name;               //! Name of the station
    QStringList lineSwitches;   //! A list of available lines the passanger can switch to from the station
} Station;

...
}
}

退货警告

/

home/USER/Projects/HelloWorld/src/csvparser.h:16:警告:无法解析 \link 命令的"Station.offsetId"链接

最初我只有offsetId而不是Station.offsetId但在网上查看后,我看到了一堆示例(包括 SO 上的这里)描述这是这样。此外,我还想在标题的其他部分中引用此成员。

不仅从上面收到警告,而且我只是查看了为我的结构生成的 HTML 文档,令我惊讶的是它甚至不存在:

公共属性

uint id

The ID of a station is generated by adding an offset to a base (example: 1000)

Q名称

The ID of the station (see **Station.offsetId** for more details) 

QStringList lineSwitchs

Name of the station. 

Station.offsetId 只是一个断开的链接。

问题中所述的文档使用 //! 作为注释字符串,这旨在用于成员之前。在成员之后有文档时,应该使用 //!< .另请参阅doxygen手册中的"将文档放在成员之后"。

作为第二部分,没有必要使用:{@link Station.offsetId}(实际上link也应该有一个endlink。更好的是使用ref#例如 ref Station.offsetId#offsetIdref offsetId或(在这种情况下)只是Station.offsetId.