Qt wiki will be updated on October 12th 2023 starting at 11:30 AM (EEST) and the maintenance will last around 2-3 hours. During the maintenance the site will be unavailable.
Qt Creator Code Completion
(… feel invited to edit …)
QtCreator Code completion – Tips and Tricks
Code completion is a feature in QtCreator that helps to write program source code efficiently.
Pressing Ctrl+<Space> asks the code completer to popup a small help window with suggestions which might be appropriate to type at the current cursor position in the source file.
Code completion can be configured to “jump in” automatically after typing some characters and then stopping to type.
Situations where code completion is helpful
- include filenames
- method names
- class names
- namespaces
- … (please fill up)
CamelStyleCodeCompletion
Code completion filters the popup using the CamelStyleNamePattern: typing CSNP could complete to CamelStyleNamePattern.
Magic Keys
Some keys are magic keys. Hitting these keys while the completion popup is shown uses the selected completion and types in the magic key.
- ‘.’
- ‘(’
Should there be more magic keys like: ‘+’, ‘:’,’<’, … ?
Slow down of code completion
Starting with QtCreator 2.3 there seems to be a thread to fill the popup while not blocking typing during code completion analyzing. However there are still situations where code completion takes significant time.
- #include <Windows.h> is a show stopper. Do not include it in any often-used header files. Try to move it to the implementation files, when really needed.