QGIS API Documentation 3.99.0-Master (26c88405ac0)
Loading...
Searching...
No Matches
qgscodeeditorr.h
Go to the documentation of this file.
1/***************************************************************************
2 qgscodeeditorr.h - A R stats editor based on QScintilla
3 --------------------------------------
4 Date : October 2022
5 Copyright : (C) 2022 by Nyall Dawson
6 Email : nyall dot dawson 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 QGSCODEEDITORR_H
17#define QGSCODEEDITORR_H
18
19#include "qgis_gui.h"
20#include "qgis_sip.h"
21#include "qgscodeeditor.h"
22
23#include <Qsci/qscilexer.h>
24
25SIP_IF_MODULE( HAVE_QSCI_SIP )
26
27#ifndef SIP_RUN
28
30class GUI_EXPORT QgsQsciLexerR : public QsciLexer
31{
32 Q_OBJECT
33 public:
34 enum Styles
35 {
36 Default = 0,
37 Comment = 1,
38 Kword = 2,
39 BaseKword = 3,
40 OtherKword = 4,
41 Number = 5,
42 String = 6,
43 String2 = 7,
44 Operator = 8,
45 Identifier = 9,
46 Infix = 10,
47 InfixEOL = 11,
48 Backticks = 12,
49 RawString = 13,
50 RawString2 = 14,
51 EscapeSequence = 15
52 };
53
54 QgsQsciLexerR( QObject *parent = nullptr );
55 const char *language() const override;
56 const char *lexer() const override;
57 int lexerId() const override;
58 QString description( int style ) const override;
59 const char *keywords( int set ) const override;
60};
62#endif
63
71class GUI_EXPORT QgsCodeEditorR : public QgsCodeEditor
72{
73 Q_OBJECT
74
75 public:
78 Qgis::ScriptLanguage language() const override;
79
80 protected:
81 void initializeLexer() override;
82};
83
84#endif // QGSCODEEDITORR_H
ScriptLanguage
Scripting languages.
Definition qgis.h:4478
QgsCodeEditorR(QWidget *parent=nullptr, QgsCodeEditor::Mode mode=QgsCodeEditor::Mode::ScriptEditor)
Constructor for QgsCodeEditorR.
void initializeLexer() override
Called when the dialect specific code lexer needs to be initialized (or reinitialized).
Qgis::ScriptLanguage language() const override
Returns the associated scripting language.
QgsCodeEditor::Mode mode() const
Returns the code editor mode.
Mode
Code editor modes.
@ ScriptEditor
Standard mode, allows for display and edit of entire scripts.
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.
#define SIP_IF_MODULE(condition)
Definition qgis_sip.h:28
#define SIP_TRANSFERTHIS
Definition qgis_sip.h:53