QGIS API Documentation 3.41.0-Master (3440c17df1d)
|
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 , SearchMatchBackground } |
Color roles. More... | |
Public Member Functions | |
QgsCodeEditorColorScheme (const QString &id=QString(), const QString &name=QString()) | |
Constructor for QgsCodeEditorColorScheme. | |
QColor | color (ColorRole role) const |
Returns the color to use in the editor for the specified role. | |
QString | id () const |
Returns the ID of the color scheme, which is a unique, non-translated identifier for the scheme. | |
QString | name () const |
Returns the name of the color scheme, which is the translated, user-visible name of the scheme. | |
void | setColor (ColorRole role, const QColor &color) |
Sets the color to use in the editor for the specified role. | |
void | setColors (const QMap< ColorRole, QColor > &colors) |
Sets all colors for the scheme. | |
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 90 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 95 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.