1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232
|
/************************************************************************
* This file has been generated automatically from *
* *
* src/gui/codeeditors/qgscodeeditor.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
class QgsCodeEditor : QsciScintilla
{
%Docstring(signature="appended")
A text editor based on QScintilla2.
.. note::
may not be available in Python bindings, depending on platform support
.. versionadded:: 2.6
%End
%TypeHeaderCode
#include "qgscodeeditor.h"
%End
public:
enum MarginRole
{
LineNumbers,
ErrorIndicators,
FoldingControls,
};
QgsCodeEditor( QWidget *parent /TransferThis/ = 0, const QString &title = QString(), bool folding = false, bool margin = false );
%Docstring
Construct a new code editor.
:param parent: The parent QWidget
:param title: The title to show in the code editor dialog
:param folding: ``False``: Enable folding for code editor
:param margin: ``False``: Enable margin for code editor (deprecated)
.. versionadded:: 2.6
%End
void setTitle( const QString &title );
%Docstring
Set the widget title
:param title: widget title
%End
void setMarginVisible( bool margin ) /Deprecated/;
%Docstring
Set margin visible state
:param margin: Set margin in the editor
.. deprecated::
Use base class methods for individual margins instead, or :py:func:`~QgsCodeEditor.setLineNumbersVisible`
%End
bool marginVisible() /Deprecated/;
%Docstring
Returns whether margins are in a visible state
.. deprecated::
Use base class methods for individual margins instead, or :py:func:`~QgsCodeEditor.lineNumbersVisible`
%End
void setLineNumbersVisible( bool visible );
%Docstring
Sets whether line numbers should be visible in the editor.
Defaults to ``False``.
.. seealso:: :py:func:`lineNumbersVisible`
.. versionadded:: 3.16
%End
bool lineNumbersVisible() const;
%Docstring
Returns whether line numbers are visible in the editor.
.. seealso:: :py:func:`setLineNumbersVisible`
.. versionadded:: 3.16
%End
void setFoldingVisible( bool folding );
%Docstring
Set whether the folding controls are visible in the editor.
.. seealso:: :py:func:`foldingVisible`
%End
bool foldingVisible();
%Docstring
Returns ``True`` if the folding controls are visible in the editor.
.. seealso:: :py:func:`setFoldingVisible`
%End
void insertText( const QString &text );
%Docstring
Insert text at cursor position, or replace any selected text if user has
made a selection.
:param text: The text to be inserted
%End
static QColor defaultColor( QgsCodeEditorColorScheme::ColorRole role, const QString &theme = QString() );
%Docstring
Returns the default color for the specified ``role``.
The optional ``theme`` argument can be used to specify a color ``theme``. A blank
``theme`` indicates the default color scheme.
Available themes are stored in :py:class:`QgsCodeEditorColorSchemeRegistry`, and can be retrieved
via :py:func:`QgsGui.codeEditorColorSchemeRegistry()`.
.. versionadded:: 3.16
%End
static QColor color( QgsCodeEditorColorScheme::ColorRole role );
%Docstring
Returns the color to use in the editor for the specified ``role``.
This color will be the default theme color for the role, unless the user has manually
selected a custom color scheme for the editor.
.. seealso:: :py:func:`setColor`
.. versionadded:: 3.16
%End
static void setColor( QgsCodeEditorColorScheme::ColorRole role, const QColor &color );
%Docstring
Sets the ``color`` to use in the editor for the specified ``role``.
This color will be stored as the new default color for the role, to be used for all code editors.
Set ``color`` to an invalid QColor in order to clear the stored color value and reset it to
the default color.
.. seealso:: :py:func:`color`
.. versionadded:: 3.16
%End
static QFont getMonospaceFont();
%Docstring
Returns the monospaced font to use for code editors.
.. versionadded:: 3.16
%End
void addWarning( int lineNumber, const QString &warning );
%Docstring
Adds a ``warning`` message and indicator to the specified a ``lineNumber``.
.. seealso:: :py:func:`clearWarnings`
.. versionadded:: 3.16
%End
void clearWarnings();
%Docstring
Clears all warning messages from the editor.
.. seealso:: :py:func:`addWarning`
.. versionadded:: 3.16
%End
protected:
bool isFixedPitch( const QFont &font );
virtual void focusOutEvent( QFocusEvent *event );
virtual void keyPressEvent( QKeyEvent *event );
virtual void initializeLexer();
%Docstring
Called when the dialect specific code lexer needs to be initialized (or reinitialized).
The default implementation does nothing.
.. versionadded:: 3.16
%End
QColor lexerColor( QgsCodeEditorColorScheme::ColorRole role ) const;
%Docstring
Returns the color to use in the lexer for the specified ``role``.
.. versionadded:: 3.16
%End
QFont lexerFont() const;
%Docstring
Returns the font to use in the lexer.
.. versionadded:: 3.16
%End
void runPostLexerConfigurationTasks();
%Docstring
Performs tasks which must be run after a lexer has been set for the widget.
.. versionadded:: 3.16
%End
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/gui/codeeditors/qgscodeeditor.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
|