Suppose I am creating the following function:
double f(double const& x) { return x + x; }
This is how I like to place the const
modifier, not like const double
. However, Qt Creator automatically places it in the other position. For example, if I declared the above function in a header file, and then use Qt Creator refactor tools to automatically add a definition in the .cpp file, I'll get const
placed in the wrong place, and the &
will be next to the variable, which I also don't like:
double f(const double &x) { return x + x; }
How can I modify this default behavior in Qt Creator?
C++ -> Code Style -> <Select a code style> -> Edit... -> Pointers and References
. Edit as you please. Also note that this may be overriden on a per-project basis; Look also at the per-project settings, there's a roughly analogous panel. Per-project settings will override the global setting. – Mennonite*
and&
to the type instead of the identifier. However, I do not see an option to change theconst
placement? – BroiderC++ -> Code Style
is the place to dig in, if it's at all possible. – Mennonite