代码自动补全

要设置代码完成首选项,请选择首选项>Text Editor >Completion

文本编辑器首选项中的 "完成 "选项卡

代码自动补全行为

默认情况下,代码自动完成不考虑大小写。要应用大小写敏感性,请在Case-sensitivity 字段中选择FullFirst Letter

默认情况下,代码自动补全总是调用的,但您可以在Activate completion 字段中更改该行为,以调用ManuallyWhen Triggered

您可以在Timeout in ms 字段中设置代码自动完成的超时(毫秒)。

Character threshold 字段中,指定在触发代码自动完成之前需要输入的字符数。

手动调用代码自动补全时,Qt Creator 会补全建议列表中的通用前缀。这对于具有多个类似命名成员的类尤其有用。要禁用此功能,请清除Autocomplete common prefix 复选框。

选择Automatically split strings 复选框可将字符串分割为两行,方法是在选择回车时,在光标位置添加结束引号,并在下一行开始时,在字符串其余部分之前添加开始引号。此外,按下Shift+Enter还可以在光标位置插入转义字符,并将字符串的其余部分移到下一行。

自动插入匹配字符

选择代码并输入括号或引号后,匹配的结尾字符会自动添加到选择的末尾。

默认情况下,自动插入的文本会高亮显示并显示为动画,在您键入时跳过,并在您选择Backspace 时移除。

另请参阅 完整 CMake 代码用括号或引号括起代码Nim完整代码片段

Copyright © The Qt Company Ltd. and other contributors. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.