2012-12-18 116 views
4

我在Mac OS 10.8.2上使用Qt Creator 2.6.0,並且我在與myproject.pro相同的文件夾中創建了一個myproject.pro.shared文件。我將示例XML從https://qt-project.org/doc/qtcreator-2.6/creator-sharing-project-settings.html複製到myproject.pro.shared文件。我刪除了我的~/.config/QtProject/文件夾,我沒有myproject.pro.user文件。Qt Creator`.pro.shared`文件似乎沒有任何效果

當我啓動Qt Creator並打開項目文件時,不使用myproject.pro.shared中指定的設置。例如,myproject.pro.shared指定的14 TabSize,但在項目>編輯器中,「編輯器設置」還稱「全球通」,並且標籤大小不是14

我怎樣才能得到這個工作,所以默認設置填充我第一次在新工作站上打開一個項目?

回答

5

我錯過了這條線:

<value type="bool" key="EditorConfiguration.UseGlobal">false</value> 

加入它,Qt Creator的默認使用的自定義配置與正確設置後。

這是我的工作,註釋.pro.shared文件:

<?xml version="1.0" encoding="UTF-8"?> 
<!DOCTYPE QtCreatorProject> 
<qtcreator> 
    <data> 
     <variable>ProjectExplorer.Project.Updater.FileVersion</variable> 
     <value type="int">12</value> 
    </data> 

    <!-- "Projects > Editor" tab --> 
    <data> 
     <variable>ProjectExplorer.Project.EditorSettings</variable> 
     <valuemap type="QVariantMap"> 
      <value type="bool" key="EditorConfiguration.UseGlobal">false</value> 

      <!-- "Tabs And Indentation" section --> 
      <value type="bool" key="EditorConfiguration.SpacesForTabs">false</value> 
      <value type="bool" key="EditorConfiguration.AutoSpacesForTabs">false</value> 
      <value type="int" key="EditorConfiguration.TabSize">4</value> 
      <value type="int" key="EditorConfiguration.IndentSize">4</value> 
      <value type="int" key="EditorConfiguration.PaddingMode">2</value> <!-- 0="Not At All", 1="With Spaces", 2="With Regular Indent" --> 

      <!-- "Typing" section --> 
      <value type="bool" key="EditorConfiguration.AutoIndent">true</value> 
      <value type="int" key="EditorConfiguration.SmartBackspaceBehavior">0</value> <!-- 0="None", 1="Follows Previous Indents", 2="Unindents" --> 
      <value type="int" key="EditorConfiguration.TabKeyBehavior">0</value> <!-- 0="Never", 1="Always", 2="In Leading White Space" --> 

      <!-- "Cleanups Upon Saving" section --> 
      <value type="bool" key="EditorConfiguration.cleanWhitespace">true</value> 
      <value type="bool" key="EditorConfiguration.inEntireDocument">true</value> 
      <value type="bool" key="EditorConfiguration.cleanIndentation">true</value> 
      <value type="bool" key="EditorConfiguration.addFinalNewLine">true</value> 

      <!-- "File Encodings" section --> 
      <value type="QByteArray" key="EditorConfiguration.Codec">UTF-8</value> 
      <value type="int" key="EditorConfiguration.Utf8BomBehavior">1</value> <!-- 0="Add If Encoding Is UTF-8", 1="Keep If Already Present", 2="Always Delete" --> 

      <!-- "Mouse and Keyboard" section --> 
      <value type="bool" key="EditorConfiguration.MouseNavigation">true</value> 
      <value type="bool" key="EditorConfiguration.ScrollWheelZooming">false</value> 
      <value type="bool" key="EditorConfiguration.CamelCaseNavigation">true</value> 
      <value type="bool" key="EditorConfiguration.ConstrainTooltips">false</value> 
      <value type="bool" key="EditorConfiguration.KeyboardTooltips">false</value> 
     </valuemap> 
    </data> 
</qtcreator> 
相關問題