Keyboard Shortcuts

Keyboard shortcuts make application development faster. To view all Qt Creator functions and their keyboard shortcuts, select Preferences > Environment > Keyboard.

The tables in this topic list the default keyboard shortcuts. They are categorized by actions.

Conflicting Shortcuts

Shortcuts that are displayed in red 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 in the current context, Qt Creator will not execute any function due to the conflict.

A keyboard shortcut might also conflict with a shortcut that your window manager uses for its own purposes. If the window manager consumes the key event, the Qt Creator shortcut will not be activated. 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 by default uses F10 in its window manager, and therefore the default Qt Creator keyboard shortcut F10 (Step Over) will not work on that system.

Showing Shortcuts in Menus

To override the platform default value that determines whether keyboard shortcuts are shown in the labels of context menu items, select 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 Environment preferences}

Top 5 General Shortcuts

ActionWindows and LinuxmacOS
Return to the editorEscEsc
Go to previous open document in historyCtrl+TabOpt+Tab
Build projectCtrl+BCmd+B
RunCtrl+RCmd+R
Toggle output viewsAlt+<number>

Where the number is the number of the view.

Cmd+<number>

Top 5 Locator Shortcuts

ActionWindows and LinuxmacOS
Activate LocatorCtrl+KCmd+K
Find a fileCtrl+K, <text>Cmd+K, <text>
Start debugging a run configuration of the active projectCtrl+K, drCmd+K, dr
Run a run configuration of the active projectCtrl+K, rrCmd+K, rr
Trigger a menu itemCtrl+Shift+K, <menu item name>Cmd+Shift+K, <menu item name>

Top 10 Editor Shortcuts

ActionWindows and LinuxmacOS
Auto-indent selectionCtrl+ICmd+I
Find references to symbol under cursorCtrl+Shift+UCmd+Shift+U
Follow symbol under cursorF2F2
Go to advanced findCtrl+Shift+FCmd+Shift+F
Go to previous bookmarkCtrl+,Ctr+,
Open type hierarchyCtrl+Shift+TCtrl+Shift+T
Paste from the clipboard historyCtrl+Shift+VCmd+Shift+V
Sort selected lines alphabeticallyAlt+Shift+SCtrl+Shift+S
Switch between header and source fileF4F4
Trigger a code completion in the current scopeCtrl+SpaceCtrl+Space

Top 5 Debugger Shortcuts

ActionWindows and LinuxmacOS
Start or continue debuggingF5Cmd+Y
Exit debuggerShift+F5Cmd+Shift+Y
Step overF10Cmd+Shift+0
Step intoF11Cmd+Shift+I
Step outShift+F11Cmd+Shift+T

Top 5 Git Shortcuts

ActionWindows and LinuxmacOS
DiffAlt+G, Alt+DCtrl+G, Ctrl+D
Diff project or repositoryAlt+G, Alt+Shift+DCtrl+G, Ctrl+Shift+D
Diff of current modified editorAlt+HCtrl+H
Git blameAlt+G, Alt+BCtrl+G, Ctrl+B
Git log repositoryAlt+G, Alt+KCtrl+G, Ctrl+K

General Keyboard Shortcuts

Document Navigation Shortcuts

ActionWindows and LinuxmacOS
Go backAlt+LeftCmd+Opt+Left
Go forwardAlt+RightCmd+Opt+Right
Go to lineCtrl+LCmd+L
Go to next open document in historyCtrl+Shift+TabOpt+Shift+Tab
Go to previous open document in historyCtrl+TabOpt+Tab
Go to next split or windowCtrl+E, OCtrl+E, O

Exit Qt Creator

By default, Qt Creator exits without asking for confirmation, unless there are unsaved changes in open files. To always be asked, go to Preferences > Environment > System and then select Ask for confirmation before exiting.

ActionWindows and LinuxmacOS
Exit Qt CreatorCtrl+QCmd+Q

File Management Shortcuts

ActionWindows and LinuxmacOS
Open file or projectCtrl+OCmd+O
Open in a new windowCtrl+E, 4Ctrl+E, 4
New projectCtrl+Shift+NCmd+Shift+N
New fileCtrl+NCmd+N
Save current documentCtrl+SCmd+S
Save all documentsCtrl+Shift+SNone
Close current editorCtrl+WCmd+W
Close all editorsCtrl+Shift+WCmd+Shift+W

