Mantid
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
AlternateCSPythonLexer Class Reference

Defines a Python lexer with a alternative colour scheme to the standard one provided by QsciLexerPython. More...

#include <AlternateCSPythonLexer.h>

Inheritance diagram for AlternateCSPythonLexer:

Public Member Functions

 AlternateCSPythonLexer (const QFont &font)
 Construct a lexer with a font to be used for all text styles.
 
QColor defaultColor (int style) const override
 Returns the foreground colour of the text for a style.
 
QFont defaultFont (int style) const override
 Returns the font of the text.
 
QColor defaultPaper (int style) const override
 
const char * keywords (int set) const override
 ‍**
 

Private Member Functions

QColor defaultColorDark (int style) const
 Returns the foreground colour of the text for a dark theme style.
 
QColor defaultColorLight (int style) const
 Returns the foreground colour of the text for a light theme style.
 

Private Attributes

QFont m_font
 
bool m_isDarkMode {false}
 

Static Private Attributes

static constexpr const char * customKeywords = "True False"
 

Detailed Description

Defines a Python lexer with a alternative colour scheme to the standard one provided by QsciLexerPython.

Definition at line 15 of file AlternateCSPythonLexer.h.

Constructor & Destructor Documentation

◆ AlternateCSPythonLexer()

AlternateCSPythonLexer::AlternateCSPythonLexer ( const QFont &  font)

Construct a lexer with a font to be used for all text styles.

Parameters
fontA font to used for the text

Definition at line 14 of file AlternateCSPythonLexer.cpp.

References m_isDarkMode.

Member Function Documentation

◆ defaultColor()

QColor AlternateCSPythonLexer::defaultColor ( int  style) const
override

Returns the foreground colour of the text for a style.

Parameters
styleAn enum defining the type of element encountered
Returns
A QColor for this element type

Definition at line 28 of file AlternateCSPythonLexer.cpp.

References defaultColorDark(), defaultColorLight(), and m_isDarkMode.

◆ defaultColorDark()

QColor AlternateCSPythonLexer::defaultColorDark ( int  style) const
private

Returns the foreground colour of the text for a dark theme style.

Parameters
styleAn enum defining the type of element encountered
Returns
A QColor for this element type

Definition at line 98 of file AlternateCSPythonLexer.cpp.

Referenced by defaultColor().

◆ defaultColorLight()

QColor AlternateCSPythonLexer::defaultColorLight ( int  style) const
private

Returns the foreground colour of the text for a light theme style.

Parameters
styleAn enum defining the type of element encountered
Returns
A QColor for this element type

Definition at line 37 of file AlternateCSPythonLexer.cpp.

Referenced by defaultColor().

◆ defaultFont()

QFont AlternateCSPythonLexer::defaultFont ( int  style) const
override

Returns the font of the text.

Parameters
styleUnused.
Returns
A QFont for this element type

Definition at line 161 of file AlternateCSPythonLexer.cpp.

References m_font.

◆ defaultPaper()

QColor AlternateCSPythonLexer::defaultPaper ( int  style) const
override

Definition at line 186 of file AlternateCSPythonLexer.cpp.

References m_isDarkMode.

◆ keywords()

const char * AlternateCSPythonLexer::keywords ( int  set) const
override

‍**

Definition at line 171 of file AlternateCSPythonLexer.cpp.

References customKeywords.

Member Data Documentation

◆ customKeywords

constexpr const char* AlternateCSPythonLexer::customKeywords = "True False"
staticconstexprprivate

Definition at line 28 of file AlternateCSPythonLexer.h.

Referenced by keywords().

◆ m_font

QFont AlternateCSPythonLexer::m_font
private

Definition at line 27 of file AlternateCSPythonLexer.h.

Referenced by defaultFont().

◆ m_isDarkMode

bool AlternateCSPythonLexer::m_isDarkMode {false}
private

Definition at line 29 of file AlternateCSPythonLexer.h.

Referenced by AlternateCSPythonLexer(), defaultColor(), and defaultPaper().


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