Keyboard Shortcuts

Qt Creator has various keyboard shortcuts that speed up your development process. To view all Qt Creator functions and their keyboard shortcuts, select Preferences > Environment > Keyboard.

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.

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}

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
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 Extensions modeCtrl+6
Switch to Help modeCtrl+7
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+Shift+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)
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 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 Preferences > Environment > System.

Ctrl+Q

Editing Keyboard Shortcuts

ActionKeyboard shortcut
Auto-indent selectionCtrl+I
CollapseCtrl+<
ExpandCtrl+>
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 Preferences > 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
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

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

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

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

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

Qt Widgets Designer Shortcuts

ActionKeyboard shortcut
Adjust sizeCtrl+J
Lay out in a gridCtrl+G
Lay out horizontallyCtrl+H
Lay out verticallyCtrl+L
PreviewAlt+Shift+R
Edit signals and slotsF4

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
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 project or repositoryAlt+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 repositoryAlt+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

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

© 2024 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.