Keyboard Shortcuts

Qt Creator provides various keyboard shortcuts to speed up your development process. You can add more shortcuts if your favorite combination is missing. In addition, you can specify your own keyboard shortcuts for some functions that can be easily performed with a mouse, and therefore do not appear in menus or have default keyboard shortcuts. For example, selecting and deleting words or lines in an editor.

To view all functions available in Qt Creator and the keyboard shortcuts defined for them, select Edit > Preferences > Environment > Keyboard. The shortcuts are listed by category. To find a keyboard shortcut in the list, enter a function name or shortcut in the Filter field.

The shortcuts that are displayed in red color are associated with several functions. Qt Creator executes the function that is available in the current context. If several functions are available for the same shortcut at a time, there is a conflict and Qt Creator cannot execute any function.

A keyboard shortcut might also conflict with a shortcut that a Window manager uses for its own purposes. In that case, Qt Creator shortcuts do not work. Typically, you can configure the shortcuts in the window manager, but if that is not allowed, you can change the Qt Creator shortcuts. For example, Unity on Ubuntu 11.10 uses F10 in its window manager, and therefore the default Qt Creator keyboard shortcut F10 (Step Over) does not work on that system.

To override the platform default value that determines whether keyboard shortcuts are shown in the labels of context menu items, select Edit > Preferences > Environment > Interface. The label of the Show keyboard shortcuts in context menus check box indicates whether the platform default value is on or off.

"Interface tab in the Environment preferences"

Configuring Keyboard Shortcuts

To customize a keyboard shortcut:

  1. Select Edit > Preferences > Environment > Keyboard.
  2. Select a command from the list.
  3. In the Key Sequence field, you have the following options:
    • Enter the shortcut key you want to associate with the selected command.
    • Select Record, press the keys to use as the keyboard shortcut, and select Stop Recording when you are done.
  4. To assign multiple keyboard shortcuts to a function, select Add, and enter or record an additional key combination.
  5. To revert to the default shortcut, select Reset.

Qt Creator allows you to use different keyboard shortcut mapping schemes:

  • To import a keyboard shortcut mapping scheme, click Import and select the .kms file containing the keyboard shortcut mapping scheme you want to import.
  • To export the current keyboard shortcut mapping scheme, click Export and select the location where you want to save the exported .kms file.

Default Keyboard Shortcuts

The following tables list the default keyboard shortcuts. They are categorized by actions.

General Keyboard Shortcuts

ActionKeyboard shortcut
Open file or projectCtrl+O
New projectCtrl+Shift+N
New fileCtrl+N
Open in external editorAlt+V, Alt+I
Select allCtrl+A
Save allCtrl+Shift+S
Close windowCtrl+W
Close allCtrl+Shift+W
Close current fileCtrl+F4
Go backAlt+Left
Go forwardAlt+Right
Go to lineCtrl+L
Next open document in historyCtrl+Shift+Tab
Go to other splitCtrl+E, O
Previous open document in historyCtrl+Tab
Activate LocatorCtrl+K
Switch to Welcome modeCtrl+1
Switch to Edit modeCtrl+2
Switch to Design modeCtrl+3
Switch to Debug modeCtrl+4
Switch to Projects modeCtrl+5
Switch to Help modeCtrl+6
Toggle IssuesAlt+1 (Cmd+1 on macOS)
Toggle Search ResultsAlt+2 (Cmd+2 on macOS)
Toggle Application OutputAlt+3 (Cmd+3 on macOS)
Toggle Compile OutputAlt+4 (Cmd+4 on macOS)
Toggle other output viewsAlt+number (Cmd+number on macOS)

Where the number is the number of the view.

Activate Bookmarks viewAlt+M
Activate File System viewAlt+Y
Activate Open Documents viewAlt+O
Maximize output viewsAlt+9
Move to next item in outputF6
Move to previous item in outputShift+F6
Activate Projects viewAlt+X
Full screenCtrl+Shift+F11
Toggle the sidebarAlt+0 (Cmd+0 on macOS)
Move to Edit mode

In Edit mode:

  • The first press moves focus to the editor
  • The second press closes secondary windows
Exit Qt Creator

By default, Qt Creator exits without asking for confirmation, unless there are unsaved changes in open files. To always be asked, select the Ask for confirmation before exiting check box in Edit > Preferences > Environment > System.


Editing Keyboard Shortcuts

ActionKeyboard shortcut
Auto-indent selectionCtrl+I
Trigger a completion in this scopeCtrl+Space
Display tooltips for function signatures regardless of the cursor position in the function callCtrl+Shift+D
Copy lineCtrl+Ins
Copy line downCtrl+Alt+Down
Copy line upCtrl+Alt+Up
Paste from the clipboard historyCtrl+Shift+V

Subsequent presses move you back in the history

