[Qt-creator] Settings for naming conventions

Jochen Becher jochen_becher at gmx.de
Thu Jan 14 20:57:53 CET 2016

Hi Nikolai,

the solution you prefer (= my first proposal) is of course the easiest
implementation. I only wondered if naming conventions is really related
that much to coding style (which is more about whitespaces and
indentation) that we want to handle it with the same settings class.

So I will go for your proposal.

Thank you, Jochen

Am Mittwoch, den 13.01.2016, 13:19 +0100 schrieb Nikolai Kosjar:
> Hi again,
> let me enumerate your requirements and propose something addressing
> those.
> Requirements:
>   R1. Global and per project settings
>   R2. API working on those settings, converting names
>   R3. Settings/API used by:
>      - Wizards
>      - Refactoring Code
>      - Text Editor to validate identifiers
> Proposal:
> Enhance CppTools::CppCodeStyleSettings with the specific C++ settings
> you need. This is fine since naming conventions are usually part of 
> coding styles/rules. This does not introduces anything in the text 
> editor, but uses the infrastructure that is provided by it and the 
> project explorer (CppCodeStyleSettings are managed by 
> CppCodeStylePreferences, which is a
> TextEditor::ICodeStylePreferences). 
> Thus, you get R1 for free.
> For R2, just introduce and export your new class in cpptools. This
> class 
> uses CppTools::CppCodeStyleSettings.
> Regarding R3:
> CppCodeStyleSettings is already exported and can be used.
> * Wizards - The plugins of the wizard that wants to use the
> settings/api 
> obviously needs to depend on cpptools. Is this a problem for the
> wizards 
> you had in mind?
> * Refactoring Code - No problem since this is already in cpptools 
> itself. qmljstools depends on cpptools and thus could also access the
> settings.
> * Text Editor to validate identifiers - A virtual function in e.g. 
> TextEditorWidget could serve this? And the specific editors have
> access 
> to their settings.
> Something along the lines could also be done for QML/JS or other 
> languages (e.g. in the projects mode you can already switch the
> language 
> for the coding style).
> Would this work?
> Nikolai

More information about the Qt-creator mailing list