19

What is the your most useful and productive keyboard shortcut in Qt Creator?

Following the trend of great questions asked about Eclipse CDT, vim, Intellij IDEA.

Community
  • 1
  • 1
grzkv
  • 2,599
  • 3
  • 26
  • 37

2 Answers2

18

Comment/uncomment lines (select text and press). With this shortcut you can simply comment very large piece of code and uncomment it in future:

Ctrl + /

Autocomplete:

Ctrl + Space

History of clipboard. You get popup menu with all text which you pasted in Qt Creator and if you choose something and press Enter you paste this formatted text into your code

Ctrl + Shift + V

mtb
  • 1,350
  • 16
  • 32
Jablonski
  • 18,083
  • 2
  • 46
  • 47
11

F2 aka "Follow Symbol Under Cursor"

(You can also use Ctrl + Left Mouse Button for this.)

Let me explain. In visual studio to obtain the same you have F12 (Go to definition) but this one open the search result and need you to select the possible matches. The difference between instant result and a possible two seconds or more to get what you want (especially with common names like open)

F4 aka "Switch\Header Source"

In several other visual text editors for C++ (including Visual) you have to manually locate the header corresponding to the current source or vice-versa. But it's effectiveness greatly depend on whether or not you are using SCU for your classes.

Fredrik
  • 9
  • 2
UmNyobe
  • 22,539
  • 9
  • 61
  • 90
  • 2
    `Alt` + `Left`/`Right`, to switch back and forth between two source files. Especially useful in combination with `Ctrl`+`Click`. – coyotte508 Jun 09 '16 at 09:20
  • 1
    I would like to add that using `Ctrl + Tab` functions like Alt+Tab does, allowing you to switch between all files opened in the editor. Very useful for toggling between two files which aren't header+source (F4). – smoothware Feb 19 '17 at 12:27
  • `Ctrl + Shift + U` - Find usage of symbol in project under cursor – Konstantin Burlachenko May 08 '20 at 19:19
  • 1
    `Ctrl + Shift + I` -- Open Include Hierarchy https://wiki.qt.io/Qt_Creator_Keyboard_Shortcuts - List of some popular shortcuts – Konstantin Burlachenko May 08 '20 at 19:26