Skip to content
Permalink
Browse files

Python and SQL(Expression) code editors, always use monospace

And use a different color for fields in the expression editor
  • Loading branch information
m-kuhn committed Apr 19, 2016
1 parent 7379223 commit 69153ab0686ae205dc31629aaa1962935dcd792f
Showing with 11 additions and 8 deletions.
  1. +4 −7 src/gui/qgscodeeditorpython.cpp
  2. +7 −1 src/gui/qgscodeeditorsql.cpp
@@ -55,13 +55,10 @@ void QgsCodeEditorPython::setSciLexerPython()

QsciLexerPython* pyLexer = new QsciLexerPython( this );
pyLexer->setDefaultFont( font );
pyLexer->setFont( font, 1 ); // comment
pyLexer->setFont( font, 3 ); // singlequotes
pyLexer->setFont( font, 4 ); // doublequotes
pyLexer->setFont( font, 6 ); // triplequotes
pyLexer->setColor( Qt::red, 1 ); // comment color
pyLexer->setColor( Qt::darkGreen, 5 ); // keyword color
pyLexer->setColor( Qt::darkBlue, 15 ); // decorator color
pyLexer->setFont( font, -1 );
pyLexer->setColor( Qt::red, QsciLexerPython::Comment );
pyLexer->setColor( Qt::darkGreen, QsciLexerPython::Keyword );
pyLexer->setColor( Qt::darkBlue, QsciLexerPython::Decorator );

QsciAPIs* apis = new QsciAPIs( pyLexer );

@@ -41,8 +41,14 @@ QgsCodeEditorSQL::~QgsCodeEditorSQL()

void QgsCodeEditorSQL::setSciLexerSQL()
{
QFont font = getMonospaceFont();

QsciLexerSQL* sqlLexer = new QsciLexerSQL( this );
sqlLexer->setDefaultFont( QFont( "Sans", 10 ) );
sqlLexer->setDefaultFont( font );
sqlLexer->setFont( font, -1 );
font.setBold( true );
sqlLexer->setFont( font, QsciLexerSQL::Keyword );
sqlLexer->setColor( Qt::darkYellow, QsciLexerSQL::DoubleQuotedString ); // fields

setLexer( sqlLexer );
}

0 comments on commit 69153ab

Please sign in to comment.
You can’t perform that action at this time.