2

I have different user profiles in QGIS, each for different tasks. For example one profile only for digitization. In this profile, only the functions that the user needs for digitization are enabled, the rest is disabled.

Is it possible to open different project files with different profiles? The user should only open the project file and the correct profile should already be opened. He should not have to select the profile in an extra step.

Can something like this be solved via qgis3.ini or another way?

2 Answers 2

4

QGIS can be started from the command line and accepts parameters.

Here a short excerpt from the help:

qgis --help 
QGIS is a user friendly Open Source Geographic Information System.
Usage: qgis [OPTION] [FILE]
  OPTION:
    ...
    [--profile name]    load a named profile from the users profiles folder.
    ...
    [--]        treat all following arguments as FILEs

  FILE:
    Files specified on the command line can include rasters, vectors,
    QGIS layer definition files (.qlr) and QGIS project files (.qgs and .qgz)

You can create a custom startup script (shell script/batch file) to start qgis with the required options and start qgis with this script which can be placed on the desktop or where you want it.

digitize.sh

#!/usr/bin/env sh

qgis --profile digitizing /home/user/qgis_projects/rocks.qgz

Or on Windows:

digitize.bat

cd C:\Program Files\QGIS 3.28\bin

qgis --profile digitizing "C:\Users\user\qgis_projects\rocks.qgz"
2
  • ups...same answer same time...cheers
    – eurojam
    Aug 3 at 6:43
  • hah, you get my vote anyway! Aug 3 at 9:40
3

Just start QGIS from commadnline with some options:

start "" "C:\Program Files\QGIS 3.16\bin\qgis-ltr-bin.exe" --profile english --project "c:\tonne\dreisam.qgz"

the example above will start QGIS 3.16 with the profile named "english" and the project dreisam.qgz. see https://docs.qgis.org/3.22/en/docs/user_manual/introduction/qgis_configuration.html#command-line-and-environment-variables for more options

3
  • thanks for your answer. But now I have the problem, that after closing qgis and open it again my default profile is for example the profile "english" and no longer the actual default profil.
    – joe_gerner
    Aug 3 at 7:30
  • the most straightforward way to deal with this is to add another startup script for qgis to start with the "default" project Aug 3 at 9:40
  • There is a profiles.ini file just one lever up from the profiles, where you can set the default profile which will be started aor like Matthias said, use a startup script, which is a good solution anyway!
    – eurojam
    Aug 3 at 11:01

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.