查找符号

您可以搜索特定符号的引用,或搜索名称与模式匹配的符号。

查找符号引用

在 Qt C++ 项目中查找特定符号的实例:

  1. 将光标放在编辑器中的符号上。
  2. 转到Tools >C++ >Find References to Symbol Under Cursor ,或选择Ctrl+Shift+U

    搜索结果视图中找到的符号

用颜色编码访问类型

要根据访问类型(如读取、写入或声明)以彩色编码查看相同结果,请访问Tools >C++ >Find References with Access Type

查找符合搜索条件的符号

转到Edit >Find/Replace >Advanced Find 并选择C++ Symbols ,从作为项目一部分列出的文件或代码使用的所有文件(如包含文件)中搜索类、函数、枚举和声明(包括类型别名)。

搜索结果视图中的搜索标准

Qt Creator 从以下位置搜索:

  • 列为项目一部分的文件
  • 项目文件直接使用的文件(例如,生成的文件)
  • 所用框架和库的头文件

查看找到的符号

搜索结果视图显示当前项目中搜索结果的位置和数量。

搜索结果视图中找到的符号

另请参阅 如何:搜索搜索结果视图

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.