Qt资源下载和AStyle自动代码格式化

下载submodules

// 注入js生成下载列表
{
    const buffer = [];
    let i = 1;
    // 清华大学镜像站
    for(let a of document.querySelectorAll("#list td.link > a")) {
        const href = a.href;
        if ("../" === href) continue;
        const isDir = href.endsWith("/");
        if(!isDir) {
            if(!a.innerText.startsWith("*")) {
                a.innerText = `* ${i++}: ${a.innerText}`;
            }
            buffer.push(`wget ${href}`)
        }
    }
    console.log(buffer.join("\n"));
}

AStyle缩进

  • 下载AStyle
  • Qt CreatorAbout Plugins、启用Beautifier
  • Qt CreatorToolsOptionsBeautifier
    • GeneralEnable auto format on file save
    • Artistic StyleOptionsUse customed style、输入以下内容
--style=java
--mode=c
--convert-tabs         # Tab 转 Space
--indent=spaces=4      # 缩进长度 4
--indent-modifiers     # 整体缩进 public、protected、private:
--indent-switches      # 整体缩进 switch
--indent-cases         # 整体缩进 case
--indent-namespaces    # 整体缩进 namespace
--indent-col1-comments # 缩进顶行开始的注释
--indent-preprocessor  # 缩进宏
--pad-oper             # 操作符 前后填充空格
--pad-comma            # 逗号 前后填充空格
#--pad-paren           # 括号 前后填充空格
--pad-header           # 关键字附近括号 前后填充空格
--unpad-paren          # 删除多余的空格
--align-pointer=type   # 指针贴近类型(int* p)
--align-reference=type # 引用贴近类型(int& p)
--add-braces           # 单行条件语句加上括号(if() {};)
--delete-empty-lines   # 删除空行
--lineend=linux        # 使用 \n 换行符
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值