QGIS API Documentation 3.28.0-Firenze (ed3ad0430f)
qgscodeeditorpython.h
Go to the documentation of this file.
1/***************************************************************************
2 qgscodeeditorpython.h - A Python editor based on QScintilla
3 --------------------------------------
4 Date : 06-Oct-2013
5 Copyright : (C) 2013 by Salvatore Larosa
6 Email : lrssvtml (at) gmail (dot) com
7 ***************************************************************************
8 * *
9 * This program is free software; you can redistribute it and/or modify *
10 * it under the terms of the GNU General Public License as published by *
11 * the Free Software Foundation; either version 2 of the License, or *
12 * (at your option) any later version. *
13 * *
14 ***************************************************************************/
15
16#ifndef QGSCODEEDITORPYTHON_H
17#define QGSCODEEDITORPYTHON_H
18
19#include "qgscodeeditor.h"
20#include "qgis_sip.h"
21#include "qgis_gui.h"
22#include <Qsci/qscilexerpython.h>
23
24SIP_IF_MODULE( HAVE_QSCI_SIP )
25
26#ifndef SIP_RUN
28class QgsQsciLexerPython : public QsciLexerPython
29{
30 Q_OBJECT
31 public:
32
33 QgsQsciLexerPython( QObject *parent = nullptr );
34
35 const char *keywords( int set ) const override;
36
37};
39#endif
40
48class GUI_EXPORT QgsCodeEditorPython : public QgsCodeEditor
49{
50 Q_OBJECT
51
52 public:
53
61 QgsCodeEditorPython( QWidget *parent SIP_TRANSFERTHIS = nullptr, const QList<QString> &filenames = QList<QString>() );
62
67 void loadAPIs( const QList<QString> &filenames );
68
73 bool loadScript( const QString &script );
74
75 public slots:
76
82 void searchSelectedTextInPyQGISDocs();
83
84 protected:
85
86 void initializeLexer() override;
87
88 protected slots:
89
95 void autoComplete();
96
97 private:
98
99 QList<QString> mAPISFilesList;
100 QString mPapFile;
101
102};
103
104#endif
A Python editor based on QScintilla2.
A text editor based on QScintilla2.
Definition: qgscodeeditor.h:42
virtual void initializeLexer()
Called when the dialect specific code lexer needs to be initialized (or reinitialized).
#define SIP_IF_MODULE(condition)
Definition: qgis_sip.h:28
#define SIP_TRANSFERTHIS
Definition: qgis_sip.h:53