5

I have a QGIS project I'm working on with a few other users. The print composer and map tips use custom python expressions in the expression builder.

I know the expressions are store in .qgis2/python/expressions but I want to find a reasonable way to distribute and update those expressions so that when someone alters on it syncs to all the others. It seems odd to me that these can't be embedded somehow in the .qgis file (I understand there's security concerns, but a model similar to macros in microsoft products could be used...)

4

There is a tab Macros the project properies which allow to specify python code which is run when a project is opened. You can register your custom expressions there.

What I wonder a bit is the sentence

so that when someone alters on it syncs to all the others

If it is shipped with a project, its scope is this project (or actually rather this QGIS session) so there is not much which is synced. If you need to synchronize it between several projects and machines, you are probably better off managing a central plugin. You can have a look at the Expressions plus plugin to get started. In case your expressions are of broader applicability than just yourself I would even propose you add it to this plugin so others can use it as well.

Of course your proposed approach of synchronizing the expression files with some file synchronisation tool is perfectly valid too.

1

After much searching: no.

However, I did find an alternative. I set up symlinks on all the computers to link my custom expressions into the local expression folder from dropbox. This way they'll stay in sync.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.