Class: QgsCodeEditor

class qgis.gui.QgsCodeEditor(parent: QWidget = None, title: str = '', folding: bool = False, margin: bool = False)

Bases: PyQt5.Qsci.QsciScintilla

Construct a new code editor.

Parameters
  • parent (QWidget = None) – The parent QWidget

  • title (str = '') – The title to show in the code editor dialog

  • folding (bool = False) – False: Enable folding for code editor

  • margin (bool = False) – False: Enable margin for code editor

New in version 2.6.

A text editor based on QScintilla2.

Note

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

actionEvent()
canInsertFromMimeData()
changeEvent()
childEvent()
closeEvent()
connectNotify()
contextMenuEvent()
create()
customEvent()
destroy()
disconnectNotify()
dragEnterEvent()
dragLeaveEvent()
dragMoveEvent()
drawFrame()
dropEvent()
enterEvent()
event()
eventFilter()
focusInEvent()
focusNextChild()
focusNextPrevChild()
focusOutEvent(self, event: QFocusEvent)
Parameters

event (QFocusEvent) –

focusPreviousChild()
foldingVisible(self) → bool
Return type

bool

fromMimeData()
getMonospaceFont(self) → QFont
Return type

QFont

hideEvent()
initPainter()
initStyleOption()
inputMethodEvent()
inputMethodQuery()
insertText(self, text: str)

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

Parameters

text (str) – The text to be inserted

isFixedPitch(self, font: QFont) → bool
Parameters

font (QFont) –

Return type

bool

isSignalConnected()
keyPressEvent(self, event: QKeyEvent)
Parameters

event (QKeyEvent) –

keyReleaseEvent()
leaveEvent()
marginVisible(self) → bool
Return type

bool

metric()
mouseDoubleClickEvent()
mouseMoveEvent()
mousePressEvent()
mouseReleaseEvent()
moveEvent()
nativeEvent()
paintEvent()
receivers()
resizeEvent()
scrollContentsBy()
sender()
senderSignalIndex()
setFoldingVisible(self, folding: bool)

Set folding visible state

Parameters

folding (bool) – Set folding in the editor

setMarginVisible(self, margin: bool)

Set margin visible state

Parameters

margin (bool) – Set margin in the editor

setTitle(self, title: str)

Set the widget title

Parameters

title (str) – widget title

setViewportMargins()
sharedPainter()
showEvent()
tabletEvent()
timerEvent()
toMimeData()
updateMicroFocus()
viewportEvent()
viewportMargins()
viewportSizeHint()
wheelEvent()