Subgroup: Code

Class: QgsCodeEditorPython

class qgis.gui.QgsCodeEditorPython(parent: QWidget = None, filenames: Iterable[str] = [])

Bases: qgis._gui.QgsCodeEditor

Construct a new Python editor.

Parameters:
  • parent – The parent QWidget
  • filenames – The list of apis files to load for the Python lexer

New in version 2.6.

A Python editor based on QScintilla2. Adds syntax highlighting and code autocompletion.

New in version 2.6.

actionEvent()
canInsertFromMimeData()
changeEvent()
childEvent()
closeEvent()
connectNotify()
contextMenuEvent()
create()
customEvent()
destroy()
disconnectNotify()
dragEnterEvent()
dragLeaveEvent()
dragMoveEvent()
drawFrame()
dropEvent()
enterEvent()
event()
eventFilter()
focusInEvent()
focusNextChild()
focusNextPrevChild()
focusOutEvent()
focusPreviousChild()
fromMimeData()
getMonospaceFont()
hideEvent()
initPainter()
initStyleOption()
inputMethodEvent()
inputMethodQuery()
isFixedPitch()
isSignalConnected()
keyPressEvent()
keyReleaseEvent()
leaveEvent()
loadAPIs(self, filenames: Iterable[str])

Load APIs from one or more files

Parameters:filenames – The list of apis files to load for the Python lexer
loadScript(self, script: str) → bool

Load a script file

Parameters:script – The script file to load
metric()
mouseDoubleClickEvent()
mouseMoveEvent()
mousePressEvent()
mouseReleaseEvent()
moveEvent()
nativeEvent()
paintEvent()
receivers()
resizeEvent()
scrollContentsBy()
sender()
senderSignalIndex()
setViewportMargins()
sharedPainter()
showEvent()
tabletEvent()
timerEvent()
toMimeData()
updateMicroFocus()
viewportEvent()
viewportMargins()
viewportSizeHint()
wheelEvent()