QGIS API Documentation 3.28.0-Firenze (ed3ad0430f)
|
A HTML editor based on QScintilla2. More...
#include <qgscodeeditorhtml.h>
Public Member Functions | |
QgsCodeEditorHTML (QWidget *parent=nullptr) | |
Constructor for QgsCodeEditorHTML. More... | |
![]() | |
QgsCodeEditor (QWidget *parent=nullptr, const QString &title=QString(), bool folding=false, bool margin=false, QgsCodeEditor::Flags flags=QgsCodeEditor::Flags()) | |
Flags controlling behavior of code editor. More... | |
void | addWarning (int lineNumber, const QString &warning) |
Adds a warning message and indicator to the specified a lineNumber. More... | |
void | clearWarnings () |
Clears all warning messages from the editor. More... | |
bool | foldingVisible () |
Returns true if the folding controls are visible in the editor. More... | |
void | insertText (const QString &text) |
Insert text at cursor position, or replace any selected text if user has made a selection. More... | |
bool | isCursorOnLastLine () const |
Returns true if the cursor is on the last line of the document. More... | |
bool | lineNumbersVisible () const |
Returns whether line numbers are visible in the editor. More... | |
Q_DECL_DEPRECATED bool | marginVisible () |
Returns whether margins are in a visible state. More... | |
void | setCustomAppearance (const QString &scheme=QString(), const QMap< QgsCodeEditorColorScheme::ColorRole, QColor > &customColors=QMap< QgsCodeEditorColorScheme::ColorRole, QColor >(), const QString &fontFamily=QString(), int fontSize=0) |
Sets a custom appearance for the widget, disconnecting it from using the standard appearance taken from QSettings. More... | |
void | setFoldingVisible (bool folding) |
Set whether the folding controls are visible in the editor. More... | |
void | setLineNumbersVisible (bool visible) |
Sets whether line numbers should be visible in the editor. More... | |
Q_DECL_DEPRECATED void | setMarginVisible (bool margin) |
Set margin visible state. More... | |
void | setTitle (const QString &title) |
Set the widget title. More... | |
Protected Member Functions | |
void | initializeLexer () override |
Called when the dialect specific code lexer needs to be initialized (or reinitialized). More... | |
![]() | |
void | focusOutEvent (QFocusEvent *event) override |
virtual void | initializeLexer () |
Called when the dialect specific code lexer needs to be initialized (or reinitialized). More... | |
bool | isFixedPitch (const QFont &font) |
void | keyPressEvent (QKeyEvent *event) override |
QColor | lexerColor (QgsCodeEditorColorScheme::ColorRole role) const |
Returns the color to use in the lexer for the specified role. More... | |
QFont | lexerFont () const |
Returns the font to use in the lexer. More... | |
void | runPostLexerConfigurationTasks () |
Performs tasks which must be run after a lexer has been set for the widget. More... | |
Additional Inherited Members | |
![]() | |
enum class | Flag : int { CodeFolding = 1 << 0 } |
Flags controlling behavior of code editor. More... | |
enum class | MarginRole : int { LineNumbers = 0 , ErrorIndicators = 1 , FoldingControls = 2 } |
Margin roles. More... | |
![]() | |
virtual void | moveCursorToEnd () |
Moves the cursor to the end of the document and scrolls to ensure it is visible. More... | |
virtual void | moveCursorToStart () |
Moves the cursor to the start of the document and scrolls to ensure it is visible. More... | |
![]() | |
static QColor | color (QgsCodeEditorColorScheme::ColorRole role) |
Returns the color to use in the editor for the specified role. More... | |
static QColor | defaultColor (QgsCodeEditorColorScheme::ColorRole role, const QString &theme=QString()) |
Returns the default color for the specified role. More... | |
static QFont | getMonospaceFont () |
Returns the monospaced font to use for code editors. More... | |
static void | setColor (QgsCodeEditorColorScheme::ColorRole role, const QColor &color) |
Sets the color to use in the editor for the specified role. More... | |
A HTML editor based on QScintilla2.
Adds syntax highlighting and code autocompletion.
Definition at line 32 of file qgscodeeditorhtml.h.
QgsCodeEditorHTML::QgsCodeEditorHTML | ( | QWidget * | parent = nullptr | ) |
Constructor for QgsCodeEditorHTML.
Definition at line 26 of file qgscodeeditorhtml.cpp.
|
overrideprotectedvirtual |
Called when the dialect specific code lexer needs to be initialized (or reinitialized).
The default implementation does nothing.
Reimplemented from QgsCodeEditor.
Definition at line 40 of file qgscodeeditorhtml.cpp.