文件名:text.xml
<?xml version="1.0" encoding="utf-8"?>
<snippets>
<!-- 版权声明 -->
<snippet group="Text" trigger="copyright" id="comment_copyright">/*!
* @file %{CurrentDocument:FileName}
* @author zcj
* @brief
* @version 0.1
* @date %{CurrentDate:yyyy-MM-dd}
*
* Copyright (c) %{CurrentDate:yyyy} 中科海声. All rights reserved.
*/
</snippet>
<!-- 函数说明 -->
<snippet group="Text" trigger="func" id="comment_function">/*!
* @brief $Description of the function$
* @param1 $Description of parameter$
* @param2 $Description of parameter$
* @return $Description of return value$
* @author zcj
* @date %{CurrentDate:yyyy-MM-dd}
*/
</snippet>
<!-- 类描述 -->
<snippet group="Text" trigger="cls" id="comment_class">/*!
* @class %{CurrentDocument:FileBaseName}
* @brief Brief description of the class purpose and functionality.
* @author zcj
* @date %{CurrentDate:yyyy-MM-dd}
*/
</snippet>
<!-- TODO注释 -->
<snippet group="Text" trigger="todo" id="comment_todo">// TODO: ${Description of the task to be done}$ @author zcj @date %{CurrentDate:yyyy-MM-dd}
</snippet>
<!-- 警告注释 -->
<snippet group="Text" trigger="warn" id="comment_warning">// WARNING: ${Warning message or description}$ @author zcj @date %{CurrentDate:yyyy-MM-dd}
</snippet>
<!-- 文件头 -->
<snippet group="Text" trigger="fheader" id="file_header">/*
* Project: %{CurrentProject:Name}
* File: %{CurrentDocument:FileName}
* Author: zcj
* Created: %{CurrentDate:yyyy-MM-dd}
* Description:
*/
</snippet>
<!-- 重要提示 -->
<snippet group="Text" trigger="note" id="important_note">// NOTE: ${Important note or reminder}$ @author zcj @date %{CurrentDate:yyyy-MM-dd}
</snippet>
<!-- 待办事项列表 -->
<snippet group="Text" trigger="todos" id="todo_list">/*!
* TODO List:
* - ${Task 1}$
* - ${Task 2}$
* - ${Task 3}$
* @author zcj
* @date %{CurrentDate:yyyy-MM-dd}
*/
</snippet>
<!-- 变量注释 -->
<snippet group="Text" trigger="var" id="comment_variable">/*!
* @var ${VariableType}$ ${VariableName}$
* ${VariableDescription}$
*/
</snippet>
<!-- 调试注释 -->
<snippet group="Text" trigger="dbg" id="debug_comment">// DEBUG: ${Description of the debug point or changes made}$ @author zcj @date %{CurrentDate:yyyy-MM-dd}
</snippet>
<!-- 依赖项注释 -->
<snippet group="Text" trigger="deps" id="dependencies_comment">/*!
* Dependencies:
* - ${DependencyName}$: ${Description or version}$
*/
</snippet>
<!-- 优化点注释 -->
<snippet group="Text" trigger="opt" id="optimization_comment">// OPTIMIZE: ${Describe what can be optimized and why}$ @author zcj @date %{CurrentDate:yyyy-MM-dd}
</snippet>
<!-- 实验性功能注释 -->
<snippet group="Text" trigger="exp" id="experimental_comment">// EXPERIMENTAL: ${Description of experimental feature or change}$ @author zcj @date %{CurrentDate:yyyy-MM-dd}
</snippet>
<!-- 临时修复(Hotfix)注释 -->
<snippet group="Text" trigger="hotfix" id="hotfix_comment">// HOTFIX: ${Description of the temporary fix and reasons}$ @author zcj @date %{CurrentDate:yyyy-MM-dd}
* @date %{CurrentDate:yyyy-MM-dd}
</snippet>
<!-- 废弃代码注释 -->
<snippet group="Text" trigger="deprecated" id="deprecated_comment">// DEPRECATED: ${Reason for deprecation and recommendation for alternative}$ @author zcj @date %{CurrentDate:yyyy-MM-dd}
</snippet>
<!-- 接口文档注释 -->
<snippet group="Text" trigger="api" id="api_documentation">/*!
* @brief Brief description of the API.
* @param ${Para1}$ Description of parameter
* @param ${Para2}$ Description of parameter
* @return ${Return value}$ Description of return value
* @note Additional notes about using this API.
* @author zcj
* @date %{CurrentDate:yyyy-MM-dd}
*/
</snippet>
</snippets>
将该文件替换 /Qt5.12.10/Tools/QtCreator/share/qtcreator/snippets/ 下的 text.xml即可。
如果是应用商店安装的QTCREATOR,那么就替换 /usr/share/qtcreator/snippets/ 下的text.xml 。