QGIS API Documentation
3.20.0-Odense (decaadbb31)
|
Defines a color scheme for use in QgsCodeEditor widgets. More...
#include <qgscodeeditorcolorscheme.h>
Public Types | |
enum class | ColorRole { Default , Keyword , Class , Method , Decoration , Number , Comment , CommentLine , CommentBlock , Background , Cursor , CaretLine , SingleQuote , DoubleQuote , TripleSingleQuote , TripleDoubleQuote , Operator , QuotedOperator , Identifier , QuotedIdentifier , Tag , UnknownTag , MarginBackground , MarginForeground , SelectionBackground , SelectionForeground , MatchedBraceBackground , MatchedBraceForeground , Edge , Fold , Error , ErrorBackground , FoldIconForeground , FoldIconHalo , IndentationGuide } |
Color roles. More... | |
Public Member Functions | |
QgsCodeEditorColorScheme (const QString &id=QString(), const QString &name=QString()) | |
Constructor for QgsCodeEditorColorScheme. More... | |
QColor | color (ColorRole role) const |
Returns the color to use in the editor for the specified role. More... | |
QString | id () const |
Returns the ID of the color scheme, which is a unique, non-translated identifier for the scheme. More... | |
QString | name () const |
Returns the name of the color scheme, which is the translated, user-visible name of the scheme. More... | |
void | setColor (ColorRole role, const QColor &color) |
Sets the color to use in the editor for the specified role. More... | |
void | setColors (const QMap< ColorRole, QColor > &colors) |
Sets all colors for the scheme. More... | |
Defines a color scheme for use in QgsCodeEditor widgets.
Definition at line 30 of file qgscodeeditorcolorscheme.h.
|
strong |
Color roles.
Definition at line 37 of file qgscodeeditorcolorscheme.h.
QgsCodeEditorColorScheme::QgsCodeEditorColorScheme | ( | const QString & | id = QString() , |
const QString & | name = QString() |
||
) |
Constructor for QgsCodeEditorColorScheme.
The id argument must be set to a unique, non-translated identifier for the color scheme.
The name argument must be set to a translated, user-visible descriptive name of the scheme.
Definition at line 18 of file qgscodeeditorcolorscheme.cpp.
QColor QgsCodeEditorColorScheme::color | ( | QgsCodeEditorColorScheme::ColorRole | role | ) | const |
Returns the color to use in the editor for the specified role.
Definition at line 25 of file qgscodeeditorcolorscheme.cpp.
|
inline |
Returns the ID of the color scheme, which is a unique, non-translated identifier for the scheme.
Definition at line 89 of file qgscodeeditorcolorscheme.h.
|
inline |
Returns the name of the color scheme, which is the translated, user-visible name of the scheme.
Definition at line 94 of file qgscodeeditorcolorscheme.h.
void QgsCodeEditorColorScheme::setColor | ( | QgsCodeEditorColorScheme::ColorRole | role, |
const QColor & | color | ||
) |
Sets the color to use in the editor for the specified role.
Definition at line 30 of file qgscodeeditorcolorscheme.cpp.
void QgsCodeEditorColorScheme::setColors | ( | const QMap< ColorRole, QColor > & | colors | ) |
Sets all colors for the scheme.
Definition at line 35 of file qgscodeeditorcolorscheme.cpp.