Class: QgsUserProfile

User profile contains information about the user profile folders on the machine.

In QGIS 3 all settings, plugins, etc were moved into a %APPDATA%/profiles folder for each platform. This allows for manage different user profiles per machine vs the single default one that was allowed in the past.

A user profile is all settings and anything that used to be found in .qgis3 in the users home folder.

Methods

alias

Returns the alias for the user profile.

folder

The base folder for the user profile.

icon

The icon for the user profile.

initSettings

Init the settings from the user folder.

name

The name for the user profile.

setAlias

Set the alias of the profile.

validate

Check of the profile is in a valid state.

class qgis.core.QgsUserProfile[source]

Bases: object

__init__(folder: str | None)

Reference to an existing user profile folder. Profile folder should be created using QgsProfileManager.

Parameters:

folder (Optional[str]) – An existing profile folder as the base of the user profile.

__init__(a0: QgsUserProfile)
Parameters:

a0 (QgsUserProfile)

alias(self) str[source]

Returns the alias for the user profile.

Return type:

str

Returns:

If no alias is set name() is returned.

folder(self) str[source]

The base folder for the user profile.

Return type:

str

icon(self) QIcon[source]

The icon for the user profile.

Return type:

QIcon

Returns:

A QIcon for the users

initSettings(self)[source]

Init the settings from the user folder.

name(self) str[source]

The name for the user profile.

Return type:

str

setAlias(self, alias: str | None) QgsError[source]

Set the alias of the profile. The alias is a user friendly name.

Parameters:

alias (Optional[str]) – A user friendly name for the profile.

Return type:

QgsError

Returns:

True of setting the alias was successful.

validate(self) QgsError[source]

Check of the profile is in a valid state.

Return type:

QgsError