This isn't exposed in the GUI, but allows users to
set a specific editor command to use when opening
Python files in the external editor.
Use the token <file> to insert the filename, <line>
to insert line number, and <col> to insert the column number.
Eg:
QgsSettings().setValue(
'gui/code-editor/python/external-editor',
'kate -l <line> -c <col> "<file>"')
This allows the editor to be opened in a proper detached process,
avoiding the editor being closed when QGIS is exited.
Move to a blocklist for terminal text editors instead of the fragile
polling approach (which eg doesn't work if the editor is set to
pycharm)
This widget wraps an existing QgsCodeEditor object in a widget which provides
additional standard functionality, currently a line-for-line port of the Python
console script editor search tools.
The caller must create an unparented QgsCodeEditor object
(or a subclass of QgsCodeEditor) first, and then construct a
QgsCodeEditorWidget passing this object to the constructor.
Ideally, this functionality would be added to the base QgsCodeEditor
class itself. But this is NOT possible without considerable API
breakage, as QgsCodeEditor currently inherits the QsciScintilla widget.
We cannot change QgsCodeEditor to inherit a generic QWidget
container containing a QsciScintilla widget + other widgets in
a layout without breaking API. I've added a cleanup note for
QGIS 4.0 here.
And make sipify handle this nicely. This means that all our non-flag
style enums correctly map across to IntFlag python enums on Qt 6,
fixing issues with negative enum values for these and providing
a better match for the original c++ enum.
These are triggered when a InputMethod event is sent to the widget.
There's upstream discussion at https://sourceforge.net/p/scintilla/bugs/1913/
and the fix was added to QScintilla version 2.13.3
As the loss of text is an extreme risk, just disable input method
handling in these widgets on affected versions entirely.
Fixes#52459
widget and a full main window dialog
Adds the same toggle button as we use for 3d map canvases and attribute
tables to make it super-easy to switch the Python console to a full
main window.