QGIS API Documentation
3.16.0-Hannover (43b64b13f3)
|
A color scheme which stores its colors in a gpl palette file within the "palettes" subfolder off the user's QGIS settings folder. More...
#include <qgscolorscheme.h>
Public Member Functions | |
QgsUserColorScheme (const QString &filename) | |
Constructs a new user color scheme, using a specified gpl palette file. More... | |
QgsUserColorScheme * | clone () const override |
Clones a color scheme. More... | |
bool | erase () |
Erases the associated gpl palette file from the users "palettes" folder. More... | |
QgsColorScheme::SchemeFlags | flags () const override |
Returns the current flags for the color scheme. More... | |
bool | isEditable () const override |
Returns whether the color scheme is editable. More... | |
QString | schemeName () const override |
Gets the name for the color scheme. More... | |
void | setName (const QString &name) |
Sets the name for the scheme. More... | |
void | setShowSchemeInMenu (bool show) |
Sets whether a this scheme should be shown in color button menus. More... | |
Public Member Functions inherited from QgsGplColorScheme | |
QgsGplColorScheme ()=default | |
Constructor for QgsGplColorScheme. More... | |
QgsNamedColorList | fetchColors (const QString &context=QString(), const QColor &baseColor=QColor()) override |
Gets a list of colors from the scheme. More... | |
bool | setColors (const QgsNamedColorList &colors, const QString &context=QString(), const QColor &baseColor=QColor()) override |
Sets the colors for the scheme. More... | |
Public Member Functions inherited from QgsColorScheme | |
QgsColorScheme ()=default | |
Constructor for QgsColorScheme. More... | |
virtual | ~QgsColorScheme ()=default |
Protected Member Functions | |
QString | gplFilePath () override |
Returns the file path for the associated gpl palette file. More... | |
Protected Attributes | |
bool | mEditable = false |
QString | mFilename |
QString | mName |
Additional Inherited Members | |
Public Types inherited from QgsColorScheme | |
enum | SchemeFlag { ShowInColorDialog = 0x01, ShowInColorButtonMenu = 0x02, ShowInAllContexts = ShowInColorDialog | ShowInColorButtonMenu } |
Flags for controlling behavior of color scheme. More... | |
A color scheme which stores its colors in a gpl palette file within the "palettes" subfolder off the user's QGIS settings folder.
Definition at line 175 of file qgscolorscheme.h.
QgsUserColorScheme::QgsUserColorScheme | ( | const QString & | filename | ) |
Constructs a new user color scheme, using a specified gpl palette file.
filename | filename of gpl palette file stored in the users "palettes" folder |
Definition at line 289 of file qgscolorscheme.cpp.
|
overridevirtual |
Clones a color scheme.
Implements QgsColorScheme.
Definition at line 331 of file qgscolorscheme.cpp.
bool QgsUserColorScheme::erase | ( | ) |
Erases the associated gpl palette file from the users "palettes" folder.
true
if erase was successful Definition at line 351 of file qgscolorscheme.cpp.
|
overridevirtual |
Returns the current flags for the color scheme.
Reimplemented from QgsColorScheme.
Definition at line 336 of file qgscolorscheme.cpp.
|
overrideprotectedvirtual |
Returns the file path for the associated gpl palette file.
Implements QgsGplColorScheme.
Definition at line 386 of file qgscolorscheme.cpp.
|
inlineoverridevirtual |
Returns whether the color scheme is editable.
true
if scheme is editable Reimplemented from QgsColorScheme.
Definition at line 189 of file qgscolorscheme.h.
|
overridevirtual |
Gets the name for the color scheme.
Implements QgsColorScheme.
Definition at line 326 of file qgscolorscheme.cpp.
|
inline |
Sets the name for the scheme.
name | new name |
Definition at line 197 of file qgscolorscheme.h.
void QgsUserColorScheme::setShowSchemeInMenu | ( | bool | show | ) |
Sets whether a this scheme should be shown in color button menus.
show | set to true to show in color button menus, or false to hide from menus |
Definition at line 369 of file qgscolorscheme.cpp.
|
protected |
Definition at line 218 of file qgscolorscheme.h.
|
protected |
Definition at line 216 of file qgscolorscheme.h.
|
protected |
Definition at line 214 of file qgscolorscheme.h.