16#ifndef QGSCODEEDITORPYTHON_H
17#define QGSCODEEDITORPYTHON_H
23#include <Qsci/qscilexerpython.h>
33class QgsQsciLexerPython :
public QsciLexerPython
37 QgsQsciLexerPython( QObject *parent =
nullptr );
39 const char *keywords(
int set )
const override;
86 void loadAPIs(
const QList<QString> &filenames );
162 QList<QString> mAPISFilesList;
167 static const QMap<QString, QString> sCompletionPairs;
170 static const QStringList sCompletionSingleCharacters;
ScriptLanguage
Scripting languages.
QFlags< ScriptLanguageCapability > ScriptLanguageCapabilities
Script language capabilities.
void autoComplete()
Triggers the autocompletion popup.
QString characterAfterCursor() const
Returns the character after the cursor, or an empty string if the cursor is set at end.
bool isCursorInsideStringLiteralOrComment() const
Check whether the current cursor position is inside a string literal or a comment.
void searchSelectedTextInPyQGISDocs()
Searches the selected text in the official PyQGIS online documentation.
void loadAPIs(const QList< QString > &filenames)
Load APIs from one or more files.
virtual void showApiDocumentation(const QString &item)
Displays the given text in the official APIs (PyQGIS, C++ QGIS or Qt) documentation.
PRIVATE QgsCodeEditorPython(QWidget *parent=nullptr, const QList< QString > &filenames=QList< QString >(), QgsCodeEditor::Mode mode=QgsCodeEditor::Mode::ScriptEditor, QgsCodeEditor::Flags flags=QgsCodeEditor::Flag::CodeFolding)
Construct a new Python editor.
void updateCapabilities()
Updates the editor capabilities.
bool loadScript(const QString &script)
Loads a script file.
QString characterBeforeCursor() const
Returns the character before the cursor, or an empty string if cursor is set at start.
QgsCodeEditor::Mode mode() const
Returns the code editor mode.
@ ScriptEditor
Standard mode, allows for display and edit of entire scripts.
virtual void toggleComment()
Toggle comment for the selected text.
void keyPressEvent(QKeyEvent *event) override
virtual void populateContextMenu(QMenu *menu)
Called when the context menu for the widget is about to be shown, after it has been fully populated w...
QFlags< Flag > Flags
Flags controlling behavior of code editor.
static QgsSettingsTreeNode * sTreeCodeEditor
virtual Qgis::ScriptLanguageCapabilities languageCapabilities() const
Returns the associated scripting language capabilities.
bool event(QEvent *event) override
virtual void initializeLexer()
Called when the dialect specific code lexer needs to be initialized (or reinitialized).
QgsCodeEditor(QWidget *parent=nullptr, const QString &title=QString(), bool folding=false, bool margin=false, QgsCodeEditor::Flags flags=QgsCodeEditor::Flags(), QgsCodeEditor::Mode mode=QgsCodeEditor::Mode::ScriptEditor)
Construct a new code editor.
@ CodeFolding
Indicates that code folding should be enabled for the editor.
virtual Qgis::ScriptLanguage language() const
Returns the associated scripting language.
virtual QString reformatCodeString(const QString &string)
Applies code reformatting to a string and returns the result.
virtual bool checkSyntax()
Applies syntax checking to the editor.
A boolean settings entry.
A template class for enum and flag settings entry.
An integer settings entry.
A tree node for the settings tree to help organizing and introspecting the tree.
#define SIP_IF_MODULE(condition)