禁止Doxygen解析代码片段(解析Qt Q_PROPERT 疑似BUG)

要点

使用宏定义让 Doxygen 跳过代码段。

一、问题描述

Doxygen 认为 property 和 function 是相似项目,在文档中 \property 命令的解释为

Indicates that a comment block contains documentation for a property (either global or as a member of a class). This command is equivalent to \fn, \typedef, and \var.

在 Qt 中,property 是以字符串来索引的,因此可以使用与 property 相同名字的 function 作为其 READ 方法,这也是比较常见的命名方式。但是在 Doxygen 中(版本1.8.2),二者会导致命名“冲突”。样例如下:

main.h 文件

#include "qpushbutton.h"

class CMyButton : public QPushButton
{
    Q_OBJECT
    Q_PROPERTY(int type READ type WRITE setType)

public:
    int
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值