QGIS API Documentation  3.14.0-Pi (9f7028fd23)
Public Member Functions | Protected Member Functions | List of all members
QgsCodeEditor Class Reference

#include <qgscodeeditor.h>

Inheritance diagram for QgsCodeEditor:
Inheritance graph

Public Member Functions

 QgsCodeEditor (QWidget *parent=nullptr, const QString &title=QString(), bool folding=false, bool margin=false)
 Construct a new code editor. More...
bool foldingVisible ()
void insertText (const QString &text)
 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.

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

Definition at line 38 of file qgscodeeditor.h.

Constructor & Destructor Documentation

◆ QgsCodeEditor()

QgsCodeEditor::QgsCodeEditor ( QWidget *  parent = nullptr,
const QString &  title = QString(),
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
QGIS 2.6

Definition at line 29 of file qgscodeeditor.cpp.

Member Function Documentation

◆ focusOutEvent()

void QgsCodeEditor::focusOutEvent ( QFocusEvent *  event)

Definition at line 52 of file qgscodeeditor.cpp.

◆ foldingVisible()

bool QgsCodeEditor::foldingVisible ( )

Definition at line 73 of file qgscodeeditor.h.

◆ getMonospaceFont()

QFont QgsCodeEditor::getMonospaceFont ( )

Definition at line 199 of file qgscodeeditor.cpp.

◆ insertText()

void QgsCodeEditor::insertText ( const QString &  text)

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

textThe text to be inserted

Definition at line 177 of file qgscodeeditor.cpp.

◆ isFixedPitch()

bool QgsCodeEditor::isFixedPitch ( const QFont &  font)

Definition at line 194 of file qgscodeeditor.cpp.

◆ keyPressEvent()

void QgsCodeEditor::keyPressEvent ( QKeyEvent *  event)

Definition at line 82 of file qgscodeeditor.cpp.

◆ marginVisible()

bool QgsCodeEditor::marginVisible ( )

Definition at line 66 of file qgscodeeditor.h.

◆ setFoldingVisible()

void QgsCodeEditor::setFoldingVisible ( bool  folding)

Set folding visible state.

foldingSet folding in the editor

Definition at line 164 of file qgscodeeditor.cpp.

◆ setMarginVisible()

void QgsCodeEditor::setMarginVisible ( bool  margin)

Set margin visible state.

marginSet margin in the editor

Definition at line 146 of file qgscodeeditor.cpp.

◆ setTitle()

void QgsCodeEditor::setTitle ( const QString &  title)

Set the widget title.

titlewidget title

Definition at line 141 of file qgscodeeditor.cpp.

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