Share project settings | Qt Creator Documentation

- Qt Creator Documentation
- Share project settings
- Qt Creator 19.0.1

Override CMake settings for a project ◦ Specify Clang tools settings

# Share project settings

Qt Creator stores user-specific project settings in a `.user` file located in a directory .qtcreator/ under the project directory. You can share these settings between several projects as a `.shared` file (such as, `CMakeLists.txt.shared`, `qtcreator.pro.shared`, or `qtcreator.qbs.shared`). It has the same XML structure as a `.user` file, but only has the settings to share.

To share CMake project settings, use CMake presets or a `CMakeLists.txt.shared` file.

## Create a shared settings file

The easiest way to create a `.shared` file is to copy settings from the `.user` file. Typically, you would share some of the values in the `ProjectExplorer.Project.EditorSettings` section.

Note: You must always specify the `ProjectExplorer.Project.Updater.FileVersion` variable and use the same value for it as in the `.user` file.

You can then deliver the `.shared` file to other developers or copy it to other development PCs.

The following is an example of a `.shared` file:

     <?xml version="1.0" encoding="UTF-8"?>
     <!DOCTYPE QtCreatorProject>
     <qtcreator>
         <data>
             <variable>ProjectExplorer.Project.EditorSettings</variable>
             <valuemap type="QVariantMap">
                 <value type="bool" key="EditorConfiguration.SpacesForTabs">true</value>
                 <value type="bool" key="EditorConfiguration.AutoSpacesForTabs">false</value>
                 <value type="int" key="EditorConfiguration.TabSize">14</value>
                 <value type="int" key="EditorConfiguration.IndentSize">4</value>
             </valuemap>
         </data>
         <data>
             <variable>ProjectExplorer.Project.Updater.FileVersion</variable>
             <value type="int">10</value>
         </data>
     </qtcreator>

## Update shared settings

The first time Qt Creator loads the project after you add shared settings, it overwrites the user settings with them. If you open the project for the first time and Qt Creator has not created a `.user` file, the settings in the `.shared` file take effect immediately.

If you receive a `.shared` file and do not want to use a particular setting in it, you can change it. Qt Creator marks it a sticky setting. The next time you open a project, the setting is not updated. Qt Creator tracks sticky settings in the `.user` file and removes the mark if the values in the user and shared files eventually become identical. This is to avoid a permanent sticky setting that was created just because you wanted to try something out.

## Share CMake project settings

The following is an example of a `CMakeLists.txt.shared` file:

     <?xml version="1.0" encoding="UTF-8"?>
     <!DOCTYPE QtCreatorProject>
     <qtcreator>
      <data>
       <variable>ProjectExplorer.Project.PluginSettings</variable>
        <valuemap type="QVariantMap">
         <valuemap type="QVariantMap" key="CMakeSpecificSettings">
           <value type="bool" key="AskBeforePresetsReload">false</value>
           <value type="bool" key="AskReConfigureInitialParams">false</value>
           <value type="bool" key="AutorunCMake">false</value>
           <value type="bool" key="PackageManagerAutoSetup">false</value>
           <value type="bool" key="ShowAdvancedOptionsByDefault">true</value>
           <value type="bool" key="ShowSourceSubFolders">false</value>
           <value type="bool" key="UseGlobalSettings">false</value>
           <value type="bool" key="UseJunctionsForSourceAndBuildDirectories">true</value>
         </valuemap>
       </valuemap>
      </data>
      <data>
       <variable>Version</variable>
       <value type="int">22</value>
      </data>
     </qtcreator>

For more information about the settings, see Override CMake settings for a project.

See also Building and running projects and CMake presets.

Override CMake settings for a project ◦ Specify Clang tools settings