QGIS API Documentation  3.6.0-Noosa (5873452)
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
[legend]

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.

Note
may not be available in Python bindings, depending on platform support
Since
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.

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

Definition at line 27 of file qgscodeeditor.cpp.

Member Function Documentation

◆ focusOutEvent()

void QgsCodeEditor::focusOutEvent ( QFocusEvent *  event)
overrideprotected

Definition at line 50 of file qgscodeeditor.cpp.

◆ foldingVisible()

bool QgsCodeEditor::foldingVisible ( )
inline

Definition at line 73 of file qgscodeeditor.h.

◆ getMonospaceFont()

QFont QgsCodeEditor::getMonospaceFont ( )
protected

Definition at line 194 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.

Parameters
textThe text to be inserted

Definition at line 172 of file qgscodeeditor.cpp.

◆ isFixedPitch()

bool QgsCodeEditor::isFixedPitch ( const QFont &  font)
protected

Definition at line 189 of file qgscodeeditor.cpp.

◆ keyPressEvent()

void QgsCodeEditor::keyPressEvent ( QKeyEvent *  event)
overrideprotected

Definition at line 80 of file qgscodeeditor.cpp.

◆ marginVisible()

bool QgsCodeEditor::marginVisible ( )
inline

Definition at line 66 of file qgscodeeditor.h.

◆ setFoldingVisible()

void QgsCodeEditor::setFoldingVisible ( bool  folding)

Set folding visible state.

Parameters
foldingSet folding in the editor

Definition at line 159 of file qgscodeeditor.cpp.

◆ setMarginVisible()

void QgsCodeEditor::setMarginVisible ( bool  margin)

Set margin visible state.

Parameters
marginSet margin in the editor

Definition at line 141 of file qgscodeeditor.cpp.

◆ setTitle()

void QgsCodeEditor::setTitle ( const QString &  title)

Set the widget title.

Parameters
titlewidget title

Definition at line 136 of file qgscodeeditor.cpp.


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