Change code style for C++
hello, i use qt sdk 1.2 and i have a question, how do i change the code style for c++? I can't find "advanced" functions or options to do it in Qt creator, it just shows indent or not a bracket or something like that, i dont like this:
Code:
void method()
{
//code
}
or
Code:
myClass::myClass()
: var(value)
{
//code
}
i prefer
Code:
myClass::myClass() : var(value) {
//code
}
i'm talking about creating a new class or using "refactor" to add a definition, i know i can type my code using my favorite style but i don't want to do it manually when creating a class or something like that
thanks
Re: Change code style for C++
See the 'Settings' dialog, the "C++" pane. Click on "Edit" and have fun.
Re: Change code style for C++
Quote:
Originally Posted by
wysota
See the 'Settings' dialog, the "C++" pane. Click on "Edit" and have fun.
Apologies for the thread necromancy, but since I don't see this discussed anywhere else: the code style options in Qt Creator (at least as of Qt Creator 2.4.1) don't offer any obvious way to place braces on the same line as the method signature ("K&R style") as the OP requested. They also don't offer options for the binding of asterisks and ampersands (const Foo& bar vs. const Foo &bar), use of NULL vs. 0, and a number of other things that I have to correct every time Creator makes a new class boilerplate. Am I missing something? If not, do you know if there are plans to expand these options in the future?
Re: Change code style for C++
Much has changed since then. I don't see those options anywhere either.