Qt Creator CppSupport ConfigurableQuickFixes: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
(Cleanup) |
||
(6 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
=List of Qt Creator Quick Fixes that could be made configurable= | [[Category:Tools::QtCreator]] | ||
__NOTOC__ | |||
= List of Qt Creator Quick Fixes that could be made configurable = | |||
==Configuration Dialog== | == 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) | * Projects (Ctrl+5) - Code Style - Edit… | ||
* Menu: Tools | * Menu: Tools - Options - C++ - Code Style - Edit… | ||
==List of Options== | == List of Options == | ||
===Return value constness of getter function for a user defined non-pointer/non-reference type=== | === Return value constness of getter function for a user defined non-pointer/non-reference type === | ||
Related Bugs: [https://bugreports.qt.io/browse/QTCREATORBUG-9413 | Related Bugs: [https://bugreports.qt.io/browse/QTCREATORBUG-9413 QTCREATORBUG-9413] | ||
'''Possible values''' | '''Possible values''' | ||
* Non-const return value | * Non-const return value | ||
* Const return value | * Const return value | ||
* Auto detect (For C+ | * Auto detect (For C+''11: Non-const, otherwise: const) | ||
For C | For C''+11 it's better to return non-const objects because of rvalue references / move semantics. | ||
'''Example'''< | '''Example''' | ||
<code>A getMember() const;<code> | |||
vs | |||
</code>const A getMember() const;</code> | |||
'''Affected Quick Fixes''' | '''Affected Quick Fixes''' | ||
* Create Getter and Setter Member Functions (GenerateGetterSetter) | * Create Getter and Setter Member Functions (GenerateGetterSetter) | ||
===Position of first curly brace of a function block=== | === Position of first curly brace of a function block === | ||
'''Possible values''' | '''Possible values''' | ||
* Same line as function name | * Same line as function name | ||
* On new line | * On new line | ||
* Auto detect (check surrounding functions) | * Auto detect (check surrounding functions) | ||
'''Example'''< | '''Example''' | ||
<code> | |||
void f() { | |||
} | |||
</code> | |||
vs | |||
<code> | |||
void f() | |||
{ | |||
} | |||
</code> | |||
'''Affected Quick Fixes''' | '''Affected Quick Fixes''' | ||
* Add Definition {Here, Inside Class, Outside Class, in file.cpp} (InsertDefFromDecl) | * Add Definition {Here, Inside Class, Outside Class, in file.cpp} (InsertDefFromDecl) | ||
* Extract Function (Extract Function) | * Extract Function (Extract Function) | ||
Line 46: | Line 57: | ||
* Move Definition {to Class, to file.cpp} (MoveFuncDefToDecl) | * Move Definition {to Class, to file.cpp} (MoveFuncDefToDecl) | ||
* Insert Virtual Functions of Base Classes (InsertVirtualMethods) | * Insert Virtual Functions of Base Classes (InsertVirtualMethods) | ||
Latest revision as of 14:16, 24 May 2015
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
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>
vs
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
void f() {
}
vs
void f()
{
}
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)