Qt Creator `.pro.shared` 文件似乎没有任何效果 [英] Qt Creator `.pro.shared` files don't seem to have any effect
问题描述
我在 Mac OS 10.8.2 上使用 Qt Creator 2.6.0,并且我在 myproject.pro<所在的文件夹中创建了一个
myproject.pro.shared
文件/代码>.我从 https://qt-project 复制了示例 XML.org/doc/qtcreator-2.6/creator-sharing-project-settings.html 到 myproject.pro.shared
文件.我删除了 ~/.config/QtProject/
文件夹,但我没有 myproject.pro.user
文件.
I'm using Qt Creator 2.6.0 on Mac OS 10.8.2, and I've created a myproject.pro.shared
file in the same folder as myproject.pro
. I copied the example XML from https://qt-project.org/doc/qtcreator-2.6/creator-sharing-project-settings.html to the myproject.pro.shared
file. I deleted my ~/.config/QtProject/
folder and I do not have a myproject.pro.user
file.
当我启动 Qt Creator 并打开项目文件时,没有使用 myproject.pro.shared
中指定的设置.例如,myproject.pro.shared
指定 TabSize
为 14,但在项目 > 编辑器下,编辑器设置"仍然显示全局",并且选项卡大小不是 14.
When I launch Qt Creator and open the project file, the settings specified in myproject.pro.shared
are not used. For example, myproject.pro.shared
specifies TabSize
of 14, yet under Projects > Editor, "Editor settings" still says "Global", and Tab size is not 14.
我怎样才能让它工作,以便在我第一次在新工作站上打开一个项目时填充默认设置?
How can I get this working, so that default settings are populated the first time I open a project on a new workstation?
推荐答案
我错过了这一行:
<value type="bool" key="EditorConfiguration.UseGlobal">false</value>
添加后,Qt Creator 默认使用具有正确设置的自定义配置.
After adding it, Qt Creator defaults to use the custom configuration with the correct settings.
这是我的工作,带注释的 .pro.shared
文件:
Here's my working, annotated .pro.shared
file:
<?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>
这篇关于Qt Creator `.pro.shared` 文件似乎没有任何效果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!