107 Commits

Author SHA1 Message Date
Yoann Quenach de Quivillic
ff2f1f0e3f Remove python parameter and add context menu actions 2024-11-14 09:54:48 +10:00
Yoann Quenach de Quivillic
25480e872c Interactive Help on F1 2024-11-14 09:54:48 +10:00
Yoann Quenach de Quivillic
39782d67fd Add comment on style index 2024-09-30 10:12:35 +10:00
Yoann Quenach de Quivillic
8981b49634 Fix syntax highlighting after exception 2024-09-30 10:12:35 +10:00
Nyall Dawson
5959be560e Fix future imports 2024-05-10 13:56:49 +10:00
Nyall Dawson
cd3b7f17bf Fix lint error in type checking 2024-05-10 13:56:49 +10:00
Nyall Dawson
249cc6d591 [console] Clean up objects a little
- Don't use ambiguous .parent members, use explicit names
- Add some typehints
2024-05-10 13:56:49 +10:00
Nyall Dawson
4dcdddaa02 [console] Don't needlessly store QgsSettings objects
These are cheap to construct by design, so we can avoid
storing them and the messy cross-class access to member
variables
2024-03-07 14:17:22 +01:00
Nyall Dawson
310b9172fb pyqt5to6: raise warnings on fragile addAction calls
The object.addAction variants with multiple arguments have changed
signature in Qt 6. It's safer to explicitly create a QAction first
and then add to an object using:

    my_action=QAction(...)
    obj.addAction(my_action)

It's a considerably less fragile syntax to use in any case!

Fixes errors when trying to show context menu in Python console
on Qt 6 builds
2024-01-31 10:55:33 +10:00
Nyall Dawson
e42abf7dc5 Update python files 2024-01-22 05:46:15 +10:00
Nyall Dawson
c16a1e2b3d Update enums 2024-01-19 19:44:48 +10:00
Nyall Dawson
d7ae0aea25 + should not be used with flags 2024-01-19 19:44:48 +10:00
Nyall Dawson
23df946386 Handle QSci enums in pyqt5 to qt6 2024-01-19 19:44:48 +10:00
Nyall Dawson
29a87bf0fc Fix enums in console 2024-01-19 19:44:48 +10:00
Nyall Dawson
fcfe98c8ed Some super-safety in overridden stdout/stderr to ensure we don't
try to write to a deleted qwidget
2023-06-14 07:48:13 +10:00
Nyall Dawson
def4acc14a Gracefully restore the system stdout/stderr when the python console
is about to be destroyed
2023-06-14 07:48:13 +10:00
Yoann Quenach de Quivillic
ab98551fec Apply suggestions from code review
Co-authored-by: Étienne Trimaille <gustrimaille@yahoo.fr>
2023-05-26 09:38:25 +10:00
Yoann Quenach de Quivillic
88c3c41638 Improve console help 2023-05-26 09:38:25 +10:00
Nyall Dawson
895a68faee Expose 'Search Selection in PyQGIS docs' action for all python code editors 2023-04-06 08:32:41 +10:00
Nyall Dawson
955c72388d Factor out interpreter 2022-10-24 16:46:11 +10:00
Nyall Dawson
ed54489a09 Move some useful python console methods to base class 2022-10-10 14:01:24 +10:00
Nyall Dawson
0f54df6675 [console] Prepend introductory text with '#' to avoid attempting to format it as Python code 2021-03-31 05:22:12 +10:00
Nyall Dawson
18d8a76009 Fix incorrect capitalization 2021-03-31 05:22:12 +10:00
Nyall Dawson
8d3e028d15 Cleanup raw margin manipulation used to hide holding controls, use proper methods 2020-10-13 14:14:53 +10:00
Nyall Dawson
33f50496d7 Fix bad merge 2020-10-06 03:57:50 +10:00
Nyall Dawson
8ec7f0e69c Remove QgsPythonConsoleBase so that we have a single definitive Python editor class (QgsCodeEditorPython) 2020-10-06 03:57:50 +10:00
nirvn
f67515c674 [console] Additional tweaks to looks of console input/output area 2020-10-05 17:18:43 +07:00
Nyall Dawson
bc55102eb8 Move icon references back out of QgsPythonConsoleBase 2020-10-05 18:37:46 +10:00
Nyall Dawson
e66a0a025b Move more code out of QgsPythonConsoleBase 2020-10-05 18:37:46 +10:00
Nyall Dawson
d9782a12f5 Move more code to QgsCodeEditorPython base class 2020-10-05 13:24:46 +10:00
Nyall Dawson
ad946d45c8 Ensure colors in Python console match colors for Python editors
used elsewhere in the application
2020-10-04 05:02:57 +10:00
Richard Duivenvoorde
982e4f1262 Rename BaseClass to QgsPythonConsoleBase 2020-09-03 16:03:25 +02:00
Richard Duivenvoorde
354b9598ec Move font, margin and caret code to baseclass 2020-08-27 18:26:54 +02:00
Richard Duivenvoorde
ab83e57cc8 Context menu 'Search selected in PyQGIS docs' in Console panes 2020-07-08 21:47:08 +02:00
Richard Duivenvoorde
a1fda50f95 Move setLexers to base 2020-07-08 21:17:27 +02:00
Richard Duivenvoorde
180a630363 Move icons to base and add some to items 2020-07-05 11:48:27 +02:00
Richard Duivenvoorde
5889f7df78 Add simple BaseClass 2020-07-04 16:36:47 +02:00
Matthias Kuhn
af670a264e Improve security warning on console 2020-06-29 07:23:20 +10:00
Nyall Dawson
33fb57e4a0 Also restrict scope of Ctrl+A select all shortcut to avoid ambiguity 2020-06-04 10:59:27 +10:00
Nyall Dawson
873716c6fa Limit scope of Ctrl+C shortcut for copy features to canvas and for
python console to console widget

Avoids ambiguous shortcut warnings/unexpected behavior when pressing
Ctrl+C

Fixes #27035
Fixes #31918
Fixes #31914
Fixes #31392
2020-06-04 10:59:27 +10:00
nirvn
296fc6cf89 [python console] Move the >>> prompt into the margin to fix a gazillion issues 2020-06-03 11:45:13 +07:00
Nyall Dawson
b6a7a10703 Fix some more python formatting issues, remove more flake exceptions 2020-05-11 11:41:50 +10:00
Julien Cabieces
b82ce0e522 fix crash when print from qgis processing algorithm while the python console is displayed 2019-01-29 21:34:45 +11:00
nirvn
2aebeb0157 [ui] add security warning to the python console 2018-08-20 14:41:07 +07:00
Matthias Kuhn
ae192e8624 Make console printing safe
References #8343 https://issues.qgis.org/issues/8343
2018-07-02 18:35:24 -05:00
nirvn
45aca2f942 fix unclosed strings not style in python console & script editor 2018-05-23 10:08:02 +07:00
nirvn
9cf6bbf424 Improve default color scheme for python console & script editor 2018-05-22 17:56:25 +07:00
nirvn
45b045d212 Fix missing color settings for python console / script editor 2018-05-22 13:31:29 +07:00
Nyall Dawson
6d87a4cf3f [console] Fix unclosed strings don't respect the preset font size 2018-05-22 15:43:14 +10:00
Shiva Reddy
536cc9cfbe Update writeOut to include isatty (#6602)
Added these lines so that QGIS 3 python console works in window
2018-03-16 08:20:14 +11:00