QgsUserProfile class

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.

Constructors, destructors, conversion operators

QgsUserProfile(const QString& folder)
Reference to a existing user profile folder.

Public functions

auto alias() const -> const QString
Returns the alias for the user profile.
auto folder() const -> const QString
The base folder for the user profile.
auto icon() const -> const QIcon
The icon for the user profile.
void initSettings() const
Init the settings from the user folder.
auto name() const -> const QString
The name for the user profile.
auto setAlias(const QString& alias) -> QgsError
Set the alias of the profile.
auto validate() const -> QgsError
Check of the profile is in a valid state.

Function documentation

QgsUserProfile::QgsUserProfile(const QString& folder)

Reference to a existing user profile folder.

Parameters
folder An existing profile folder as the base of the user profile.

Profile folder should be created using QgsProfileManager.

const QString QgsUserProfile::alias() const

Returns the alias for the user profile.

Returns If no alias is set name() is returned.

const QIcon QgsUserProfile::icon() const

The icon for the user profile.

Returns A QIcon for the users

QgsError QgsUserProfile::setAlias(const QString& alias)

Set the alias of the profile.

Parameters
alias A user friendly name for the profile.
Returns True of setting the alias was successful.

The alias is a user friendly name.