重命名符号

您可以重命名项目中所有文件的符号。

重命名类时,还可以更改与类名匹配的文件名。

重命名项目中的 C++ 符号:

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

    使用键盘快捷键重命名 Python 符号。

要重命名项目中的 QML 类型,请转到Tools >QML/JS >Rename Symbol Under Cursor ,或选择Ctrl+Shift+R

Search Results 显示当前项目中该符号实例的位置和数量。

重命名光标下的符号

要替换所有选定实例,请在Replace with 中输入新符号的名称,然后选择Replace 。要省略某个实例,请清除该实例旁边的复选框。

注意: 此操作将替换Search Results 中列出的所有文件中符号的所有选定实例。无法撤销此操作。

如果符号是一个类,选择Rename files 也可更改与类名匹配的文件名。

注: 重命名本地符号不会打开Search Results 。符号的实例在代码中突出显示,您可以编辑符号。本地符号的所有实例都会随着您的键入而更改。

另请参阅 查找符号为快速修复指定设置快速修复C++ 快速修复应用快速修复QML 快速修复

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.