原文地址
下载
下载地址,需要同意GPL或者LGPL开源协议
优化
页面过小
windows
下qt
在没有比例放大的情况下,会出现工具栏等比例太小的问题,不调整windows
缩放比的情况下没有特别好的解决方案。可以使用脚本单独调整qt
的比例,但是部分位置比例会变得奇怪,在qtcreator.exe
同级目录下创建文件qtcreatorStart.cmd
@echo off
set QT_SCALE_FACTOR=1.2
qtcreator.exe
Linux下同样有效
export QT_SCALE_FACTOR=1.2
代码格式化
在【帮助】-【关于插件】中添加【Beautifier】插件,重启后在左侧菜单栏【项目】-【管理构建套件】-【Beautifier】中选择美化引擎,目前可以选择的引擎有Artistic Style
和Uncrustify
以及ClangFormat
这里以ClangFormat
举例
在【Beautifier】-【ClangFormat】选项卡中选择安装的位置下的#{address}/bin/clang-format.exe
作为引擎,配置自定义的风格,这里给出示例
AccessModifierOffset: -4
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: true
AlignConsecutiveDeclarations: true
AlignEscapedNewlinesLeft: true
AlignOperands: true
AlignTrailingComments: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: Empty
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: false
BinPackArguments: true
BinPackParameters: true
BraceWrapping:
AfterClass: true
AfterControlStatement: true
AfterEnum: true
AfterFunction: true
AfterNamespace: true
AfterObjCDeclaration: true
AfterStruct: true
AfterUnion: true
BeforeCatch: true
BeforeElse: true
IndentBraces: false
BreakBeforeBinaryOperators: NonAssignment
BreakBeforeBraces: Custom
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: true
ColumnLimit: 200
CommentPragmas: '^ IWYU pragma:'
ConstructorInitializerAllOnOneLineOrOnePerLine: true
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: false
DerivePointerAlignment: false
DisableFormat: false
ExperimentalAutoDetectBinPacking: false
ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH ]
IncludeCategories:
- Regex: '^"(llvm|llvm-c|clang|clang-c)/'
Priority: 2
- Regex: '^(<|"(gtest|isl|json)/)'
Priority: 3
- Regex: '.*'
Priority: 1
IndentCaseLabels: false
IndentWidth: 4
IndentWrappedFunctionNames: false
KeepEmptyLinesAtTheStartOfBlocks: true
MacroBlockBegin: ''
MacroBlockEnd: ''
MaxEmptyLinesToKeep: 1
NamespaceIndentation: Inner
ObjCBlockIndentWidth: 4
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: true
PenaltyBreakBeforeFirstCallParameter: 19
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakString: 1000
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 60
PointerAlignment: Left
ReflowComments: true
SortIncludes: true
SpaceAfterCStyleCast: false
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: ControlStatements
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 2
SpacesInAngles: false
SpacesInContainerLiterals: true
SpacesInCStyleCastParentheses: true
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: Cpp11
TabWidth: 4
UseTab: Never
文档参考:ClangFormat,ClangFormatStyleOptions,clang-format的介绍和使用
在【Beautifier】-【概要】选项卡中根据需要决定是否在保存时候就执行format
操作
修改快捷键
【项目】-【管理构建套件】-【环境】-【键盘】
- 检索
GoBack
和GoForward
改为Ctrl + Alt + <-
和Ctrl + Alt + ->
- 检索
CompleteThis
改为Ctrl + p
,将冲突快捷键重置为空 - 检索
RenameSymbolUnderCursor
,改为Shift + F6
,将冲突快捷键重置为空