QGIS API Documentation  2.17.0-Master (0497e4a)
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="", 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.

Note
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.

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
Note
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)
overrideprotected

Definition at line 49 of file qgscodeeditor.cpp.

§ foldingVisible()

bool QgsCodeEditor::foldingVisible ( )
inline

Definition at line 64 of file qgscodeeditor.h.

§ getMonospaceFont()

QFont QgsCodeEditor::getMonospaceFont ( )
protected

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.

Parameters
theTextThe text to be inserted

Definition at line 154 of file qgscodeeditor.cpp.

§ isFixedPitch()

bool QgsCodeEditor::isFixedPitch ( const QFont font)
protected

Definition at line 171 of file qgscodeeditor.cpp.

§ keyPressEvent()

void QgsCodeEditor::keyPressEvent ( QKeyEvent event)
overrideprotected

Definition at line 79 of file qgscodeeditor.cpp.

§ marginVisible()

bool QgsCodeEditor::marginVisible ( )
inline

Definition at line 58 of file qgscodeeditor.h.

§ setFoldingVisible()

void QgsCodeEditor::setFoldingVisible ( bool  folding)

Set folding visible state.

Parameters
foldingSet folding in the editor

Definition at line 140 of file qgscodeeditor.cpp.

§ setMarginVisible()

void QgsCodeEditor::setMarginVisible ( bool  margin)

Set margin visible state.

Parameters
marginSet margin in the editor

Definition at line 120 of file qgscodeeditor.cpp.

§ setTitle()

void QgsCodeEditor::setTitle ( const QString title)

Set the widget title.

Parameters
titlewidget title

Definition at line 115 of file qgscodeeditor.cpp.


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