1.直接sudo apt install clang-format-13 安装clang-format-13工具,其他版本也行。
2.在QT help-> about plugins中激活beautifier和ClangTools,关闭QT再重新打开QT。
3.在tools->options的beautifier中设置clang format的位置,并将代码分割设置为google。
4.设置快捷键,在environment的keyboard中设置快捷键为Ctrl+Shift+Q,这个需要手写打字进去。