Class: QgsCodeEditorSQL¶
- class qgis.gui.QgsCodeEditorSQL¶
Bases:
QgsCodeEditor
A SQL editor based on QScintilla2. Adds syntax highlighting and code autocompletion.
Note
may not be available in Python bindings, depending on platform support
New in version 2.6.
QgsCodeEditorSQL(parent: QWidget = None) Constructor for QgsCodeEditorSQL
Methods
Returns the extra keywords.
Returns field names from the lexer API.
Returns
True
if afont
is a fixed pitch font.- rtype:
Qgis.ScriptLanguage
Returns the color to use in the lexer for the specified
role
.Returns the font to use in the lexer.
Called when the context
menu
for the widget is about to be shown, after it has been fully populated with the standard actions created by the base class.Applies code reformatting to a
string
and returns the result.Performs tasks which must be run after a lexer has been set for the widget.
scrollContentsBy
Set extra keywords to
extraKeywords
.Set field names to
fieldNames
to be added to the lexer API.Set field names to be added to the lexer API.
Shows a user facing message (eg a warning message).
Triggers an update of the interactive prompt part of the editor.
Updates the soft history by storing the current editor text in the history.
- actionEvent(self, QActionEvent)¶
- canInsertFromMimeData(self, QMimeData) bool ¶
- changeEvent(self, QEvent)¶
- childEvent(self, QChildEvent)¶
- closeEvent(self, QCloseEvent)¶
- connectNotify(self, QMetaMethod)¶
- contextMenuEvent(self, event: QContextMenuEvent)¶
- create(self, window: PyQt5.sip.voidptr = 0, initializeWindow: bool = True, destroyOldWindow: bool = True)¶
- customEvent(self, QEvent)¶
- destroy(self, destroyWindow: bool = True, destroySubWindows: bool = True)¶
- disconnectNotify(self, QMetaMethod)¶
- dragEnterEvent(self, QDragEnterEvent)¶
- dragLeaveEvent(self, QDragLeaveEvent)¶
- dragMoveEvent(self, QDragMoveEvent)¶
- drawFrame(self, QPainter)¶
- dropEvent(self, QDropEvent)¶
- enterEvent(self, QEvent)¶
- event(self, QEvent) bool ¶
- eventFilter(self, watched: QObject, event: QEvent) bool ¶
- extraKeywords(self) List[str] ¶
Returns the extra keywords.
Extra keywords are usually added from provider connections and represent function and other provider specific keywords.
New in version 3.22.
- Return type:
List[str]
- fieldNames(self) List[str] ¶
Returns field names from the lexer API.
New in version 3.22.
- Return type:
List[str]
- focusInEvent(self, QFocusEvent)¶
- focusNextChild(self) bool ¶
- focusNextPrevChild(self, bool) bool ¶
- focusOutEvent(self, event: QFocusEvent)¶
- focusPreviousChild(self) bool ¶
- fromMimeData(self, QMimeData) Tuple[QByteArray, bool] ¶
- hideEvent(self, QHideEvent)¶
- initPainter(self, QPainter)¶
- initStyleOption(self, QStyleOptionFrame)¶
- initializeLexer(self)¶
- inputMethodEvent(self, QInputMethodEvent)¶
- inputMethodQuery(self, Qt.InputMethodQuery) Any ¶
- isFixedPitch(font: QFont) bool ¶
Returns
True
if afont
is a fixed pitch font.
- isSignalConnected(self, QMetaMethod) bool ¶
- keyPressEvent(self, event: QKeyEvent)¶
- keyReleaseEvent(self, QKeyEvent)¶
- language(self) Qgis.ScriptLanguage ¶
- Return type:
- leaveEvent(self, QEvent)¶
- lexerColor(self, role: QgsCodeEditorColorScheme.ColorRole) QColor ¶
Returns the color to use in the lexer for the specified
role
.New in version 3.16.
- lexerFont(self) QFont ¶
Returns the font to use in the lexer.
New in version 3.16.
- metric(self, QPaintDevice.PaintDeviceMetric) int ¶
- mouseDoubleClickEvent(self, QMouseEvent)¶
- mouseMoveEvent(self, QMouseEvent)¶
- mousePressEvent(self, QMouseEvent)¶
- mouseReleaseEvent(self, QMouseEvent)¶
- moveEvent(self, QMoveEvent)¶
- nativeEvent(self, Union[QByteArray, bytes, bytearray], PyQt5.sip.voidptr) Tuple[bool, int] ¶
- paintEvent(self, QPaintEvent)¶
- populateContextMenu(self, menu: QMenu)¶
Called when the context
menu
for the widget is about to be shown, after it has been fully populated with the standard actions created by the base class.This method provides an opportunity for subclasses to add additional non-standard actions to the context menu.
New in version 3.30.
- receivers(self, PYQT_SIGNAL) int ¶
- reformatCodeString(self, string: str) str ¶
Applies code reformatting to a
string
and returns the result.This is only supported for editors which return the
Qgis
.ScriptLanguageCapability.Reformat capability fromlanguageCapabilities()
.New in version 3.32.
- resizeEvent(self, QResizeEvent)¶
- runPostLexerConfigurationTasks(self)¶
Performs tasks which must be run after a lexer has been set for the widget.
New in version 3.16.
- QgsCodeEditorSQL.scrollContentsBy(self, int, int)
- sender(self) QObject ¶
- senderSignalIndex(self) int ¶
- setExtraKeywords(self, extraKeywords: Iterable[str])¶
Set extra keywords to
extraKeywords
.Extra keywords are usually added from provider connections and represent function and other provider specific keywords.
New in version 3.22.
- Parameters:
extraKeywords (Iterable[str]) –
- setFieldNames(self, fieldNames: Iterable[str])¶
Set field names to
fieldNames
to be added to the lexer API.New in version 3.18.
- Parameters:
fieldNames (Iterable[str]) –
- setFields(self, fields: QgsFields)¶
Set field names to be added to the lexer API.
New in version 3.14.
- Parameters:
fields (QgsFields) –
- QgsCodeEditorSQL.setViewportMargins(self, int, int, int, int)
- setViewportMargins(self, QMargins) None ¶
- showEvent(self, QShowEvent)¶
- showMessage(self, title: str, message: str, level: Qgis.MessageLevel)¶
Shows a user facing message (eg a warning message).
The default implementation uses QMessageBox.
New in version 3.32.
- tabletEvent(self, QTabletEvent)¶
- timerEvent(self, QTimerEvent)¶
- toMimeData(self, Union[QByteArray, bytes, bytearray], bool) QMimeData ¶
- updateMicroFocus(self)¶
- updatePrompt(self)¶
Triggers an update of the interactive prompt part of the editor.
Note
Applies to code editors in the QgsCodeEditor.Mode.CommandInput mode only.
New in version 3.30.
- updateSoftHistory(self)¶
Updates the soft history by storing the current editor text in the history.
New in version 3.30.
- viewportEvent(self, QEvent) bool ¶
- viewportMargins(self) QMargins ¶
- viewportSizeHint(self) QSize ¶
- wheelEvent(self, QWheelEvent)¶