Qt Creator CppSupport ConfigurableQuickFixes: Difference between revisions

From Qt Wiki
Jump to navigation Jump to search
No edit summary
 
No edit summary
Line 1: Line 1:
=List of Qt Creator Quick Fixes that could be made configurable=
[[Category:Tools::QtCreator]]<br />[toc align_right=&quot;yes&amp;quot; depth=&quot;3&amp;quot;]


==Configuration Dialog==
= List of Qt Creator Quick Fixes that could be made configurable =
 
== Configuration Dialog ==


The options could go into the dialog that is reachable by:
The options could go into the dialog that is reachable by:


* Projects (Ctrl+5) Code Style Edit…
* Projects (Ctrl+5) - Code Style - Edit…
* Menu: Tools Options C++ Code Style Edit…
* Menu: Tools - Options - C++ - Code Style - Edit…
 
==List of Options==
 
===Return value constness of getter function for a user defined non-pointer/non-reference type===
 
Related Bugs: [https://bugreports.qt.io/browse/QTCREATORBUG-9413 <span class="caps">QTCREATORBUG</span>-9413] ''[bugreports.qt.io]''
 
'''Possible values'''
 
* Non-const return value
* Const return value
* Auto detect (For C++11: Non-const, otherwise: const)
 
For C++11 it’s better to return non-const objects because of rvalue references / move semantics.
 
'''Example'''<br /> vs<br />


'''Affected Quick Fixes'''
== List of Options ==


* Create Getter and Setter Member Functions (GenerateGetterSetter)
=== Return value constness of getter function for a user defined non-pointer/non-reference type ===


===Position of first curly brace of a function block===
Related Bugs: &quot;QTCREATORBUG-9413&amp;quot;:https://bugreports.qt.io/browse/QTCREATORBUG-9413


'''Possible values'''
'''Possible values'''<br />* Non-const return value<br />* Const return value<br />* Auto detect (For C+''11: Non-const, otherwise: const)
<br />For C''+11 it's better to return non-const objects because of rvalue references / move semantics.


* Same line as function name
'''Example'''<br /><code>A getMember() const;<code><br />vs<br /></code>const A getMember() const;</code>
* On new line
* Auto detect (check surrounding functions)


'''Example'''<br /> vs<br />
'''Affected Quick Fixes'''<br />* Create Getter and Setter Member Functions (GenerateGetterSetter)


'''Affected Quick Fixes'''
=== Position of first curly brace of a function block ===


* Add Definition {Here, Inside Class, Outside Class, in file.cpp} (InsertDefFromDecl)
'''Possible values'''<br />* Same line as function name<br />* On new line<br />* Auto detect (check surrounding functions)
* Extract Function (Extract Function)
* Create Getter and Setter Member Functions (GenerateGetterSetter)
* Move Definition {Outside Class, to file.cpp} (MoveFuncDefOutside)
* Move Definition {to Class, to file.cpp} (MoveFuncDefToDecl)
* Insert Virtual Functions of Base Classes (InsertVirtualMethods)


===Categories:===
'''Example'''<br /><code><br />void f() {<br />}<br /></code><br />vs<br /><code><br />void f()<br />{<br />}<br /></code>


* [[:Category:Tools|Tools]]
'''Affected Quick Fixes'''<br />* Add Definition {Here, Inside Class, Outside Class, in file.cpp} (InsertDefFromDecl)<br />* Extract Function (Extract Function)<br />* Create Getter and Setter Member Functions (GenerateGetterSetter)<br />* Move Definition {Outside Class, to file.cpp} (MoveFuncDefOutside)<br />* Move Definition {to Class, to file.cpp} (MoveFuncDefToDecl)<br />* Insert Virtual Functions of Base Classes (InsertVirtualMethods)
** [[:Category:Tools::QtCreator|QtCreator]]

Revision as of 11:31, 24 February 2015


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

List of Qt Creator Quick Fixes that could be made configurable

Configuration Dialog

The options could go into the dialog that is reachable by:

  • Projects (Ctrl+5) - Code Style - Edit…
  • Menu: Tools - Options - C++ - Code Style - Edit…

List of Options

Return value constness of getter function for a user defined non-pointer/non-reference type

Related Bugs: "QTCREATORBUG-9413&quot;:https://bugreports.qt.io/browse/QTCREATORBUG-9413

Possible values
* Non-const return value
* Const return value
* Auto detect (For C+11: Non-const, otherwise: const)
For C+11 it's better to return non-const objects because of rvalue references / move semantics.

Example

A getMember() const;<code><br />vs<br />

const A getMember() const;

Affected Quick Fixes
* Create Getter and Setter Member Functions (GenerateGetterSetter)

Position of first curly brace of a function block

Possible values
* Same line as function name
* On new line
* Auto detect (check surrounding functions)

Example

<br />void f() {<br />}<br />


vs

<br />void f()<br />{<br />}<br />

Affected Quick Fixes
* Add Definition {Here, Inside Class, Outside Class, in file.cpp} (InsertDefFromDecl)
* Extract Function (Extract Function)
* Create Getter and Setter Member Functions (GenerateGetterSetter)
* Move Definition {Outside Class, to file.cpp} (MoveFuncDefOutside)
* Move Definition {to Class, to file.cpp} (MoveFuncDefToDecl)
* Insert Virtual Functions of Base Classes (InsertVirtualMethods)