在qtcreator中添加片段,提高开发效率。

文件名: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 。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

九江在天

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值