QgsUserColorScheme class

A color scheme which stores its colors in a gpl palette file within the "palettes" subfolder off the user's QGIS settings folder.

Base classes

class QgsGplColorScheme
A color scheme which stores its colors in a gpl palette file.

Constructors, destructors, conversion operators

QgsUserColorScheme(const QString& filename)
Constructs a new user color scheme, using a specified gpl palette file.

Public functions

auto clone() const -> QgsUserColorScheme* override
Clones a color scheme.
auto erase() -> bool
Erases the associated gpl palette file from the users "palettes" folder.
auto flags() const -> QgsColorScheme::SchemeFlags override
Returns the current flags for the color scheme.
auto isEditable() const -> bool override
Returns whether the color scheme is editable.
auto schemeName() const -> QString override
Gets the name for the color scheme.
void setName(const QString& name)
Sets the name for the scheme.
void setShowSchemeInMenu(bool show)
Sets whether a this scheme should be shown in color button menus.

Protected functions

auto gplFilePath() -> QString override
Returns the file path for the associated gpl palette file.

Function documentation

QgsUserColorScheme::QgsUserColorScheme(const QString& filename)

Constructs a new user color scheme, using a specified gpl palette file.

Parameters
filename filename of gpl palette file stored in the users "palettes" folder

QgsUserColorScheme* QgsUserColorScheme::clone() const override

Clones a color scheme.

Returns copy of color scheme

bool QgsUserColorScheme::erase()

Erases the associated gpl palette file from the users "palettes" folder.

Returns true if erase was successful

QgsColorScheme::SchemeFlags QgsUserColorScheme::flags() const override

Returns the current flags for the color scheme.

Returns current flags

bool QgsUserColorScheme::isEditable() const override

Returns whether the color scheme is editable.

Returns true if scheme is editable

QString QgsUserColorScheme::schemeName() const override

Gets the name for the color scheme.

Returns color scheme name

void QgsUserColorScheme::setName(const QString& name)

Sets the name for the scheme.

Parameters
name new name

void QgsUserColorScheme::setShowSchemeInMenu(bool show)

Sets whether a this scheme should be shown in color button menus.

Parameters
show set to true to show in color button menus, or false to hide from menus

QString QgsUserColorScheme::gplFilePath() override protected

Returns the file path for the associated gpl palette file.

Returns gpl file path