效果演示
效果①
效果②
一、添加注释代码片段
qt 快捷添加函数注释
工具/选项
文本编辑器/片段/添加
触发处填 global ,触发种类填 comment
在下方③处填入以下注释代码
/****************************************************************************
* @funcation:
* @brief :
* @param :
* @return :
******************************************************************************/
应用/确定
二、使用
在函数处键入 glo就会出现如下提示,选中comment回车即可
效果如下所示
三、笔者常用适合qt的代码注释
/**
** @author:$author$
** @email:
** @birth:%{CurrentDate:Locale} %{CurrentTime:ISO}
** @version: V%{CurrentDate:yyyyMMdd}%{CurrentTime:hhmmss}
** @revision:
** @brief:$brief$
**
** @param{ $param$ }
** @param{ $param$ }
** @param{ $param$ }
** @return{ $param$ }
** @Example:
**
**/
触发种类:func
/**
** @author:$author$
** @email:
** @birth:%{CurrentDate:Locale} %{CurrentTime:ISO}
** @version: V%{CurrentDate:yyyyMMdd}%{CurrentTime:hhmmss}
** @revision:
** @brief:$brief$
**
** @element{ $element$ }
** @element{ $element$ }
** @element{ $element$ }
** @element{ $element$ }
** @Example:
**
**/
触发种类:enum
/**
** @author:$author$
** @email:
** @birth:%{CurrentDate:Locale} %{CurrentTime:ISO}
** @version: V%{CurrentDate:yyyyMMdd}%{CurrentTime:hhmmss}
** @revision:
** @brief:$brief$
**
** @Example:
**
**/
触发种类:description
/**
** @author:$author$
** @email:
** @birth:%{CurrentDate:Locale} %{CurrentTime:ISO}
** @version: V%{CurrentDate:yyyyMMdd}%{CurrentTime:hhmmss}
** @revision:
** @brief:$brief$
**
** @property{ $property$ }
** @property{ $property$ }
** @property{ $property$ }
** @property{ $property$ }
** @Example:
**
**/
触发种类:struct
/**
** @author:$author$
** @email:
** @birth:%{CurrentDate:Locale} %{CurrentTime:ISO}
** @version: V%{CurrentDate:yyyyMMdd}%{CurrentTime:hhmmss}
** @revision:
** @brief:$brief$
**
** public:
** @behavior{ $behavior$ }
** @behavior{ $behavior$ }
** @behavior{ $behavior$ }
** @property{ $property$ }
** @property{ $property$ }
** @property{ $property$ }
** protected:
** @behavior{ $behavior$ }
** @behavior{ $behavior$ }
** @behavior{ $behavior$ }
** @property{ $property$ }
** @property{ $property$ }
** @property{ $property$ }
** private:
** @behavior{ $behavior$ }
** @behavior{ $behavior$ }
** @behavior{ $behavior$ }
** @property{ $property$ }
** @property{ $property$ }
** @property{ $property$ }
**/
触发种类:class
/**
** @author:$author$
** @email:
** @birth:%{CurrentDate:Locale} %{CurrentTime:ISO}
** @version: V%{CurrentDate:yyyyMMdd}%{CurrentTime:hhmmss}
** @revision:
** @brief:$brief$
**
** public:
** @behavior{ $behavior$ }
** @behavior{ $behavior$ }
** @behavior{ $behavior$ }
** @property{ $property$ }
** @property{ $property$ }
** @property{ $property$ }
** protected:
** @behavior{ $behavior$ }
** @behavior{ $behavior$ }
** @behavior{ $behavior$ }
** @property{ $property$ }
** @property{ $property$ }
** @property{ $property$ }
** private:
** @behavior{ $behavior$ }
** @behavior{ $behavior$ }
** @behavior{ $behavior$ }
** @property{ $property$ }
** @property{ $property$ }
** @property{ $property$ }
** public slots:
** @slots{ $slots$ }
** @slots{ $slots$ }
** @slots{ $slots$ }
** private slots:
** @slots{ $slots$ }
** @slots{ $slots$ }
** @slots{ $slots$ }
** signals:
** @signals{ $signals$ }
** @signals{ $signals$ }
** @signals{ $signals$ }
** @Example:
**
**/
触发种类:class_object
/**
** @author:$author$
** @email:
** @birth:%{CurrentDate:Locale} %{CurrentTime:ISO}
** @version: V%{CurrentDate:yyyyMMdd}%{CurrentTime:hhmmss}
** @revision:
** @brief:$brief$
**/
触发种类:file
%{CurrentDate:Locale} %{CurrentTime:ISO}
触发种类:last_time
xxxxxxxxxx@xx.com
emial/填自己邮箱
四、qt 内置快捷注释
可以通过函数顶头一行添加
/**
或者
/*!
然后 ↩︎(回车)生成函数注释
如下所示