Keyboard Shortcuts

Qt Creator provides various keyboard shortcuts to speed up your development process. 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 Tools > Options > 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.

Configuring Keyboard Shortcuts

To customize a keyboard shortcut:

  1. Select Tools > Options > 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 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 file or projectCtrl+N
Open in external editorAlt+V, Alt+I
Select allCtrl+A
DeleteDel
CutCtrl+X
CopyCtrl+C
PasteCtrl+V
RedoCtrl+Y
PrintCtrl+P
SaveCtrl+S
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 Issues paneAlt+1 (Cmd+1 on macOS)
Toggle Search Results paneAlt+2 (Cmd+2 on macOS)
Toggle Application Output paneAlt+3 (Cmd+3 on macOS)
Toggle Compile Output paneAlt+4 (Cmd+4 on macOS)
Toggle other output panesAlt+number (Cmd+number on macOS)

Where the number is the number of the output pane.

Activate Bookmarks paneAlt+M
Activate File System paneAlt+Y
Activate Open Documents paneAlt+O
Maximize output panesAlt+9
Move to next item in output panesF6
Move to previous item in output panesShift+F6
Activate Projects paneAlt+X
Full screenCtrl+Shift+F11
Toggle the sidebarAlt+0 (Cmd+0 on macOS)
UndoCtrl+Z
Move to Edit mode

In Edit mode:

  • The first press moves focus to the editor
  • The second press closes secondary windows
Esc
Exit Qt CreatorCtrl+Q

Editing Keyboard Shortcuts

ActionKeyboard shortcut
Auto-indent selectionCtrl+I
CollapseCtrl+<
ExpandCtrl+>
Trigger a completion in this scopeCtrl+Space
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+V, Alt+V
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 Tools > Options > Text Editor > Behavior > Enable smart selection changing.

Ctrl+U
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
PreviewAlt+Shift+R
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 usagesCtrl+Shift+U
Follow symbol under cursor

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

F2
Rename symbol under cursorCtrl+Shift+R
Switch between function declaration and definitionShift+F2
Open type hierarchyCtrl+Shift+T
Switch between header and source fileF4
Turn selected text into lowercaseAlt+U
Turn selected text into uppercaseAlt+Shift+U
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+V, 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

Qt Quick Designer Keyboard Shortcuts

ActionKeyboard shortcut
Open the QML file that defines the selected componentF2
Move between code editor and visual editorF4
Toggle left sidebarCtrl+Alt+0
Toggle right sidebarCtrl+Alt+Shift+0

Debugging Keyboard Shortcuts

ActionKeyboard shortcut
Start or continue debuggingF5
Exit debuggerShift+F5
Step overF10
Step intoF11
Step outShift+F11
Toggle breakpointF9
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
RunCtrl+R

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
BazaarCVSGitMercurialPerforceSubversion
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

© 2016 The Qt Company Ltd. 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.