17#ifndef QGSCODEEDITOR_H
18#define QGSCODEEDITOR_H
23#include <Qsci/qsciapis.h>
78 Q_DECLARE_FLAGS( Flags, Flag )
91 QgsCodeEditor( QWidget * parent
SIP_TRANSFERTHIS =
nullptr,
const QString & title = QString(),
bool folding =
false,
bool margin =
false, QgsCodeEditor::Flags flags = QgsCodeEditor::Flags() );
97 void setTitle(
const QString & title );
104 Q_DECL_DEPRECATED
void setMarginVisible(
bool margin )
SIP_DEPRECATED;
120 void setLineNumbersVisible(
bool visible );
128 bool lineNumbersVisible()
const;
134 void setFoldingVisible(
bool folding );
140 bool foldingVisible();
147 void insertText(
const QString & text );
191 static QFont getMonospaceFont();
200 void setCustomAppearance(
const QString & scheme = QString(),
const QMap< QgsCodeEditorColorScheme::ColorRole, QColor > & customColors = QMap< QgsCodeEditorColorScheme::ColorRole, QColor >(),
const QString & fontFamily = QString(),
int fontSize = 0 )
SIP_SKIP;
208 void addWarning(
int lineNumber, const QString & warning );
216 void clearWarnings();
223 bool isCursorOnLastLine() const;
233 virtual
void moveCursorToStart();
241 virtual
void moveCursorToEnd();
245 bool isFixedPitch( const QFont & font );
247 void focusOutEvent( QFocusEvent * event ) override;
248 void keyPressEvent( QKeyEvent * event ) override;
257 virtual
void initializeLexer();
271 QFont lexerFont() const;
278 void runPostLexerConfigurationTasks();
283 void updateFolding();
285 QString mWidgetTitle;
286 bool mMargin = false;
289 bool mUseDefaultSettings = true;
291 bool mOverrideColors = false;
292 QString mColorScheme;
297 QVector<
int > mWarningLines;
301 static constexpr
int MARKER_NUMBER = 6;
Defines a color scheme for use in QgsCodeEditor widgets.
A text editor based on QScintilla2.
Flag
Flags controlling behavior of code editor.
Q_DECL_DEPRECATED bool marginVisible()
Returns whether margins are in a visible state.
#define SIP_IF_MODULE(condition)
#define SIP_MONKEYPATCH_SCOPEENUM_UNNEST(OUTSIDE_CLASS, FORMERNAME)
Q_DECLARE_OPERATORS_FOR_FLAGS(QgsField::ConfigurationFlags) CORE_EXPORT QDataStream &operator<<(QDataStream &out
Writes the field to stream out. QGIS version compatibility is not guaranteed.