QGIS API Documentation  3.16.0-Hannover (43b64b13f3)
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 
24 SIP_IF_MODULE( HAVE_QSCI_SIP )
25 
26 #ifndef SIP_RUN
27 class 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 
48 class 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
QgsCodeEditor
A text editor based on QScintilla2.
Definition: qgscodeeditor.h:42
qgis_sip.h
QgsCodeEditorPython
A Python editor based on QScintilla2.
Definition: qgscodeeditorpython.h:49
qgscodeeditor.h
SIP_IF_MODULE
#define SIP_IF_MODULE(condition)
Definition: qgis_sip.h:28
QgsCodeEditor::initializeLexer
virtual void initializeLexer()
Called when the dialect specific code lexer needs to be initialized (or reinitialized).
Definition: qgscodeeditor.cpp:149
SIP_TRANSFERTHIS
#define SIP_TRANSFERTHIS
Definition: qgis_sip.h:53