[Qt-creator] .pro.shared indentation settings overwritten by c++ and qt quick global settings.

Ziller Eike Eike.Ziller at digia.com
Fri Oct 4 09:29:31 CEST 2013


On 03.10.2013, at 09:04, Joseph Crowell <joseph.w.crowell at gmail.com> wrote:

> I managed to get a .pro.shared file working with the correct indentation 
> settings for my project.
> 
> The settings are loaded in to the project settings for everyone. Then I 
> realized someone added the shiny new C++ and Qt Quick indentation 
> settings

In Qt Creator 2.3, September 2011, just for the record :)

> which overwrites the project settings completely. They decided 
> to store those settings outside the xml so they can't be included in the 
> .pro.shared file. How do I get indentation settings uploaded to our git 
> repository now? All our coders need to have the same indentation 
> settings so that our diff viewers behave properly. Every time a new 
> coder comes along, they use the spaces for tabs default because they 
> don't know any better. The .pro.shared seemed like a solution until I 
> realized someone came along and made it useless in your code.

As it is now, you can only add the xml file to your repositories, and make your coders drop this file into
~/.config/QtProject/qtcreator/codestyles/ before opening your project.
And have the corresponding lines in the 

 <data>
  <variable>ProjectExplorer.Project.EditorSettings</variable>
  <valuemap type="QVariantMap">
   <valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.0">
    <value type="QString" key="language">Cpp</value>
    <valuemap type="QVariantMap" key="value">
     <value type="QByteArray" key="CurrentPreferences">mycodestyle</value>
    </valuemap>
[…]

section (where mycodestyle is the name of the xml without .xml as far as I understand it).

There had been some thoughts to allow projects to have their own additional configuration path. The problem is not restricted to coding style settings, there are many other things projects might want to provide, e.g. snippets, special highlighting files, additional types for debug-pretty-printing, external tools, file and project templates … I could probably find a few more. (QTCREATORBUG-7655 specifically mentions wizards). Nothing in that regard has been implemented though.

Br, Eike

-- 
Eike Ziller, Senior Software Engineer - Digia, Qt
 
Digia Germany GmbH, Rudower Chaussee 13, D-12489 Berlin
Geschäftsführer: Mika Pälsi, Juha Varelius, Anja Wasenius
Sitz der Gesellschaft: Berlin, Registergericht: Amtsgericht Charlottenburg, HRB 144331 B




More information about the Qt-creator mailing list