Qt Creator Code Completion: Difference between revisions

From Qt Wiki
Jump to navigation Jump to search
No edit summary
 
No edit summary
Line 1: Line 1:
[[Category:Tools::QtCreator]]<br />[toc align_right=&quot;yes&amp;quot; depth=&quot;3&amp;quot;]
(… feel invited to edit …)
(… feel invited to edit …)


=QtCreator Code completion Tips and Tricks=
= QtCreator Code completion - Tips and Tricks =


Code completion is a feature in QtCreator that helps to write program source code efficiently.<br /> Pressing Ctrl+&lt;Space&gt; 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 is a feature in QtCreator that helps to write program source code efficiently.<br />Pressing Ctrl+&lt;Space&amp;gt; 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.
Code completion can be configured to &quot;jump in&amp;quot; automatically after typing some characters and then stopping to type.


==Situations where code completion is helpful==
== Situations where code completion is helpful ==


* include filenames
* include filenames
Line 15: Line 17:
* … (please fill up)
* … (please fill up)


==CamelStyleCodeCompletion==
== CamelStyleCodeCompletion ==


Code completion filters the popup using the CamelStyleNamePattern: typing <span class="caps">CSNP</span> could complete to CamelStyleNamePattern.
Code completion filters the popup using the CamelStyleNamePattern: typing CSNP could complete to CamelStyleNamePattern.


==Magic Keys==
== 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.
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: +, :,&lt;, … ?
Should there be more magic keys like: '+', ':','&lt;', … ?


==Slow down of code completion==
== 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.
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.
* <nowiki>#include &lt;Windows.h&gt; 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.</nowiki>
===Categories:===
* [[:Category:Tools|Tools]]
** [[:Category:Tools::QtCreator|QtCreator]]

Revision as of 10:21, 24 February 2015


[toc align_right="yes&quot; depth="3&quot;]

(… 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&gt; 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&quot; 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.