Skip to content

Commit

Permalink
Rename lexer
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn committed Sep 9, 2018
1 parent beb8912 commit 4b9cc9b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
13 changes: 9 additions & 4 deletions src/gui/qgscodeeditorexpression.cpp
Expand Up @@ -106,7 +106,7 @@ void QgsCodeEditorExpression::initializeLexer()
// The font size gotten from getMonospaceFont() is too small on Mac
font.setPointSize( QLabel().font().pointSize() );
#endif
mSqlLexer = new QgsCaseInsensitiveLexerExpression( this );
mSqlLexer = new QgsLexerExpression( this );
mSqlLexer->setDefaultFont( font );
mSqlLexer->setFont( font, -1 );
font.setBold( true );
Expand Down Expand Up @@ -145,17 +145,22 @@ void QgsCodeEditorExpression::updateApis()
}

///@cond PRIVATE
QgsCaseInsensitiveLexerExpression::QgsCaseInsensitiveLexerExpression( QObject *parent )
QgsLexerExpression::QgsLexerExpression( QObject *parent )
: QsciLexerSQL( parent )
{
}

bool QgsCaseInsensitiveLexerExpression::caseSensitive() const
const char *QgsLexerExpression::language() const
{
return "QGIS Expression";
}

bool QgsLexerExpression::caseSensitive() const
{
return false;
}

const char *QgsCaseInsensitiveLexerExpression::wordCharacters() const
const char *QgsLexerExpression::wordCharacters() const
{
return "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_@";
}
Expand Down
6 changes: 4 additions & 2 deletions src/gui/qgscodeeditorexpression.h
Expand Up @@ -77,13 +77,15 @@ class GUI_EXPORT QgsCodeEditorExpression : public QgsCodeEditor
\note not available in Python bindings
\ingroup gui
*/
class QgsCaseInsensitiveLexerExpression : public QsciLexerSQL
class QgsLexerExpression : public QsciLexerSQL
{
Q_OBJECT

public:
//! Constructor
explicit QgsCaseInsensitiveLexerExpression( QObject *parent = nullptr );
explicit QgsLexerExpression( QObject *parent = nullptr );

const char *language() const override;

bool caseSensitive() const override;

Expand Down

0 comments on commit 4b9cc9b

Please sign in to comment.