From 2ae36b9e265452eae4fd3a67253fe33a6e78e95e Mon Sep 17 00:00:00 2001 From: Leena Miettinen Date: Wed, 14 Apr 2021 18:22:18 +0200 Subject: [PATCH] Doc: Describe quick fix options Fixes: QTCREATORBUG-25581 Change-Id: If1e2434f36c71ebc2ff484f3f4c2c94cdd362c98 Reviewed-by: Christian Kandeler --- ...creator-refactoring-options-generation.png | Bin 0 -> 4193 bytes ...tcreator-refactoring-options-locations.png | Bin 0 -> 5681 bytes ...creator-refactoring-options-namespaces.png | Bin 0 -> 2315 bytes ...tcreator-refactoring-options-templates.png | Bin 0 -> 10299 bytes .../src/editors/creator-code-refactoring.qdoc | 786 +--------------- .../src/editors/creator-editors-options.qdoc | 2 +- .../creator-only/creator-beautifier.qdoc | 2 +- .../src/editors/creator-quick-fixes.qdoc | 878 ++++++++++++++++++ .../creator-projects-settings-overview.qdoc | 2 + doc/qtcreator/src/qtcreator-toc.qdoc | 1 + .../src/qtdesignstudio-toc.qdoc | 1 + 11 files changed, 889 insertions(+), 783 deletions(-) create mode 100644 doc/qtcreator/images/qtcreator-refactoring-options-generation.png create mode 100644 doc/qtcreator/images/qtcreator-refactoring-options-locations.png create mode 100644 doc/qtcreator/images/qtcreator-refactoring-options-namespaces.png create mode 100644 doc/qtcreator/images/qtcreator-refactoring-options-templates.png create mode 100644 doc/qtcreator/src/editors/creator-quick-fixes.qdoc diff --git a/doc/qtcreator/images/qtcreator-refactoring-options-generation.png b/doc/qtcreator/images/qtcreator-refactoring-options-generation.png new file mode 100644 index 0000000000000000000000000000000000000000..ea3cd54b470b3e669be084c80495c909d3685d4b GIT binary patch literal 4193 zcmeAS@N?(olHy`uVBq!ia0y~yV0^*Az$nkb%)r2~S90lm1_lPs0*}aI1_r((Aj~*b zn@^g7fq}im)7O>#DGMJvv*zbZIvxxRjQRmSA+Bm_YHI2lYU<`{>TYW4$!caHYOcv@ zu8nHR^G($?Ox4{?%|c9ri=2atT+}sO)XiPg-CWd@UCcsUTpL}Il3kJ-U6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;IKY%q z>H;XMBIAazU3J21m#p(|bko*%V1`!+x>5hx6Y66P#jh}_GB7YOc)I$ztaD0e0st)l B0aXA1 literal 0 HcmV?d00001 diff --git a/doc/qtcreator/images/qtcreator-refactoring-options-locations.png b/doc/qtcreator/images/qtcreator-refactoring-options-locations.png new file mode 100644 index 0000000000000000000000000000000000000000..9e0dc130662c772e3c5f55d0599a96284fcb4a77 GIT binary patch literal 5681 zcmeAS@N?(olHy`uVBq!ia0y~yVB%+BV7SA<#K6E%QFJwyfq{Xuz$3Dlfr0M`2s2LA z=96Y%U|=ut^mS!_%EHH{rv2sZ_bm(zq8B_}978H@y`3A~E#p4z_+MMLHSfNy+turM zSNHU!15VRSu3mi=U7DSC_k`QyR;`FTLdOg?-{9ZfmepgE|E=Ngj@hlZejME(VK3>^ z`{v{E71#eN6@QZ3z9%$2cGIi!ABv%FZfS1MJ1zeAbgbzLU$-uwfq~)4XRhrG3=9F> z3=9ss3=9lg85kI@Fd+-f(0%)_K;*`T{mtzR3{nfltoQCS?^#qXaIpPe<@PLr`7Y zH5ZEAx_RkPKil1}ZzfAW&NupVE%?05ls}Ue7c($)FA#gl(08?c!?Chsf!t63{Nk9d zF=1ll#kCRhkA-nZvtGUzRP?E5(^2(u{uJb5=e7fb-?y3JImvt6PH^ z4y|ijDR%0{^w>#%D!Cs=@h$vxNw4W{zvriH&CJR@ao#UG7Kkx4L|s`cR;hm7_&fXJ zN0zU;vKF4-mohcx?J||0s{FR>WU(RgRa^VvA%=z7rn4A@d@uS7fL<5??tiV z+B4r*Kl*HaY-O9==GP1d_PD481&`;h_;Wpd_3GA3=ASNAPJD9S^Z6Fr)Tl+O#drTzZ&_r*{B!+OuJa6A85*93 zb$`15G^}LloT!kh<}mC1udgol%9@zvKjY>{-kvp^BsbsblPqOuSQ^58{QH%rhP--V z-;1J^3GcUN{VSXIIl6TE@3OdC%M0tQ&+A2hC|_$`Z=wA*i-AFBb<~>t5cv!23=K;| zx$EZfGcat`XttewR(u8{Ljd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u*%MJ!f~;V zkGJpM-R@FZ7-FdA{pEmv-0BGnCv#O+?b%v>?BQP^I#$VuhCVkz97lPqU^c-*)qZKY3eNM=V`tj1x_wT@DYPgR~- zRdf7>j_1D{S(8+@A6y{oyhBaHBzUz^Yhm28RWnOXO+!!h_$7zDEKpXuZ+KV3`;uR2 zj*;i2+Y8DR<70%(<5sVJbnNvxcE=spG<()1F1=V(8~{&p!dUQgzi zeD>>!v)!eb_fog{Ejhn+efNtUnSAQbHw&uemd%fA&7LUd==S|^{`ZUj?ws5C{Nc)XY$;~fwKa=vt&3V$ zZ(~eZzxZ9{3hw@Z_OoAQd^N9qs;+wyPxj#Fx0r4*N>8}g-)>ZKXv`T?>rl$M6c&HD{k!3%R9eK@bNbOSNFJ^|2k)$ zm~Q<)`Ra*q#?<@%`2mX8-==21kbkx}KxlvPgw~z&?!JH0f8JJe>3lBjy>s#!wda-J znVeQtbnbj>_u1~)lM`nOvl+bIHvL|8q}kpS=}$Mmh+jGJz31n>yT9J;Ti?Ix%pHx+ z`;7&<&pV3t|9^0QR{hg`m+n=rPTD)~)6q#K=k(jV&#vY;(|Divrn#?Y$@Lk#zMebP zAJ1{-yJg^%NU2}4$w8H)75Q?pUUMdH4BK=iL2kcyF$XSpVbgl+Xrw zPVw2{yH6G5&aI979@qAo;ZxYbbrau9e6Fpk^-FoPVd4Gfdjo|2OT@Ri%zj<`+vrH= z8jZrUmu=Q`eLd6{{j7NDoX_lCXT{e_>)TczE`2Z0W@+KNYbn>Gb<5XFF@?7+TWpmz zF@H~h(EhLMO>Y}tPhS}S7%^3SRG{9Wq^uCS1D2csktB8{x5J@M01 oW8$gk2@6%YCxE10guJjn(%HD9?L*^z1_lNOPgg&ebxsLQ0KZIQdH?_b literal 0 HcmV?d00001 diff --git a/doc/qtcreator/images/qtcreator-refactoring-options-templates.png b/doc/qtcreator/images/qtcreator-refactoring-options-templates.png new file mode 100644 index 0000000000000000000000000000000000000000..e84c7cf58248fd3a30ae282aac343c8fa50aa968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 0 HcmV?d00001 diff --git a/doc/qtcreator/src/editors/creator-code-refactoring.qdoc b/doc/qtcreator/src/editors/creator-code-refactoring.qdoc index 05d5554aed0..f6548d8cf0d 100644 --- a/doc/qtcreator/src/editors/creator-code-refactoring.qdoc +++ b/doc/qtcreator/src/editors/creator-code-refactoring.qdoc @@ -26,11 +26,7 @@ /*! \page creator-editor-refactoring.html \previouspage creator-editor-locator.html - \if defined(qtdesignstudio) - \nextpage creator-editor-options.html - \else - \nextpage creator-beautifier.html - \endif + \nextpage creator-editor-quick-fixes.html \title Refactoring @@ -43,6 +39,10 @@ \li Simplify code structure \endlist + \QC allows you to quickly and conveniently apply actions to refactor your + code by selecting them in a context menu. For more information, see + \l{Applying Refactoring Actions}. + \if defined(qtcreator) \section1 Finding Symbols @@ -167,780 +167,4 @@ On Windows and Linux, you can also hold \key {Alt+Shift} and select the rows using the arrow keys and the \key PageUp, \key PageDown, \key Home, \key End keys. - - \section1 Applying Refactoring Actions - - \QC allows you to quickly and conveniently apply actions to refactor your - code by selecting them in a context menu. The actions available depend on - the position of the cursor in the code editor. - - \if defined(qtcreator) - To apply refactoring actions to C++ code, right-click an operand, - conditional statement, string, or name to open a context menu. - \endif - To apply refactoring actions to QML code, right-click an item ID or name. - - In the context menu, select \uicontrol {Refactoring} and then select a - refactoring action. - - You can also press \key {Alt+Enter} to open a context menu that contains - refactoring actions available in the current cursor position. - - \if defined(qtcreator) - \section1 Creating Functions - - You can apply refactoring actions to implement member functions, insert - virtual functions of base classes, create getter and setter functions, - and generate constructors. - - \section2 Implementing Member Functions - - You can apply the \uicontrol {Create Implementations for Member Functions} - refactoring action to create implementations for all member functions in - one go. In the \uicontrol {Member Function Implementations} dialog, you can - specify whether the member functions are generated inline or outside the - class. - - \image qtcreator-refactoring-member-function-implementations.png "Implement Member Functions dialog" - - \section2 Inserting Virtual Functions - - You can apply the \uicontrol {Insert Virtual Functions of Base Classes} - refactoring action to insert declarations and the corresponding definitions - inside or outside the class or in an implementation file (if it exists). - - \image qtcreator-refactoring-virtual-function-dialog.png "Insert Virtual Functions dialog" - - Select the functions to insert in the list of available functions. You can - filter the list and hide reimplemented functions from it. - - You can add \e virtual or the \e override equivalent to the function - declaration. - - \section2 Creating Getters and Setters - - You can apply the \uicontrol {Create Getter and Setter Member Functions} - refactoring action to create either both getter and setter member functions - for member variables or only a getter or setter. - - \image qtcreator-refactoring-getters-and-setters.png "Getters and Setters dialog" - - \section2 Generating Constructors - - You can apply the \uicontrol {Generate Constructor} refactoring action to - create a public, protected, or private constructor for a class. Select the - class members to initialize in the constructor. Drag and drop the parameters - to specify their order in the constructor. - - \image qtcreator-refactoring-constructor.png "Constructor dialog" - - \endif - - \section1 Summary of Refactoring Actions - - \if defined(qtcreator) - If you use the \l{Parsing C++ Files with the Clang Code Model} - {Clang code model} to parse the C++ files, the - \l{http://clang.llvm.org/diagnostics.html}{Clang fix-it hints} - that have been integrated into \QC are also available to you. In addition to - the standard ways of activating refactoring actions, you can select the - actions that are applicable on a line in the context menu in the left margin - of the code editor. - - \section2 Refactoring C++ Code - - You can apply the following types of refactoring actions to C++ code: - - \list - \li Change binary operands - \li Simplify if and while conditions (for example, move declarations out - of if conditions) - \li Modify strings (for example, set the encoding for a string to - Latin-1, mark strings translatable, and convert symbol names to - camel case) - \li Create variable declarations - \li Create function declarations and definitions - \endlist - - The following table summarizes the refactoring actions for C++ code. The - action is available when the cursor is in the position described in the - Activation column. - - \table - \header - \li Refactoring Action - \li Description - \li Activation - \row - \li Add Curly Braces - \li Adds curly braces to an if statement that does not contain a - compound statement. For example, rewrites - - \code - if (a) - b; - \endcode - - as - - \code - if (a) { - b; - } - \endcode - \li \c if - \row - \li Move Declaration out of Condition - \li Moves a declaration out of an if or while condition to simplify - the condition. For example, rewrites - - \code - if (Type name = foo()) {} - \endcode - - as - - \code - Type name = foo; - if (name) {} - \endcode - \li Name of the introduced variable - \row - \li Rewrite Condition Using || - \li Rewrites the expression according to De Morgan's laws. For - example, rewrites: - \code - !a && !b - \endcode - - as - - \code - !(a || b) - \endcode - \li \c && - \row - \li Rewrite Using \e operator - \li Rewrites an expression negating it and using the inverse - operator. For example, rewrites: - - \list - - \li \code - a op b - \endcode - - as - - \code - !(a invop b) - \endcode - - \li \code - (a op b) - \endcode - - as - - \code - !(a invop b) - \endcode - - \li \code - !(a op b) - \endcode - - as - - \code - (a invob b) - \endcode - - \endlist - - \li \c {<=}, \c {<}, \c {>}, \c {>=}, \c {==} or \c {!=} - \row - \li Split Declaration - \li Splits a simple declaration into several declarations. For - example, rewrites: - \code - int *a, b; - \endcode - - as - - \code - int *a; - int b; - \endcode - \li Type name or variable name - \row - \li Split if Statement - \li Splits an if statement into several statements. For example, - rewrites: - - \code - if (something && something_else) { - } - \endcode - - as - - \code - if (something) { - if (something_else) { - } - } - \endcode - - and - - \code - if (something || something_else) - x; - \endcode - - with - - \code - if (something) - x; - else if (something_else) - x; - \endcode - - \li \c && or \c || - \row - \li Swap Operands - \li Rewrites an expression in the inverse order using the inverse - operator. For example, rewrites: - \code - a op b - \endcode - - as - \code - b flipop a - \endcode - \li \c {<=}, \c {<}, \c {>}, \c {>=}, \c {==}, \c {!=}, \c {&&} - or \c {||} - \row - \li Convert to Decimal - \li Converts an integer literal to decimal representation - \li Numeric literal - \row - \li Convert to Hexadecimal - \li Converts an integer literal to hexadecimal representation - \li Numeric literal - \row - \li Convert to Octal - \li Converts an integer literal to octal representation - \li Numeric literal - \row - \li Convert to Objective-C String Literal - \li Converts a string literal to an Objective-C string literal if - the file type is Objective-C(++). For example, rewrites the - following strings - - \code - "abcd" - QLatin1String("abcd") - QLatin1Literal("abcd") - \endcode - - as - - \code - @"abcd" - \endcode - \li String literal - \row - \li Enclose in QLatin1Char() - \li Sets the encoding for a character to Latin-1, unless the - character is already enclosed in QLatin1Char, QT_TRANSLATE_NOOP, - tr, trUtf8, QLatin1Literal, or QLatin1String. For example, - rewrites - - \code - 'a' - \endcode - - as - - \code - QLatin1Char('a') - \endcode - \li String literal - \row - \li Enclose in QLatin1String() - \li Sets the encoding for a string to Latin-1, unless the string is - already enclosed in QLatin1Char, QT_TRANSLATE_NOOP, tr, trUtf8, - QLatin1Literal, or QLatin1String. For example, rewrites - \code - "abcd" - \endcode - - as - - \code - QLatin1String("abcd") - \endcode - - \li String literal - - \row - \li Mark as Translatable - \li Marks a string translatable. For example, rewrites \c "abcd" - with one of the following options, depending on which of them is - available: - - \code - tr("abcd") - QCoreApplication::translate("CONTEXT", "abcd") - QT_TRANSLATE_NOOP("GLOBAL", "abcd") - \endcode - - \li String literal - - \row - \li Add Definition in ... - \li Inserts a definition stub for a function declaration either in - the header file (inside or outside the class) or in the - implementation file. For free functions, inserts the definition - after the declaration of the function or in the implementation - file. Qualified names are minimized when possible, instead of - always being fully expanded. - - For example, rewrites - - \code - Class Foo { - void bar(); - }; - \endcode - - as (inside class) - - \code - Class Foo { - void bar() { - - } - }; - \endcode - - as (outside class) - - \code - Class Foo { - void bar(); - }; - - void Foo::bar() - { - - } - \endcode - - as (in implementation file) - - \code - // Header file - Class Foo { - void bar(); - }; - - // Implementation file - void Foo::bar() - { - - } - \endcode - - \li Function name - \row - \li Add \c Function Declaration - \li Inserts the member function declaration that matches the member - function definition into the class declaration. The function can - be \c {public}, \c {protected}, \c {private}, \c {public slot}, - \c {protected slot}, or \c {private slot}. - \li Function name - \row - \li Add Class Member - \li Adds a member declaration for the class member being - initialized if it is not yet declared. You must enter - the data type of the member. - \li Identifier - \row - \li Create Implementations for Member Functions - \li Creates implementations for all member functions in one go. - In the \uicontrol {Member Function Implementations} dialog, - you can specify whether the member functions are generated - inline or outside the class. - \li Function name - \row - \li Switch with Next/Previous Parameter - \li Moves a parameter down or up one position in a parameter list. - \li Parameter in the declaration or definition of a function - \row - \li Extract Function - \li Moves the selected code to a new function and replaces the block - of code with a call to the new function. Enter a name for the - function in the \uicontrol {Extract Function Refactoring} - dialog. - \li Block of code selected - \row - \li Extract Constant as Function Parameter - \li Replaces the selected literal and all its occurrences with the - function parameter \c{newParameter}. The parameter - \c{newParameter} will have the original literal as the default - value. - \li Block of code selected - \row - \li Add Local Declaration - \li Adds the type of an assignee, if the type of the right-hand - side of the assignment is known. For example, rewrites - - \code - a = foo(); - \endcode - - as - - \code - Type a = foo(); - \endcode - - where Type is the return type of \c {foo()} - - \li Assignee - - \row - \li Convert to Camel Case - \li Converts a symbol name to camel case, where elements of the name - are joined without delimiter characters and the initial - character of each element is capitalized. For example, rewrites - \c an_example_symbol as \c anExampleSymbol and - \c AN_EXAMPLE_SYMBOL as \c AnExampleSymbol - \li Identifier - \row - \li Complete Switch Statement - \li Adds all possible cases to a switch statement of the type - \c enum - \li \c switch - \row - \li Generate Missing Q_PROPERTY Members - \li Adds missing members to a \c Q_PROPERTY: - \list - \li \c read function - \li \c write function, if there is a WRITE - \li \c {onChanged} signal, if there is a NOTIFY - \li data member with the name \c {m_} - \endlist - \li \c Q_PROPERTY - \row - \li Apply Changes - \li Keeps function declarations and definitions synchronized by - checking for the matching declaration or definition when you - edit a function signature and by applying the changes to the - matching code. - \li Function signature. When this action is available, a light bulb - icon appears: \inlineimage refactormarker.png - \row - \li Add #include for undeclared or forward declared identifier - \li Adds an \c {#include} directive to the current file to make the - definition of a symbol available. - \li Undeclared identifier - \row - \li Add Forward Declaration - \li Adds a forward declaration for an undeclared identifier - operation. - \li Undeclared identifier - \row - \li Reformat Pointers or References - \li Reformats declarations with pointers or references according - to the code style settings for the current project. In case no - project is open, the current global code style settings are - used. - - For example, rewrites: - - \code - char*s; - \endcode - - as - - \code - char *s; - \endcode - - When applied to selections, all suitable declarations in the - selection are rewritten. - - \li Declarations with pointers or references and selections - containing such declarations - \row - \li Create Getter and Setter Member Functions - \li Creates either both getter and setter member functions for - member variables or only a getter or setter. - \li Member variable in class definition - \row - \li Generate Constructor - \li Creates a constructor for a class. - \li Class definition - \row - \li Move Function Definition - \li Moves a function definition to the implementation file, outside - the class or back to its declaration. For example, rewrites: - \code - class Foo - { - void bar() - { - // do stuff here - } - }; - \endcode - - as - \code - class Foo - { - void bar(); - }; - - void Foo::bar() { - // do stuff here - } - \endcode - - \li Function signature - \row - \li Move All Function Definitions - \li Moves all function definitions to the implementation file or - outside the class. For example, rewrites: - \code - class Foo - { - void bar() - { - // do stuff here - } - void baz() - { - // do stuff here - } - }; - \endcode - - as - - \code - class Foo - { - void bar(); - void baz(); - }; - - void Foo::bar() { - // do stuff here - } - - void Foo::baz() { - // do stuff here - } - \endcode - - \li Class name - \row - \li Assign to Local Variable - \li Adds a local variable which stores the return value of a - function call or a new expression. For example, rewrites: - - \code - QString s; - s.toLatin1(); - \endcode - - as - - \code - QString s; - QByteArray latin1 = s.toLatin1(); - \endcode - - and - - \code - new Foo; - \endcode - - as - - \code - Foo * localFoo = new Foo; - \endcode - - \li Function call or class name - \row - \li Insert Virtual Functions of Base Classes - \li Inserts declarations and the corresponding definitions inside or - outside the class or in an implementation file (if it exists). - For more information, see \l{Inserting Virtual Functions}. - \li Class or base class name - \row - \li Optimize for-Loop - \li Rewrites post increment operators as pre increment operators and - post decrement operators as pre decrement operators. It also - moves other than string or numeric literals and id expressions - from the condition of a for loop to its initializer. For - example, rewrites: - - \code - for (int i = 0; i < 3 * 2; i++) - \endcode - - as - - \code - for (int i = 0, total = 3 * 2; i < total; ++i) - \endcode - \li \c for - - \row - \li Escape String Literal as UTF-8 - \li Escapes non-ASCII characters in a string literal to hexadecimal - escape sequences. String Literals are handled as UTF-8. - \li String literal - - \row - \li Unescape String Literal as UTF-8 - \li Unescapes octal or hexadecimal escape sequences in a string - literal. String Literals are handled as UTF-8. - \li String literal - - \row - \li Convert to Stack Variable - \li Converts the selected pointer to a stack variable. For example, - rewrites: - - \code - QByteArray *foo = new QByteArray("foo"); - foo->append("bar"); - \endcode - - as - - \code - QByteArray foo("foo"); - foo.append("bar"); - \endcode - - This operation is limited to work only within function scope. - Also, the coding style for pointers and references is not - respected yet. - \li Pointer Variable - - \row - \li Convert to Pointer - \li Converts the selected stack variable to a pointer. For example, - rewrites: - - \code - QByteArray foo = "foo"; - foo.append("bar"); - \endcode - - as - - \code - QByteArray *foo = new QByteArray("foo"); - foo->append("bar"); - \endcode - - This operation is limited to work only within function scope. - Also, the coding style for pointers and references is not - respected yet. - \li Stack Variable - \row - \li Remove \c {using namespace} and Adjust Type Names Accordingly - \li Remove occurrences of \c {using namespace} in the local scope - and adjust type names accordingly. - \li \c using directive - \row - \li Remove All Occurrences of \c {using namespace} in Global Scope - and Adjust Type Names Accordingly - \li Remove all occurrences of \c {using namespace} in the global - scope and adjust type names accordingly. - \li \c using directive - \row - \li Convert connect() to Qt 5 Style - \li Converts a Qt 4 QObject::connect() to Qt 5 style. - \li QObject::connect() (Qt 4 style) - \endtable - - \section2 Refactoring QML Code - \endif - - You can apply the following types of refactoring actions to QML code: - - \list - \li Rename IDs - \li Split initializers - \li Move a QML type into a separate file to reuse it in other .qml files - \endlist - - The following table summarizes the refactoring actions for QML code. The - action is available when the cursor is in the position described in the - Activation column. - - \table - \header - \li Refactoring Action - \li Description - \li Activation - - \row - \li Move Component into Separate File - \li Moves a QML type into a separate file. Give the new component a - name and select whether properties are set for the new component - or for the original one. - - \image qtcreator-move-component-into-separate-file.png - - \li QML type name. This action is also available in the - \uicontrol {Form Editor} in the Design mode. - \row - \li Split Initializer - \li Reformats a one-line type into a multi-line type. For example, - rewrites - - \code - Item { x: 10; y: 20; width: 10 } - \endcode - - as - - \code - Item { - x: 10; - y: 20; - width: 10 - } - \endcode - - \li QML type property - \row - \li Wrap Component in Loader - \li Wraps the type in a Component type and loads it dynamically in a - Loader type. This is usually done to improve startup time. - \li QML type name - \row - \li Add a message suppression comment - \li Prepends the line with an annotation comment that stops the - message from being generated. - \li Error, warning or hint from static analysis - - \endtable */ diff --git a/doc/qtcreator/src/editors/creator-editors-options.qdoc b/doc/qtcreator/src/editors/creator-editors-options.qdoc index 317fe2dbcd4..d84ecc7f4da 100644 --- a/doc/qtcreator/src/editors/creator-editors-options.qdoc +++ b/doc/qtcreator/src/editors/creator-editors-options.qdoc @@ -32,7 +32,7 @@ /*! \page creator-editor-options.html \if defined(qtdesignstudio) - \previouspage creator-editor-refactoring.html + \previouspage creator-editor-quick-fixes.html \else \previouspage creator-beautifier.html \endif diff --git a/doc/qtcreator/src/editors/creator-only/creator-beautifier.qdoc b/doc/qtcreator/src/editors/creator-only/creator-beautifier.qdoc index 11727cb091e..f8699d0da24 100644 --- a/doc/qtcreator/src/editors/creator-only/creator-beautifier.qdoc +++ b/doc/qtcreator/src/editors/creator-only/creator-beautifier.qdoc @@ -30,7 +30,7 @@ // ********************************************************************** /*! - \previouspage creator-editor-refactoring.html + \previouspage creator-editor-quick-fixes.html \page creator-beautifier.html \nextpage creator-editor-options.html diff --git a/doc/qtcreator/src/editors/creator-quick-fixes.qdoc b/doc/qtcreator/src/editors/creator-quick-fixes.qdoc new file mode 100644 index 00000000000..8b1f056a118 --- /dev/null +++ b/doc/qtcreator/src/editors/creator-quick-fixes.qdoc @@ -0,0 +1,878 @@ +/**************************************************************************** +** +** Copyright (C) 2021 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the Qt Creator documentation. +** +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU Free Documentation License Usage +** Alternatively, this file may be used under the terms of the GNU Free +** Documentation License version 1.3 as published by the Free Software +** Foundation and appearing in the file included in the packaging of +** this file. Please review the following information to ensure +** the GNU Free Documentation License version 1.3 requirements +** will be met: https://www.gnu.org/licenses/fdl-1.3.html. +** +****************************************************************************/ + +/*! + \page creator-editor-quick-fixes.html + \previouspage creator-editor-refactoring.html + \if defined(qtdesignstudio) + \nextpage creator-editor-options.html + \else + \nextpage creator-beautifier.html + \endif + + \title Applying Refactoring Actions + + \QC allows you to quickly and conveniently apply actions (quick fixes) + to refactor your code by selecting them in a context menu. The actions + available depend on the position of the cursor in the code editor. + + \if defined(qtcreator) + To apply refactoring actions to C++ code, right-click an operand, + conditional statement, string, or name to open a context menu. + \endif + To apply refactoring actions to QML code, right-click an item ID or name. + + In the context menu, select \uicontrol {Refactoring} and then select a + refactoring action. + + You can also press \key {Alt+Enter} to open a context menu that contains + refactoring actions available in the current cursor position. + + \if defined(qtcreator) + \section1 Creating Functions + + You can apply refactoring actions to implement member functions, insert + virtual functions of base classes, create getter and setter functions, + and generate constructors. You can specify settings for generating the + functions either globally for all projects or separately for each project + in the \l{Specifying Settings}{build and run} settings of the project. + + \section2 Implementing Member Functions + + You can apply the \uicontrol {Create Implementations for Member Functions} + refactoring action to create implementations for all member functions in + one go. In the \uicontrol {Member Function Implementations} dialog, you can + specify whether the member functions are generated inline or outside the + class. + + \image qtcreator-refactoring-member-function-implementations.png "Implement Member Functions dialog" + + \section2 Inserting Virtual Functions + + You can apply the \uicontrol {Insert Virtual Functions of Base Classes} + refactoring action to insert declarations and the corresponding definitions + inside or outside the class or in an implementation file (if it exists). + + \image qtcreator-refactoring-virtual-function-dialog.png "Insert Virtual Functions dialog" + + Select the functions to insert in the list of available functions. You can + filter the list and hide reimplemented functions from it. + + You can add \e virtual or the \e override equivalent to the function + declaration. + + \section2 Creating Getters and Setters + + You can apply the \uicontrol {Create Getter and Setter Member Functions} + refactoring action to create either both getter and setter member functions + for member variables or only a getter or setter. + + \image qtcreator-refactoring-getters-and-setters.png "Getters and Setters dialog" + + \section2 Generating Constructors + + You can apply the \uicontrol {Generate Constructor} refactoring action to + create a public, protected, or private constructor for a class. Select the + class members to initialize in the constructor. Drag and drop the parameters + to specify their order in the constructor. + + \image qtcreator-refactoring-constructor.png "Constructor dialog" + + \section1 Specifying Settings for Refactoring Actions + + You can specify settings for the refactoring actions either globally for + all projects or separately for each project. To specify global options, + select \uicontrol Tools > \uicontrol Options > \uicontrol C++ > + \uicontrol {Quick Fixes}. + + To specify custom settings for a particular project, select + \uicontrol Projects > \uicontrol {Project Settings} > + \uicontrol {Quick Fixes} > \uicontrol {Custom Settings}. + + \image qtcreator-refactoring-options-locations.png "Quick Fixes settings" + + To revert to global settings, select \uicontrol {Reset to Global}. To + delete the custom settings, select \uicontrol {Delete Custom Settings File}. + + \section2 Function Locations + + In the \uicontrol {Generated Function Locations} group, you can determine + whether refactoring actions should generate getter and setter functions + in the header file (inside or outside the class) or in the implementation + file. + + \section2 Function Names and Attributes + + In the \uicontrol {Getter Setter Generation Properties} group, you can + specify additional settings for getter and setter names, attributes, and + parameters. You can specify that setter functions should be created as + \e slots and that signals should be generated with the new value as a + parameter. + + \image qtcreator-refactoring-options-generation.png "Getter and Setter generation settings" + + \section2 Namespace Handling + + In the \uicontrol {Missing Namespace Handling} group, select whether to + generate missing namespaces, add \c {using namespace} where necessary, or + rewrite types to match the existing namespaces. + + \image qtcreator-refactoring-options-namespaces.png "Namespace handling settings" + + \section2 Custom Parameter Types + + In the \uicontrol {Custom Getter Setter Templates} group, specify how the + code of a getter or setter function for a certain data type should look + like. This is necessary for types where assignment cannot use \c operator=, + as in the pre-defined settings for \c unique_ptr or where \c operator== is + not suitable for comparison, as in the pre-defined settings for + floating-point types. For example, if you have a special type \c MyClass, + you can specify that a function, \c myCompare, should be used for comparison + rather than the default of \c ==. + + To specify special handling for a custom parameter type, select + \uicontrol Add and set the parameter type, comparison, return expression, + and return type. In the \uicontrol {Return type} field, you can use \c + and \c to access the parameter and current value. Use \c to + access the type and \c for the template parameter. + + \image qtcreator-refactoring-options-templates.png "Settings for handling custom parameter types" + + Usually, arguments are passed by using a \c const reference. To pass + arguments of a particular type as values, list them in the + \uicontrol {Value types} field. Namespaces and template arguments are + removed. The real Type must contain the given Type. For example, \c int + matches \c int32_t but not \c vector, and \c vector matches + \c {std::pmr::vector} but not \c {std::optional>}. + \endif + + \section1 Summary of Refactoring Actions + + \if defined(qtcreator) + If you use the \l{Parsing C++ Files with the Clang Code Model} + {Clang code model} to parse the C++ files, the + \l{http://clang.llvm.org/diagnostics.html}{Clang fix-it hints} + that have been integrated into \QC are also available to you. In addition to + the standard ways of activating refactoring actions, you can select the + actions that are applicable on a line in the context menu in the left margin + of the code editor. + + \section2 Refactoring C++ Code + + You can apply the following types of refactoring actions to C++ code: + + \list + \li Change binary operands + \li Simplify if and while conditions (for example, move declarations out + of if conditions) + \li Modify strings (for example, set the encoding for a string to + Latin-1, mark strings translatable, and convert symbol names to + camel case) + \li Create variable declarations + \li Create function declarations and definitions + \endlist + + The following table summarizes the refactoring actions for C++ code. The + action is available when the cursor is in the position described in the + Activation column. + + \table + \header + \li Refactoring Action + \li Description + \li Activation + \row + \li Add Curly Braces + \li Adds curly braces to an if statement that does not contain a + compound statement. For example, rewrites + + \code + if (a) + b; + \endcode + + as + + \code + if (a) { + b; + } + \endcode + \li \c if + \row + \li Move Declaration out of Condition + \li Moves a declaration out of an if or while condition to simplify + the condition. For example, rewrites + + \code + if (Type name = foo()) {} + \endcode + + as + + \code + Type name = foo; + if (name) {} + \endcode + \li Name of the introduced variable + \row + \li Rewrite Condition Using || + \li Rewrites the expression according to De Morgan's laws. For + example, rewrites: + \code + !a && !b + \endcode + + as + + \code + !(a || b) + \endcode + \li \c && + \row + \li Rewrite Using \e operator + \li Rewrites an expression negating it and using the inverse + operator. For example, rewrites: + + \list + + \li \code + a op b + \endcode + + as + + \code + !(a invop b) + \endcode + + \li \code + (a op b) + \endcode + + as + + \code + !(a invop b) + \endcode + + \li \code + !(a op b) + \endcode + + as + + \code + (a invob b) + \endcode + + \endlist + + \li \c {<=}, \c {<}, \c {>}, \c {>=}, \c {==} or \c {!=} + \row + \li Split Declaration + \li Splits a simple declaration into several declarations. For + example, rewrites: + \code + int *a, b; + \endcode + + as + + \code + int *a; + int b; + \endcode + \li Type name or variable name + \row + \li Split if Statement + \li Splits an if statement into several statements. For example, + rewrites: + + \code + if (something && something_else) { + } + \endcode + + as + + \code + if (something) { + if (something_else) { + } + } + \endcode + + and + + \code + if (something || something_else) + x; + \endcode + + with + + \code + if (something) + x; + else if (something_else) + x; + \endcode + + \li \c && or \c || + \row + \li Swap Operands + \li Rewrites an expression in the inverse order using the inverse + operator. For example, rewrites: + \code + a op b + \endcode + + as + \code + b flipop a + \endcode + \li \c {<=}, \c {<}, \c {>}, \c {>=}, \c {==}, \c {!=}, \c {&&} + or \c {||} + \row + \li Convert to Decimal + \li Converts an integer literal to decimal representation + \li Numeric literal + \row + \li Convert to Hexadecimal + \li Converts an integer literal to hexadecimal representation + \li Numeric literal + \row + \li Convert to Octal + \li Converts an integer literal to octal representation + \li Numeric literal + \row + \li Convert to Objective-C String Literal + \li Converts a string literal to an Objective-C string literal if + the file type is Objective-C(++). For example, rewrites the + following strings + + \code + "abcd" + QLatin1String("abcd") + QLatin1Literal("abcd") + \endcode + + as + + \code + @"abcd" + \endcode + \li String literal + \row + \li Enclose in QLatin1Char() + \li Sets the encoding for a character to Latin-1, unless the + character is already enclosed in QLatin1Char, QT_TRANSLATE_NOOP, + tr, trUtf8, QLatin1Literal, or QLatin1String. For example, + rewrites + + \code + 'a' + \endcode + + as + + \code + QLatin1Char('a') + \endcode + \li String literal + \row + \li Enclose in QLatin1String() + \li Sets the encoding for a string to Latin-1, unless the string is + already enclosed in QLatin1Char, QT_TRANSLATE_NOOP, tr, trUtf8, + QLatin1Literal, or QLatin1String. For example, rewrites + \code + "abcd" + \endcode + + as + + \code + QLatin1String("abcd") + \endcode + + \li String literal + + \row + \li Mark as Translatable + \li Marks a string translatable. For example, rewrites \c "abcd" + with one of the following options, depending on which of them is + available: + + \code + tr("abcd") + QCoreApplication::translate("CONTEXT", "abcd") + QT_TRANSLATE_NOOP("GLOBAL", "abcd") + \endcode + + \li String literal + + \row + \li Add Definition in ... + \li Inserts a definition stub for a function declaration either in + the header file (inside or outside the class) or in the + implementation file. For free functions, inserts the definition + after the declaration of the function or in the implementation + file. Qualified names are minimized when possible, instead of + always being fully expanded. + + For example, rewrites + + \code + Class Foo { + void bar(); + }; + \endcode + + as (inside class) + + \code + Class Foo { + void bar() { + + } + }; + \endcode + + as (outside class) + + \code + Class Foo { + void bar(); + }; + + void Foo::bar() + { + + } + \endcode + + as (in implementation file) + + \code + // Header file + Class Foo { + void bar(); + }; + + // Implementation file + void Foo::bar() + { + + } + \endcode + + \li Function name + \row + \li Add \c Function Declaration + \li Inserts the member function declaration that matches the member + function definition into the class declaration. The function can + be \c {public}, \c {protected}, \c {private}, \c {public slot}, + \c {protected slot}, or \c {private slot}. + \li Function name + \row + \li Add Class Member + \li Adds a member declaration for the class member being + initialized if it is not yet declared. You must enter + the data type of the member. + \li Identifier + \row + \li Create Implementations for Member Functions + \li Creates implementations for all member functions in one go. + In the \uicontrol {Member Function Implementations} dialog, + you can specify whether the member functions are generated + inline or outside the class. + \li Function name + \row + \li Switch with Next/Previous Parameter + \li Moves a parameter down or up one position in a parameter list. + \li Parameter in the declaration or definition of a function + \row + \li Extract Function + \li Moves the selected code to a new function and replaces the block + of code with a call to the new function. Enter a name for the + function in the \uicontrol {Extract Function Refactoring} + dialog. + \li Block of code selected + \row + \li Extract Constant as Function Parameter + \li Replaces the selected literal and all its occurrences with the + function parameter \c{newParameter}. The parameter + \c{newParameter} will have the original literal as the default + value. + \li Block of code selected + \row + \li Add Local Declaration + \li Adds the type of an assignee, if the type of the right-hand + side of the assignment is known. For example, rewrites + + \code + a = foo(); + \endcode + + as + + \code + Type a = foo(); + \endcode + + where Type is the return type of \c {foo()} + + \li Assignee + + \row + \li Convert to Camel Case + \li Converts a symbol name to camel case, where elements of the name + are joined without delimiter characters and the initial + character of each element is capitalized. For example, rewrites + \c an_example_symbol as \c anExampleSymbol and + \c AN_EXAMPLE_SYMBOL as \c AnExampleSymbol + \li Identifier + \row + \li Complete Switch Statement + \li Adds all possible cases to a switch statement of the type + \c enum + \li \c switch + \row + \li Generate Missing Q_PROPERTY Members + \li Adds missing members to a \c Q_PROPERTY: + \list + \li \c read function + \li \c write function, if there is a WRITE + \li \c {onChanged} signal, if there is a NOTIFY + \li data member with the name \c {m_} + \endlist + \li \c Q_PROPERTY + \row + \li Apply Changes + \li Keeps function declarations and definitions synchronized by + checking for the matching declaration or definition when you + edit a function signature and by applying the changes to the + matching code. + \li Function signature. When this action is available, a light bulb + icon appears: \inlineimage refactormarker.png + \row + \li Add #include for undeclared or forward declared identifier + \li Adds an \c {#include} directive to the current file to make the + definition of a symbol available. + \li Undeclared identifier + \row + \li Add Forward Declaration + \li Adds a forward declaration for an undeclared identifier + operation. + \li Undeclared identifier + \row + \li Reformat Pointers or References + \li Reformats declarations with pointers or references according + to the code style settings for the current project. In case no + project is open, the current global code style settings are + used. + + For example, rewrites: + + \code + char*s; + \endcode + + as + + \code + char *s; + \endcode + + When applied to selections, all suitable declarations in the + selection are rewritten. + + \li Declarations with pointers or references and selections + containing such declarations + \row + \li Create Getter and Setter Member Functions + \li Creates either both getter and setter member functions for + member variables or only a getter or setter. + \li Member variable in class definition + \row + \li Generate Constructor + \li Creates a constructor for a class. + \li Class definition + \row + \li Move Function Definition + \li Moves a function definition to the implementation file, outside + the class or back to its declaration. For example, rewrites: + \code + class Foo + { + void bar() + { + // do stuff here + } + }; + \endcode + + as + \code + class Foo + { + void bar(); + }; + + void Foo::bar() { + // do stuff here + } + \endcode + + \li Function signature + \row + \li Move All Function Definitions + \li Moves all function definitions to the implementation file or + outside the class. For example, rewrites: + \code + class Foo + { + void bar() + { + // do stuff here + } + void baz() + { + // do stuff here + } + }; + \endcode + + as + + \code + class Foo + { + void bar(); + void baz(); + }; + + void Foo::bar() { + // do stuff here + } + + void Foo::baz() { + // do stuff here + } + \endcode + + \li Class name + \row + \li Assign to Local Variable + \li Adds a local variable which stores the return value of a + function call or a new expression. For example, rewrites: + + \code + QString s; + s.toLatin1(); + \endcode + + as + + \code + QString s; + QByteArray latin1 = s.toLatin1(); + \endcode + + and + + \code + new Foo; + \endcode + + as + + \code + Foo * localFoo = new Foo; + \endcode + + \li Function call or class name + \row + \li Insert Virtual Functions of Base Classes + \li Inserts declarations and the corresponding definitions inside or + outside the class or in an implementation file (if it exists). + For more information, see \l{Inserting Virtual Functions}. + \li Class or base class name + \row + \li Optimize for-Loop + \li Rewrites post increment operators as pre increment operators and + post decrement operators as pre decrement operators. It also + moves other than string or numeric literals and id expressions + from the condition of a for loop to its initializer. For + example, rewrites: + + \code + for (int i = 0; i < 3 * 2; i++) + \endcode + + as + + \code + for (int i = 0, total = 3 * 2; i < total; ++i) + \endcode + \li \c for + + \row + \li Escape String Literal as UTF-8 + \li Escapes non-ASCII characters in a string literal to hexadecimal + escape sequences. String Literals are handled as UTF-8. + \li String literal + + \row + \li Unescape String Literal as UTF-8 + \li Unescapes octal or hexadecimal escape sequences in a string + literal. String Literals are handled as UTF-8. + \li String literal + + \row + \li Convert to Stack Variable + \li Converts the selected pointer to a stack variable. For example, + rewrites: + + \code + QByteArray *foo = new QByteArray("foo"); + foo->append("bar"); + \endcode + + as + + \code + QByteArray foo("foo"); + foo.append("bar"); + \endcode + + This operation is limited to work only within function scope. + Also, the coding style for pointers and references is not + respected yet. + \li Pointer Variable + + \row + \li Convert to Pointer + \li Converts the selected stack variable to a pointer. For example, + rewrites: + + \code + QByteArray foo = "foo"; + foo.append("bar"); + \endcode + + as + + \code + QByteArray *foo = new QByteArray("foo"); + foo->append("bar"); + \endcode + + This operation is limited to work only within function scope. + Also, the coding style for pointers and references is not + respected yet. + \li Stack Variable + \row + \li Remove \c {using namespace} and Adjust Type Names Accordingly + \li Remove occurrences of \c {using namespace} in the local scope + and adjust type names accordingly. + \li \c using directive + \row + \li Remove All Occurrences of \c {using namespace} in Global Scope + and Adjust Type Names Accordingly + \li Remove all occurrences of \c {using namespace} in the global + scope and adjust type names accordingly. + \li \c using directive + \row + \li Convert connect() to Qt 5 Style + \li Converts a Qt 4 QObject::connect() to Qt 5 style. + \li QObject::connect() (Qt 4 style) + \endtable + + \section2 Refactoring QML Code + \endif + + You can apply the following types of refactoring actions to QML code: + + \list + \li Rename IDs + \li Split initializers + \li Move a QML type into a separate file to reuse it in other .qml files + \endlist + + The following table summarizes the refactoring actions for QML code. The + action is available when the cursor is in the position described in the + Activation column. + + \table + \header + \li Refactoring Action + \li Description + \li Activation + + \row + \li Move Component into Separate File + \li Moves a QML type into a separate file. Give the new component a + name and select whether properties are set for the new component + or for the original one. + + \image qtcreator-move-component-into-separate-file.png + + \li QML type name. This action is also available in the + \uicontrol {Form Editor} in the Design mode. + \row + \li Split Initializer + \li Reformats a one-line type into a multi-line type. For example, + rewrites + + \code + Item { x: 10; y: 20; width: 10 } + \endcode + + as + + \code + Item { + x: 10; + y: 20; + width: 10 + } + \endcode + + \li QML type property + \row + \li Wrap Component in Loader + \li Wraps the type in a Component type and loads it dynamically in a + Loader type. This is usually done to improve startup time. + \li QML type name + \row + \li Add a message suppression comment + \li Prepends the line with an annotation comment that stops the + message from being generated. + \li Error, warning or hint from static analysis + + \endtable + */ diff --git a/doc/qtcreator/src/projects/creator-only/creator-projects-settings-overview.qdoc b/doc/qtcreator/src/projects/creator-only/creator-projects-settings-overview.qdoc index 2d24ffcd4cb..935c52d8947 100644 --- a/doc/qtcreator/src/projects/creator-only/creator-projects-settings-overview.qdoc +++ b/doc/qtcreator/src/projects/creator-only/creator-projects-settings-overview.qdoc @@ -115,6 +115,8 @@ \li \l{Parsing C++ Files with the Clang Code Model} {Clang Code Model} + \li \l{Applying Refactoring Actions}{Quick Fixes} + \li \l{Using Clang Tools}{Clang Tools} \li \l{To-Do Entries}{To-Do} (experimental) diff --git a/doc/qtcreator/src/qtcreator-toc.qdoc b/doc/qtcreator/src/qtcreator-toc.qdoc index 2668c43b0b7..e4fa3fdc18b 100644 --- a/doc/qtcreator/src/qtcreator-toc.qdoc +++ b/doc/qtcreator/src/qtcreator-toc.qdoc @@ -215,6 +215,7 @@ \li \l{Searching with the Locator} \endlist \li \l{Refactoring} + \li \l{Applying Refactoring Actions} \li \l{Beautifying Source Code} \li \l{Configuring the Editor} \list diff --git a/doc/qtdesignstudio/src/qtdesignstudio-toc.qdoc b/doc/qtdesignstudio/src/qtdesignstudio-toc.qdoc index fa6da97cc93..32896b6185f 100644 --- a/doc/qtdesignstudio/src/qtdesignstudio-toc.qdoc +++ b/doc/qtdesignstudio/src/qtdesignstudio-toc.qdoc @@ -191,6 +191,7 @@ \li \l{Searching with the Locator} \endlist \li \l{Refactoring} + \li \l{Applying Refactoring Actions} \li \l{Configuring the Editor} \list \li \l{Specifying Text Editor Settings}