[Qt-creator] Editor style setting for a submodule (+EditorConfig)
mike.jackson at bluequartz.net
Mon Mar 4 20:19:35 CET 2019
Thanks for the heads up with the ClangFormat plugin. We have a .clangformat in each of our repos and this already provide quite useful.
Michael Jackson | Owner, President
[e] mike.jackson at bluequartz.net
[w] www.bluequartz.net <http://www.bluequartz.net>
On 3/4/19, 3:01 AM, "Qt-creator on behalf of Eike Ziller" <qt-creator-bounces at qt-project.org on behalf of Eike.Ziller at qt.io> wrote:
> On 3. Mar 2019, at 19:38, Andy <asmaloney at gmail.com> wrote:
> Is there a way to have two different editor style settings - one for the main project and one for a submodule?
> Use-case: I have my own code in a submodule (lib) within a project that's "not mine". (Using cmake.) When editing in the main project I want to use its style, but when I edit my own code I want it in my style...
> Right now everything uses the main project's style.
> Secondary question: is there a way to persist styles in a repo so everyone uses the same settings? Preferably using a "standard" like EditorConfig so that non QtC-users can participate as well?
I’d try enabling the Beautifier plugin and using one of the code styling tools that it supports (clang-format, astyle, uncrustify). You can check the format definitions for these into the repo, and Qt Creator should take the first definition it finds in the parent folder hierarchy (or at least can be configured to do so).
Creating the definition files for these is up to you though.
Also, these are not used for formatting while typing, only on saving or explicit request. Except if you use clang-format and try the new experimental ClangFormat plugin (instead of Beautifier), which has the feature of formatting while typing in Qt Creator 4.9.
> I don't see anything here:
> Andy Maloney // https://asmaloney.com
> twitter ~ @asmaloney
> Qt-creator mailing list
> Qt-creator at qt-project.org
Principal Software Engineer
The Qt Company GmbH
Rudower Chaussee 13
eike.ziller at qt.io
Geschäftsführer: Mika Pälsi,
Juha Varelius, Mika Harjuaho
Sitz der Gesellschaft: Berlin, Registergericht: Amtsgericht Charlottenburg, HRB 144331 B
Qt-creator mailing list
Qt-creator at qt-project.org
More information about the Qt-creator