Cut lineShift+Del
Join linesCtrl+J
Insert line above current lineCtrl+Shift+Enter
Insert line below current lineCtrl+Enter
Decrease font sizeCtrl+- (Ctrl+Roll mouse wheel down)
Increase font sizeCtrl++ (Ctrl+Roll mouse wheel up)
Reset font sizeCtrl+0
Toggle Vim-style editingAlt+Y, Alt+Y
SplitCtrl+E, 2
Split side by sideCtrl+E, 3
Remove all splitsCtrl+E, 1
Remove current splitCtrl+E, 0
Select allCtrl+A
Go to block endCtrl+]
Go to block startCtrl+[
Go to block end and select the lines between the current cursor position and the end of the blockCtrl+Shift+]
Go to block start and select the lines between the current cursor position and the beginning of the blockCtrl+Shift+[
Select the current block

The second press extends the selection to the parent block. To enable this behavior, select Edit > Preferences > Text Editor > Behavior > Enable smart selection changing.

Undo the latest smart block selectionCtrl+Alt+Shift+U
Move current line downCtrl+Shift+Down
Move current line upCtrl+Shift+Up
Trigger a refactoring action in this scopeAlt+Enter
Rewrap paragraphCtrl+E, R
Enable text wrappingCtrl+E, Ctrl+W
Toggle comment for selectionCtrl+/
Visualize whitespaceCtrl+E, Ctrl+V
Adjust sizeCtrl+J
Lay out in a gridCtrl+G
Lay out horizontallyCtrl+H
Lay out verticallyCtrl+L
Edit signals and slotsF4
Toggle bookmarkCtrl+M
Go to next bookmarkCtrl+.
Go to previous bookmarkCtrl+,
Fetch snippetAlt+C, Alt+F
Paste snippetAlt+C, Alt+P
Find references to symbol under cursorCtrl+Shift+U
Follow symbol under cursor

Works with namespaces, classes, functions, variables, include statements and macros

Rename symbol under cursorCtrl+Shift+R
Switch between function declaration and definitionShift+F2
Open type hierarchyCtrl+Shift+T
Switch between header and source fileF4
Add a cursor at the next occurrence of selected text for multi-cursor editingCtrl+D
Turn selected text into lowercaseAlt+U
Turn selected text into uppercaseAlt+Shift+U
Sort selected lines alphabeticallyAlt+Shift+S
Run static checks on JavaScript code to find common problemsCtrl+Shift+C
Find and replaceCtrl+F
Find nextF3
Find previousShift+F3
Find next occurrence of selected textCtrl+F3
Find previous occurrence of selected textCtrl+Shift+F3
Replace nextCtrl+=
Open advanced findCtrl+Shift+F
Record a text-editing macroAlt+[
Stop recording a macroAlt+]
Play last macroAlt+R
Show Qt Quick toolbarsCtrl+Alt+Space
Execute user actions in FakeVim modeAlt+Y, n, where n is the number of the user action, from 1 to 9

Emacs Shortcuts

You can specify shortcuts for executing actions in a way that is familiar to Emacs editor users. The actions are not bound to any key combinations by default. The following actions are available:

  • Copy
  • Cut
  • Delete Character
  • Exchange Cursor and Mark
  • Go to File End
  • Go to File Start
  • Go to Line End
  • Go to Line Start
  • Go to Next Character
  • Go to Next Line
  • Go to Next Word
  • Go to Previous Character
  • Go to Previous Line
  • Go to Previous Word
  • Insert Line and Indent
  • Kill Line
  • Kill Word
  • Mark
  • Scroll Half Screen Down
  • Scroll Half Screen Up
  • Yank

Image Viewer Shortcuts

ActionKeyboard shortcut
Switch to backgroundCtrl+[
Switch to outlineCtrl+]
Zoom inCtrl++
Zoom outCtrl+-
Fit to screenCtrl+=
Original sizeCtrl+0

Debugging Keyboard Shortcuts

ActionKeyboard shortcut
Start or continue debuggingF5
Exit debuggerShift+F5
Step overF10
Step intoF11
Step outShift+F11
Set or remove breakpointF9 (F8 on macOS)
Enable or disable breakpointCtrl+F9 (Ctrl+F8 on macOS)
Run to selected functionCtrl+F6
Run to lineCtrl+F10
Reverse directionF12

Project Keyboard Shortcuts

ActionKeyboard shortcut
Build projectCtrl+B
Build allCtrl+Shift+B
New projectCtrl+Shift+N
Open projectCtrl+Shift+O
Select the kit to build and run your project withCtrl+T

Help Keyboard Shortcuts

ActionKeyboard shortcut
View context-sensitive helpF1
Activate contents in Help modeCtrl+T
Add bookmark in Help modeCtrl+M
Activate index in Help modeCtrl+I
Reset font sizeCtrl+0
Activate search in Help modeCtrl+S

Version Control Keyboard Shortcuts

ActionVersion control system
AddAlt+C, Alt+AAlt+G, Alt+AAlt+P, Alt+AAlt+S, Alt+A
Commit/SubmitAlt+Z, Alt+CAlt+C, Alt+CAlt+G, Alt+CAlt+G, Alt+CAlt+P, Alt+SAlt+S, Alt+C
DiffAlt+Z, Alt+DAlt+C, Alt+DAlt+G, Alt+DAlt+G, Alt+DAlt+S, Alt+D
Diff projectAlt+G, Alt+Shift+DAlt+P, Alt+D
Blame/AnnotateAlt+G, Alt+B
Log/FilelogAlt+Z, Alt+LAlt+G, Alt+LAlt+G, Alt+LAlt+P, Alt+F
Log projectAlt+G, Alt+K
StatusAlt+Z, Alt+SAlt+G, Alt+S
Undo changes/RevertAlt+G, Alt+UAlt+P, Alt+R
EditAlt+P, Alt+E
OpenedAlt+P, Alt+O