Using QGIS 3.0, we are working on creating a tool that will allow people to check that their snapping is correct with several linear features stacked on each other. A co-worker of mine figured out how to do it. However, when you first set it up, you have to open the graphical modeler and set the style manually. What she currently has is a path to her own desktop to the folder that has all the possible styles. I am trying to find a way to make it universally, find the CURRENT users profile, THEN search for the file path.

Currently the path is set to something like this:

C:/Users/jwagner/Desktop/Staging Folder/Layer Styles/CableVertex_Incorrect.qml

I tried editing it to use something like this:

Environ("USERPROFILE") & "\Desktop\V1.2\Layer Styles\CableVertex_Incorrect.qml"

We have also tried using "%," and "~" to no avail. The end goal is to have this path already set when we give people the model file. That way we aren't having to personally show every single person on our project how to set styles. I know from personal experience that it will lead to problems later on down the line when trusting everyone else to remember how to properly do it on their own.


If you use different computer on a network it could be easier to copy your QML on a shared location that all user can access. this way you could hard code the path and if you have to made change to your QML you dont have to update all the copy on every computer.

If that not an option I guess you could copy the QML in a location accessible for all user like C:/CableVertex_Incorrect.qml ...

  • 1
    I didn't even think about just dropping the folder on the C: drive. Worked great! Thank you. I would have done the shared drive version, but we log into a VPN that makes the shared drive inaccessible. Having to log out to run the QGIS checker would be counterproductive. Thanks a ton for the quick response! Apr 3 '18 at 17:01

I ended up using the "pre-calculated value" field and this format;

@project_home || '/Files' || '/Style-Project-AOI-v2.qml'

Maybe not so pretty, but hard-coded and works if you want to take the project home and subfolders with you on the road.

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.