Find-and-Replace Shortcuts

ActionWindows and LinuxmacOS
Activate LocatorCtrl+KCmd+K
Find and replaceCtrl+FCmd+F
Find nextF3Cmd+G
Find previousShift+F3Ctrl+Shift+G
Find next occurrence of selected textCtrl+F3Cmd+F3
Find previous occurrence of selected textCmd+Shift+F3None
Replace nextCtrl+=Cmd+=
Open advanced findCtrl+Shift+FCmd+Shift+F

Text Editing Shortcuts

ActionWindows and LinuxmacOS
Select allCtrl+ACmd+A
CutCtrl+XCmd+X
CopyCtrl+CCmd+C
PasteCtrl+VCmd+V
Paste from the clipboard historyCtrl+Shift+VCmd+Shift+V
PrintCtrl+PCmd+P
UndoCtrl+ZCmd+Z
RedoCtrl+Shift+ZCmd+Shift+Z

UI Navigation Shortcuts

Mode Shortcuts

ActionWindows and LinuxmacOS
Switch to Welcome modeCtrl+1Ctrl+1
Switch to Edit modeCtrl+2Ctrl+2
Switch to Design modeCtrl+3Ctrl+3
Switch to Debug modeCtrl+4Ctrl+4
Switch to Projects modeCtrl+5Ctrl+5
Switch to Extensions modeCtrl+6Ctrl+6
Switch to Help modeCtrl+7Ctrl+7
Go to Edit mode

In Edit mode:

  • The first press moves focus to the editor
  • The second press closes secondary windows
EscEsc

Output View Shortcuts

ActionWindows and LinuxmacOS
Toggle IssuesAlt+1Cmd+1
Toggle Search ResultsAlt+2Cmd+2
Toggle Application OutputAlt+3Cmd+3
Toggle Compile OutputAlt+4Cmd+4
Toggle other output viewsAlt+<number>

Where the number is the number of the view.

Cmd+<number>
Maximize output viewsAlt+Shift+9Cmd+Shift+9
Move to next item in outputF6F6
Move to previous item in outputShift+F6Shift+F6
ActionWindows and LinuxmacOS
Activate Bookmarks viewAlt+MCtrl+Opt+M
Activate File System viewAlt+Y, Alt+FCtrl+Y, Ctrl+F
Activate Open Documents viewAlt+OCtrl+O
Activate Projects viewAlt+XCtrl+X
Full screenCtrl+Shift+F11Cmd+Ctrl+F
Toggle the left sidebarAlt+0Cmd+0
Toggle the right sidebarAlt+Shift+0Cmd+Shift+0

Editor Shortcuts

ActionWindows and LinuxmacOS
Auto-indent selectionCtrl+ICmd+I
Rewrap paragraphCtrl+E, RCtrl+E, R
Enable text wrappingCtrl+E, Ctrl+WCtrl+E, Ctrl+W
Toggle comment for selectionCtrl+/Cmd+/
Visualize whitespaceCtrl+E, Ctrl+VCtrl+E, Ctrl+V
Trigger a code completion in the current scopeCtrl+SpaceCtrl+Space
Trigger a refactoring action in this scopeAlt+EnterOpt+Return
Display tooltips for function signatures regardless of the cursor position in the function callCtrl+Shift+DCtrl+Shift+D

Bookmark Shortcuts

ActionWindows and LinuxmacOS
Toggle bookmarkCtrl+MCtrl+M
Go to next bookmarkCtrl+.Ctrl+.
Go to previous bookmarkCtrl+,Ctrl+,

Code Block Shortcuts

