QGIS API Documentation  2.99.0-Master (0a63d1f)
Public Member Functions | List of all members
QgsColorSchemeRegistry Class Reference

Registry of color schemes. More...

#include <qgscolorschemeregistry.h>

Public Member Functions

 QgsColorSchemeRegistry ()
 Constructor for an empty color scheme registry. More...
 
virtual ~QgsColorSchemeRegistry ()
 
void addColorScheme (QgsColorScheme *scheme)
 Adds a color scheme to the registry. More...
 
void addDefaultSchemes ()
 Adds all default color schemes to this color scheme. More...
 
void addUserSchemes ()
 Creates schemes for all gpl palettes in the user's palettes folder. More...
 
void populateFromInstance ()
 Adds all color schemes from the global instance to this color scheme. More...
 
bool removeColorScheme (QgsColorScheme *scheme)
 Removes all matching color schemes from the registry. More...
 
QList< QgsColorScheme * > schemes () const
 Returns all color schemes in the registry. More...
 
QList< QgsColorScheme * > schemes (const QgsColorScheme::SchemeFlag flag) const
 Returns all color schemes in the registry which have a specified flag set. More...
 
template<class T >
void schemes (QList< T *> &schemeList)
 Return color schemes of a specific type. More...
 

Detailed Description

Registry of color schemes.

A registry of QgsColorScheme color schemes. This class can be created directly, or accessed via a QgsApplication::colorSchemeRegistry().

Note
Added in version 2.5

Definition at line 33 of file qgscolorschemeregistry.h.

Constructor & Destructor Documentation

◆ QgsColorSchemeRegistry()

QgsColorSchemeRegistry::QgsColorSchemeRegistry ( )

Constructor for an empty color scheme registry.

Definition at line 25 of file qgscolorschemeregistry.cpp.

◆ ~QgsColorSchemeRegistry()

QgsColorSchemeRegistry::~QgsColorSchemeRegistry ( )
virtual

Definition at line 29 of file qgscolorschemeregistry.cpp.

Member Function Documentation

◆ addColorScheme()

void QgsColorSchemeRegistry::addColorScheme ( QgsColorScheme scheme)

Adds a color scheme to the registry.

Ownership of the scheme is transferred to the registry.

Parameters
schemecolor scheme to add
See also
populateFromInstance
removeColorScheme

Definition at line 75 of file qgscolorschemeregistry.cpp.

◆ addDefaultSchemes()

void QgsColorSchemeRegistry::addDefaultSchemes ( )

Adds all default color schemes to this color scheme.

See also
populateFromInstance
addColorScheme
addUserSchemes

Definition at line 48 of file qgscolorschemeregistry.cpp.

◆ addUserSchemes()

void QgsColorSchemeRegistry::addUserSchemes ( )

Creates schemes for all gpl palettes in the user's palettes folder.

See also
populateFromInstance
addDefaultSchemes
addColorScheme

Definition at line 57 of file qgscolorschemeregistry.cpp.

◆ populateFromInstance()

void QgsColorSchemeRegistry::populateFromInstance ( )

Adds all color schemes from the global instance to this color scheme.

See also
addDefaultSchemes
addColorScheme

Definition at line 35 of file qgscolorschemeregistry.cpp.

◆ removeColorScheme()

bool QgsColorSchemeRegistry::removeColorScheme ( QgsColorScheme scheme)

Removes all matching color schemes from the registry.

Parameters
schemecolor scheme to remove
Returns
true if scheme was found and removed
See also
addColorScheme

Definition at line 105 of file qgscolorschemeregistry.cpp.

◆ schemes() [1/3]

QList< QgsColorScheme * > QgsColorSchemeRegistry::schemes ( ) const

Returns all color schemes in the registry.

Returns
list of color schemes

Definition at line 80 of file qgscolorschemeregistry.cpp.

◆ schemes() [2/3]

QList< QgsColorScheme * > QgsColorSchemeRegistry::schemes ( const QgsColorScheme::SchemeFlag  flag) const

Returns all color schemes in the registry which have a specified flag set.

Parameters
flagflag to match
Returns
list of color schemes with flag set

Definition at line 91 of file qgscolorschemeregistry.cpp.

◆ schemes() [3/3]

template<class T >
void QgsColorSchemeRegistry::schemes ( QList< T *> &  schemeList)

Return color schemes of a specific type.

Parameters
schemeListdestination list for matching schemes
Note
not available in python bindings

Definition at line 102 of file qgscolorschemeregistry.h.


The documentation for this class was generated from the following files: