Creator: How to configure "Complete switch statement"?
-
Hi all,
I find fixes such as "complete switch statement" extremely useful. However, in the end I spend as much time formatting the result according to my coding standards as I would have writing the case statements myself.
How and where can I configure such "quick fixes"? -
@Asperamanca To my knowledge QtCreator uses templates for such things, but I don't remember where those are located. Search for them and edit the one you want to change.
-
@jsulm
I think what you refer to are snippets, which can be edited under Text Editor -> Snippets
I haven't found any plain text file containing a relevant phrase from the quick fix, which suggests that these are hard-coded somewhere. -
@Asperamanca
I cannot remember exactly where it is. But you can alter the style/layout of things like aswitch()
statement, though only to a limited extent. It is somewhere in your "C++ style settings" in Creator. It shows you howswitch
/if
etc. constructs will be created. -
@JonB @Asperamanca Yes, it is in "C++/Code Style". Make a copy of the current style and go to "Edit...".
-
@Asperamanca said in Creator: How to configure "Complete switch statement"?:
each case scoped by curly brackets
Yeah, it only has some limited layout alterations.
I do this now, but only if I find I need to declare any variables in the particularcase
clause.