-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
88 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/*************************************************************************** | ||
qgscodeeditorhtml.cpp - A HTML editor based on QScintilla | ||
-------------------------------------- | ||
Date : 20-Jul-2014 | ||
Copyright : (C) 2014 by Nathan Woodrow | ||
Email : woodrow.nathan (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 "qgscodeeditorhtml.h" | ||
|
||
#include <QWidget> | ||
#include <QString> | ||
#include <QFont> | ||
#include <Qsci/qscilexerhtml.h> | ||
|
||
|
||
QgsCodeEditorHTML::QgsCodeEditorHTML( QWidget *parent ) | ||
: QgsCodeEditor( parent ) | ||
{ | ||
if ( !parent ) | ||
{ | ||
setTitle( tr( "HTML Editor" ) ); | ||
} | ||
setMarginVisible( false ); | ||
setFoldingVisible( true ); | ||
setSciLexerHTML(); | ||
} | ||
|
||
QgsCodeEditorHTML::~QgsCodeEditorHTML() | ||
{ | ||
} | ||
|
||
void QgsCodeEditorHTML::setSciLexerHTML() | ||
{ | ||
QsciLexerHTML* lexer = new QsciLexerHTML(); | ||
lexer->setDefaultFont( QFont( "Sans", 10 ) ); | ||
|
||
setLexer( lexer ); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/*************************************************************************** | ||
qgscodeeditorhtml.h - A HTML editor based on QScintilla | ||
-------------------------------------- | ||
Date : 20-Jul-2014 | ||
Copyright : (C) 2014 by Nathan Woodrow | ||
Email : woodrow.nathan (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. * | ||
* * | ||
***************************************************************************/ | ||
|
||
#ifndef QGSCODEEDITORHTML_H | ||
#define QGSCODEEDITORHTML_H | ||
|
||
#include "qgscodeeditor.h" | ||
|
||
|
||
/** \ingroup gui | ||
* A HTML editor based on QScintilla2. Adds syntax highlighting and | ||
* code autocompletion. | ||
* \note added in 2.6 | ||
*/ | ||
class GUI_EXPORT QgsCodeEditorHTML : public QgsCodeEditor | ||
{ | ||
Q_OBJECT | ||
|
||
public: | ||
QgsCodeEditorHTML( QWidget *parent = 0 ); | ||
~QgsCodeEditorHTML(); | ||
|
||
private: | ||
void setSciLexerHTML(); | ||
}; | ||
|
||
#endif |