/
qgscodeeditorcss.cpp
43 lines (37 loc) · 1.45 KB
/
qgscodeeditorcss.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/***************************************************************************
qgscodeeditorcss.cpp - A CSS editor based on QScintilla
--------------------------------------
Date : 27-Jul-2014
Copyright : (C) 2014 by Nyall Dawson
Email : nyall dot dawson at gmail dot com
***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#include "qgsapplication.h"
#include "qgscodeeditorcss.h"
#include <QWidget>
#include <QString>
#include <QFont>
#include <Qsci/qscilexercss.h>
QgsCodeEditorCSS::QgsCodeEditorCSS( QWidget *parent )
: QgsCodeEditor( parent )
{
if ( !parent )
{
setTitle( tr( "CSS Editor" ) );
}
setMarginVisible( false );
setFoldingVisible( true );
initializeLexer();
}
void QgsCodeEditorCSS::initializeLexer()
{
QsciLexerCSS *lexer = new QsciLexerCSS( this );
lexer->setDefaultFont( getMonospaceFont() );
setLexer( lexer );
}