QGIS/src/gui/qgscodeeditorsql.cpp
Nathan Woodrow b2ff71868a Clean up code editor code and API. Add tr() and fix spelling.
Moved show/hide folding and margin methods to base class.
2014-07-16 22:51:27 +10:00

48 lines
1.5 KiB
C++

/***************************************************************************
qgscodeeditorsql.cpp - A SQL editor based on QScintilla
--------------------------------------
Date : 06-Oct-2013
Copyright : (C) 2013 by Salvatore Larosa
Email : lrssvtml (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 "qgscodeeditorsql.h"
#include <QWidget>
#include <QString>
#include <QFont>
#include <Qsci/qscilexersql.h>
QgsCodeEditorSQL::QgsCodeEditorSQL( QWidget *parent )
: QgsCodeEditor( parent )
{
if ( !parent )
{
setTitle( tr( "Qscintilla2 SQL Editor" ) );
}
setMarginVisible( false );
setFoldingVisible( true );
setSciLexerSQL();
}
QgsCodeEditorSQL::~QgsCodeEditorSQL()
{
}
void QgsCodeEditorSQL::setSciLexerSQL()
{
QsciLexerSQL* sqlLexer = new QsciLexerSQL();
sqlLexer->setDefaultFont( QFont( "Sans", 10 ) );
setLexer( sqlLexer );
}