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 – The parent QWidget

  • title – The title to show in the code editor dialog

  • foldingFalse: Enable folding for code editor

  • marginFalse: 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)
focusPreviousChild()
foldingVisible(self) → bool
fromMimeData()
getMonospaceFont(self) → 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 – The text to be inserted

isFixedPitch(self, font: QFont) → bool
isSignalConnected()
keyPressEvent(self, event: QKeyEvent)
keyReleaseEvent()
leaveEvent()
marginVisible(self) → bool
metric()
mouseDoubleClickEvent()
mouseMoveEvent()
mousePressEvent()
mouseReleaseEvent()
moveEvent()
nativeEvent()
paintEvent()
receivers()
resizeEvent()
scrollContentsBy()
sender()
senderSignalIndex()
setFoldingVisible(self, folding: bool)

Set folding visible state

Parameters

folding – Set folding in the editor

setMarginVisible(self, margin: bool)

Set margin visible state

Parameters

margin – Set margin in the editor

setTitle(self, title: str)

Set the widget title

Parameters

title – widget title

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