ActionWindows and LinuxmacOS
Collapse blockCtrl+<Cmd+<
Expand blockCtrl+>Cmd+>
Go to block endCtrl+]Cmd+]
Go to block startCtrl+[Cmd+[
Go to block end and select the lines between the current cursor position and the end of the blockCtrl+Shift+]Cmd+}
Go to block start and select the lines between the current cursor position and the beginning of the blockCtrl+Shift+[Cmd+{
Select the current block

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

Ctrl+UCmd+U
Undo the latest smart block selectionCtrl+Alt+Shift+UCmd+Opt+Shift+U

Code Line Shortcuts

ActionWindows and LinuxmacOS
Copy lineCtrl+InsCmd+Ins
Copy line downCtrl+Alt+DownCmd+Opt+Down
Copy line upCtrl+Alt+UpCmd+Opt+Up
Cut lineShift+DelShift+Del
Join linesCtrl+JCmd+J
Insert line above current lineCtrl+Shift+EnterCmd+Shift+Return
Insert line below current lineCtrl+EnterCmd+Return
Move current line downCtrl+Shift+DownCmd+Shift+Down
Move current line upCtrl+Shift+UpCmd+Shift+Up

Code Navigation Shortcuts

ActionWindows and LinuxmacOS
Find references to symbol under cursorCtrl+Shift+U

Note: If this keyboard shortcut does not work on Linux, see Editing Issues.

Cmd+Shift+U
Follow symbol under cursor

Works with namespaces, classes, functions, variables, include statements, and macros, as well as CMake functions, macros, targets, and packages. Also, opens URLs in the default browser and Qt resource files (.qrc) in the resource editor

F2F2
Switch between function declaration and definitionShift+F2Shift+F2

C++ Editing Shortcuts

ActionWindows and LinuxmacOS
Open type hierarchyCtrl+Shift+TCtrl+Shift+T
Open include hierarchyCtrl+Shift+ICtrl+Shift+I
Rename symbol under cursorCtrl+Shift+RCmd+Shift+R
Switch between header and source fileF4F4
Add a cursor at the next occurrence of selected text for multi-cursor editingCtrl+DCmd+D
Turn selected text into lowercaseAlt+UCtrl+U
Turn selected text into uppercaseAlt+Shift+UCtrl+Shift+U
Sort selected lines alphabeticallyAlt+Shift+SCtrl+Shift+S

FakeVim Shortcuts

ActionWindows and LinuxmacOS
Toggle Vim-style editingAlt+Y, Alt+YCtrl+Shift+Y, Ctrl+Shift+Y
Execute user actions in FakeVim modeAlt+Y, n, where n is the number of the user action, from 1 to 9Ctrl+Shift+Y, n

Font Size Shortcuts

ActionWindows and LinuxmacOS
Decrease font sizeCtrl+- (Ctrl+Roll mouse wheel down)Cmd+- (Cmd+Roll mouse wheel down)
Increase font sizeCtrl++ (Ctrl+Roll mouse wheel up)Cmd++ (Cmd+Roll mouse wheel up)
Reset font sizeCtrl+0Ctrl+0

Snippet Shortcuts

ActionWindows and LinuxmacOS
Fetch snippetAlt+C, Alt+FCtrl+C, Ctrl+F
Paste snippetAlt+C, Alt+PCtrl+C, Ctrl+P

Split View Shortcuts

ActionWindows and LinuxmacOS
Split viewCtrl+E, 2Ctrl+E, 2
Split side by sideCtrl+E, 3Ctrl+E, 3
Remove all splitsCtrl+E, 1Ctrl+E, 1
Remove current splitCtrl+E, 0Ctrl+E, 0

Text Editing Macro Shortcuts

ActionWindows and LinuxmacOS
Record a text-editing macroAlt+[Cmd+[
Stop recording a macroAlt+]Cmd+]
Play last macroAlt+RCtrl+R

Build-and-Run Shortcuts

ActionWindows and LinuxmacOS
Build projectCtrl+BCmd+B
Build current fileCtrl+Alt+BCmd+Opt+B
Build allCtrl+Shift+BCmd+Shift+B
Select the kit to build and run your project withCtrl+TCmd+T
RunCtrl+RCmd+R

Debugger Shortcuts

ActionWindows and LinuxmacOS
Start or continue debuggingF5Cmd+Y
Exit debuggerShift+F5Cmd+Shift+Y
Step overF10Cmd+Shift+O
Step intoF11Cmd+Shift+I
Step outShift+F11Cmd+Shift+T
Set or remove breakpointF9F8
Enable or disable breakpointCtrl+F9Cmd+F8
Run to selected functionCtrl+F6Cmd+F6
Run to lineCtrl+F10Shift+F8
Reverse directionF12None

Help Mode Shortcuts

ActionWindows and LinuxmacOS
View context-sensitive helpF1F1
Go to Contents in the Help modeCtrl+Shift+CNone
Add a bookmarkCtrl+MCtrl+M
Go to Index in the Help modeCtrl+Shift+ICtrl+I
Reset font sizeCtrl+0Ctrl+0
Go to Search in the Help modeCtrl+Shift+/Ctrl+/

Image Viewer Shortcuts

ActionWindows and LinuxmacOS
Switch to backgroundCtrl+[Cmd+[
Switch to outlineCtrl+]Cmd+]
Zoom inCtrl++Cmd++
Zoom outCtrl+-Cmd+-
Fit to screenCtrl+=Cmd+=
Original sizeCtrl+0Ctrl+0

Project Shortcuts

ActionWindows and LinuxmacOS
New projectCtrl+Shift+NCmd+Shift+N
Open projectCtrl+Shift+ONone

Qt Quick Shortcuts

ActionWindows and LinuxmacOS
Show Qt Quick toolbarsCtrl+Alt+SpaceCtrl+Opt+Space
Run static checks on JavaScript code to find common problemsCtrl+Shift+CCmd+Shift+C

Qt Widgets Designer Shortcuts

ActionWindows and LinuxmacOS
Adjust sizeCtrl+JCtrl+J
Lay out in a gridCtrl+GCtrl+Shift+G
Lay out horizontallyCtrl+HCtrl+Shift+H
Lay out verticallyCtrl+LCtrl+L
PreviewAlt+Shift+ROpt+Shift+R
Edit signals and slotsF4F4

Version Control Shortcuts

ActionVersion control system
BazaarCVSGitMercurialPerforceSubversion
AddNoneAlt+C, Alt+AAlt+G, Alt+ANoneAlt+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+DNoneAlt+S, Alt+D
Diff of project or repositoryNoneNoneAlt+G, Alt+Shift+DNoneAlt+P, Alt+DNone
Diff of current modified editorNoneNoneAlt+HNoneNoneNone
Blame/AnnotateNoneNoneAlt+G, Alt+BNoneNoneNone
Log/FilelogAlt+Z, Alt+LNoneAlt+G, Alt+LAlt+G, Alt+LAlt+P, Alt+FNone
Log repositoryNoneNoneAlt+G, Alt+KNoneNoneNone
StatusAlt+Z, Alt+SNoneNoneAlt+G, Alt+SNoneNone
Undo changes/RevertNoneNoneAlt+G, Alt+UNoneAlt+P, Alt+RNone
EditNoneNoneNoneNoneAlt+P, Alt+ENone
OpenedNoneNoneNoneNoneAlt+P, Alt+ONone

VCS Shortcuts on macOS

ActionVersion control system
BazaarCVSGitMercurialPerforceSubversion
AddNoneCtrl+C, Ctrl+ACtrl+G, Ctrl+ANoneCtrl+P, Ctrl+ACtrl+S, Ctrl+A
Commit/SubmitCtrl+Z, Ctrl+CCtrl+C, Ctrl+CCtrl+G, Ctrl+CCtrl+H, Ctrl+CCtrl+P, Ctrl+SCtrl+S, Ctrl+C
DiffCtrl+Z, Ctrl+DCtrl+C, Ctrl+DCtrl+G, Ctrl+DCtrl+H, Ctrl+DNoneCtrl+S, Ctrl+D
Diff of project or repositoryNoneNoneCtrl+G, Ctrl+Shift+DNoneCtrl+P, Ctrl+DNone
Diff of current modified editorNoneNoneCtrl+HNoneNoneNone
Blame/AnnotateNoneNoneCtrl+G, Ctrl+BNoneNoneNone
Log/FilelogCtrl+Z, Ctrl+LNoneCtrl+G, Ctrl+LCtrl+H, Ctrl+LCtrl+P, Ctrl+FNone
Log repositoryNoneNoneCtrl+G, Ctrl+KNoneNoneNone
StatusCtrl+Z, Ctrl+SNoneNoneCtrl+H, Ctrl+SNoneNone
Undo changes/RevertNoneNoneCtrl+G, Ctrl+UNoneCtrl+P, Ctrl+RNone
EditNoneNoneNoneNoneCtrl+P, Ctrl+ENone
OpenedNoneNoneNoneNoneCtrl+P, Ctrl+ONone

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.

Note: Enable the EmacsKeys plugin to use the shortcuts.

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

See also Assign keyboard shortcuts, Find keyboard shortcuts, Import and export keyboard shortcuts, and Enable and disable plugins.

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.