How to use version control with Qt Creator project settings with many users?

When using Qt Creator with qmake projects, say example.pro , then the native configuration of Qt Creator is usually stored in the example.pro.user file. But this file contains user settings, so if many people work on a project, it is not recommended to take it to a common version control repository. However, this file often contains complex settings for deployment and environment variables, and it would be nice to save them for version control.

Is there a way to save the personal settings of a particular Qt Creator client in version control and otherwise share them so that the settings of different developers do not mix?

+4
version-control project qt-creator
source share
1 answer

You can use the QTC_EXTENSION environment QTC_EXTENSION . Therefore, if you usually have

 example.pro.user 

Then, having an environment variable

 QTC_EXTENSION=foobar 

When starting Qt Creater will use the file instead

 example.pro.foobar 

I'm not sure if it is documented anywhere, but it is implemented in this source file (updated in May 2015) and has been around since 2011 at least.

To clone settings for a new user, simply copy the settings file to a new name and set the environment variable to the one you want. However, I do not know how easy it is to merge the changes after this, except for manually copying the paste (either with two open Qt Creators at the same time, or by opening XML files as text).


Then it is possible to share the settings by manually creating the example.pro.shared file (configurable with the QTC_SHARED_EXTENSION environment QTC_SHARED_EXTENSION , as well as user settings). It is usually created by copying the .pro.user file and then editing it to remove non-shared parts, as described here (updated to May 2015).

+5
source share

All Articles