- Qt Creator Documentation
- Rename symbols
- Qt Creator 20.0.0

Navigate with locator ◦ Search and replace using a regular expression

# Rename symbols

You can rename symbols in all files in a project.

## Rename C++ symbols

When you rename a class, you can also change filenames that match the class name.

To rename a C++ symbol in a project:

1. Place the cursor on the symbol in the editor.
2. Go to Tools > C++ > Rename Symbol Under Cursor, or select Ctrl+Shift+R.

   Use the keyboard shortcut to rename Python symbols.

## Rename QML types

To rename a QML type in a project:

- Go to Tools > QML/JS > Rename Symbol Under Cursor or select Ctrl+Shift+R.
- Go to Projects, and select Rename in the context menu to rename a QML file that specifies a QML type. Qt Creator asks you whether you also want to rename all the usages of the type name in other files in the project.

## Replace found symbol instances

Search Results shows the location and number of instances of the symbol in the current project.

To replace all selected instances, enter the name of the new symbol in Replace with, and select Replace. To omit an instance, clear the checkbox next to the instance.

Note: This action replaces all selected instances of the symbol in all files listed in Search Results. You cannot undo this action.

If the symbol is a class, select Rename files to also change the filenames that match the class name.

Note: Renaming local symbols does not open Search Results. The instances of the symbol are highlighted in code, and you can edit the symbol. All instances of the local symbol are changed as you type.

See also Apply quick fixes, Find symbols, Specify settings for quick fixes, QML quick fixes, Quick Fixes, and C++ quick fixes.

Navigate with locator ◦ Search and replace using a regular expression