QGIS API Documentation  2.18.21-Las Palmas (9fba24a)
Public Member Functions | Protected Member Functions | List of all members
QgsCodeEditor Class Reference

A text editor based on QScintilla2. More...

#include <qgscodeeditor.h>

Inheritance diagram for QgsCodeEditor:
Inheritance graph

Public Member Functions

 QgsCodeEditor (QWidget *parent=nullptr, const QString &title="", bool folding=false, bool margin=false)
 Construct a new code editor. More...
 ~QgsCodeEditor ()
bool foldingVisible ()
void insertText (const QString &theText)
 Insert text at cursor position, or replace any selected text if user has made a selection. More...
bool marginVisible ()
void setFoldingVisible (bool folding)
 Set folding visible state. More...
void setMarginVisible (bool margin)
 Set margin visible state. More...
void setTitle (const QString &title)
 Set the widget title. More...

Protected Member Functions

void focusOutEvent (QFocusEvent *event) override
QFont getMonospaceFont ()
bool isFixedPitch (const QFont &font)
void keyPressEvent (QKeyEvent *event) override

Detailed Description

A text editor based on QScintilla2.

added in 2.6
may not be available in Python bindings, depending on platform support

Definition at line 32 of file qgscodeeditor.h.

Constructor & Destructor Documentation

◆ QgsCodeEditor()

QgsCodeEditor::QgsCodeEditor ( QWidget parent = nullptr,
const QString title = "",
bool  folding = false,
bool  margin = false 

Construct a new code editor.

parentThe parent QWidget
titleThe title to show in the code editor dialog
foldingfalse: Enable folding for code editor
marginfalse: Enable margin for code editor
added in 2.6

Definition at line 25 of file qgscodeeditor.cpp.

◆ ~QgsCodeEditor()

QgsCodeEditor::~QgsCodeEditor ( )

Definition at line 44 of file qgscodeeditor.cpp.

Member Function Documentation

◆ focusOutEvent()

void QgsCodeEditor::focusOutEvent ( QFocusEvent event)

Definition at line 49 of file qgscodeeditor.cpp.

◆ foldingVisible()

bool QgsCodeEditor::foldingVisible ( )

Definition at line 64 of file qgscodeeditor.h.

◆ getMonospaceFont()

QFont QgsCodeEditor::getMonospaceFont ( )

Definition at line 176 of file qgscodeeditor.cpp.

◆ insertText()

void QgsCodeEditor::insertText ( const QString theText)

Insert text at cursor position, or replace any selected text if user has made a selection.

theTextThe text to be inserted

Definition at line 154 of file qgscodeeditor.cpp.

◆ isFixedPitch()

bool QgsCodeEditor::isFixedPitch ( const QFont font)

Definition at line 171 of file qgscodeeditor.cpp.

◆ keyPressEvent()

void QgsCodeEditor::keyPressEvent ( QKeyEvent event)

Definition at line 79 of file qgscodeeditor.cpp.

◆ marginVisible()

bool QgsCodeEditor::marginVisible ( )

Definition at line 58 of file qgscodeeditor.h.

◆ setFoldingVisible()

void QgsCodeEditor::setFoldingVisible ( bool  folding)

Set folding visible state.

foldingSet folding in the editor

Definition at line 140 of file qgscodeeditor.cpp.

◆ setMarginVisible()

void QgsCodeEditor::setMarginVisible ( bool  margin)

Set margin visible state.

marginSet margin in the editor

Definition at line 120 of file qgscodeeditor.cpp.

◆ setTitle()

void QgsCodeEditor::setTitle ( const QString title)

Set the widget title.

titlewidget title

Definition at line 115 of file qgscodeeditor.cpp.

The documentation for this class was generated from the following files: