解析文件

打开项目时,Qt Creator 会解析项目中的源文件,并执行语义分析,以建立代码编辑服务所需的信息,例如导航和查找用法。

选择解析上下文

代码在不同的上下文中可能会有不同的解释。一个文件可能会被不同的项目或子项目使用,并有不同的定义,也可能包含在 C、C++、Objective-C 或 Objective-C++ 的上下文中。

要更改活动解析上下文,请在#Edit 模式工具栏上选择一个可用的解析上下文。该按钮只有在多个解析上下文可用时才可见。

编辑模式工具栏

要重置解析上下文,请访问# >Clear Preferred Parse Context

如果解析项目所需的信息仍不完整或不正确,请访问Additional Preprocessor Directives 添加预处理器指令。

重新解析外部更改的文件

如果源文件从Qt Creator 以外修改,打开的文件 (1) 会自动重新解析。要更新其他文件,请访问Tools >C++ >Reparse Externally Changed Files 更新代码模型。

另请参阅 "如何:编辑代码"、"编辑模式"、"Clang 代码模型"和 "代码模型"。

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.